Jack ZRP wrote
I put the "if-goto" Translated into
...
@funtionName$label
D;JLT
but it make mistake.
then I replace "JLT" with "JNE"
It comparison ended successfully!
...
if the top of the stack is -1(0xffff, true)
out < 0, so I think "JLT" can also work
The VM specification in 8.3.1 says:
"if-goto
label This command effects a
conditional goto operation. The stack’s
topmost value is popped; if the value is
not zero, execution continues from the
location marked by the
label; otherwise, execution continues from the next command
in the program. The jump destination must be located in the same function."
If the top of stack value is 123, for example, then if-goto must jump. This is why JLT doesn't work.
--Mark