fix the if syntax and branches

This commit is contained in:
Torsten Ruger
2015-10-19 16:22:24 +03:00
parent 1fd937927c
commit 99cff3aa32
5 changed files with 44 additions and 53 deletions

View File

@ -103,14 +103,16 @@ module Interpreter
end
def execute_IsZero
#puts @instruction.inspect
if( @flags[:zero] )
target = @instruction.block
set_block target
return false
else
return true
end
@flags[:zero] ? execute_Branch : true
end
def execute_IsNotzero
@flags[:zero] ? true : execute_Branch
end
def execute_IsPlus
@flags[:plus] ? execute_Branch : true
end
def execute_IsMinus
@flags[:minus] ? execute_Branch : true
end
def execute_LoadConstant