ridiculously easy to implement the if now

This commit is contained in:
Torsten Ruger
2014-05-24 10:41:57 +03:00
parent 00d85156da
commit 61a60abd08
5 changed files with 39 additions and 2 deletions

View File

@ -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