ridiculously easy to implement the if now
This commit is contained in:
@ -38,6 +38,8 @@ module Vm
|
||||
:gt
|
||||
when :gt
|
||||
:le
|
||||
when :lt
|
||||
:ge
|
||||
else
|
||||
raise "no implemented #{@operator}"
|
||||
end
|
||||
@ -96,6 +98,9 @@ module Vm
|
||||
def greater_than block , right
|
||||
RegisterMachine.instance.integer_greater_than block , self , right
|
||||
end
|
||||
def less_than block , right
|
||||
RegisterMachine.instance.integer_less_than block , self , right
|
||||
end
|
||||
def == other
|
||||
code = class_for(CompareInstruction).new(self , other , opcode: :cmp)
|
||||
end
|
||||
|
Reference in New Issue
Block a user