OP_IF_FALSE_JUMP #9
Closed
Ratstail91
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A funny thing about if-else, while and for - they can all be coded using an opcode called
OP_IF_FALSE_JUMP
- but in some cases, a simple OP_JUMP can suffice.In both cases, the labels could be relative to the code-section start in the compiler, or they could be relative to their own positions - I'm not sure which is a better fit, but I'm leaning towards the latter. I think an integer value for the jump distance is required.
Here's some scratches I dug up and cleaned up.
if:
if, else:
while:
for:
Beta Was this translation helpful? Give feedback.
All reactions