KOS_OP_JUMP_TRUE
Style: LABEL. Arg = target pc (post-compile).
Stack: Pops one value; if true, jump to
arg; else advance PC.Invariants: Jump locality for target.
Compiler form: Pre-compile arg = string label; post-compile arg = pc.
Example: Jump if TOS is true (e.g. “then” branch).
index |
opcode |
arg |
arg view |
comment |
|---|---|---|---|---|
0 |
VAR |
0 |
0 (x) |
stack: […, x] |
1 |
JUMP_TRUE |
3 |
3 (-> 3) |
pop TOS; if true → pc=3 |
2 |
CONST |
0 |
0 (0) |
else path |
3 |
LABEL |
– |
– |
then path |
4 |
RETURN |
1 |
1 |