Start hiding members
This commit is contained in:
24
ophandler.go
24
ophandler.go
@@ -80,70 +80,70 @@ func (state *State) DivideSigned(instr *Instruction) {
|
||||
func (state *State) IsEqual(instr *Instruction) {
|
||||
in1 := state.ReadUnsigned(&instr.Operand1)
|
||||
in2 := state.ReadUnsigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 == in2)
|
||||
state.comparisonResult = (in1 == in2)
|
||||
}
|
||||
|
||||
func (state *State) IsLessThanUnsigned(instr *Instruction) {
|
||||
in1 := state.ReadUnsigned(&instr.Operand1)
|
||||
in2 := state.ReadUnsigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 < in2)
|
||||
state.comparisonResult = (in1 < in2)
|
||||
}
|
||||
|
||||
func (state *State) IsLessThanSigned(instr *Instruction) {
|
||||
in1 := state.ReadSigned(&instr.Operand1)
|
||||
in2 := state.ReadSigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 < in2)
|
||||
state.comparisonResult = (in1 < in2)
|
||||
}
|
||||
|
||||
func (state *State) IsGreaterThanUnsigned(instr *Instruction) {
|
||||
in1 := state.ReadUnsigned(&instr.Operand1)
|
||||
in2 := state.ReadUnsigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 > in2)
|
||||
state.comparisonResult = (in1 > in2)
|
||||
}
|
||||
|
||||
func (state *State) IsGreaterThanSigned(instr *Instruction) {
|
||||
in1 := state.ReadSigned(&instr.Operand1)
|
||||
in2 := state.ReadSigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 > in2)
|
||||
state.comparisonResult = (in1 > in2)
|
||||
}
|
||||
|
||||
func (state *State) IsLessThanOrEqualUnsigned(instr *Instruction) {
|
||||
in1 := state.ReadUnsigned(&instr.Operand1)
|
||||
in2 := state.ReadUnsigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 <= in2)
|
||||
state.comparisonResult = (in1 <= in2)
|
||||
}
|
||||
|
||||
func (state *State) IsLessThanOrEqualSigned(instr *Instruction) {
|
||||
in1 := state.ReadSigned(&instr.Operand1)
|
||||
in2 := state.ReadSigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 <= in2)
|
||||
state.comparisonResult = (in1 <= in2)
|
||||
}
|
||||
|
||||
func (state *State) IsGreaterThanOrEqualUnsigned(instr *Instruction) {
|
||||
in1 := state.ReadUnsigned(&instr.Operand1)
|
||||
in2 := state.ReadUnsigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 >= in2)
|
||||
state.comparisonResult = (in1 >= in2)
|
||||
}
|
||||
|
||||
func (state *State) IsGreaterThanOrEqualSigned(instr *Instruction) {
|
||||
in1 := state.ReadSigned(&instr.Operand1)
|
||||
in2 := state.ReadSigned(&instr.Operand2)
|
||||
state.ComparisonResult = (in1 >= in2)
|
||||
state.comparisonResult = (in1 >= in2)
|
||||
}
|
||||
|
||||
func (state *State) Jump(instr *Instruction) {
|
||||
in := state.ReadSigned(&instr.Operand1)
|
||||
state.InstructionIndex += in - 1
|
||||
state.instructionIndex += in - 1
|
||||
}
|
||||
|
||||
func (state *State) JumpIfTrue(instr *Instruction) {
|
||||
if state.ComparisonResult == true {
|
||||
if state.comparisonResult == true {
|
||||
state.Jump(instr)
|
||||
}
|
||||
}
|
||||
|
||||
func (state *State) JumpIfFalse(instr *Instruction) {
|
||||
if state.ComparisonResult == false {
|
||||
if state.comparisonResult == false {
|
||||
state.Jump(instr)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user