FA-90294 / Bytecode virtual machines / Member archive
Wordcode prefixes: forward jumps measured from the jump itself · case 04
JUMP_FORWARD lands one instruction early.
Case contract
Two-byte wordcode (opcode, arg). EXTENDED_ARG (144) prefixes build wider arguments: each prefix ORs its byte into an accumulator that is then shifted left 8; the real instruction ORs its own byte in and resets the accumulator. Each decoded instruction reports [start of its first prefix, own offset, name, full arg, jump target in bytes]: JUMP_FORWARD (110) targets the next instruction plus 2*arg, JUMP_ABSOLUTE (113) targets 2*arg. A prefix at the end reports ["dangling-extended-arg", start]. A trailing odd byte is ignored.
Why this case matters
Instruction prefixes change argument width and jump targets in wordcode interpreters.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| prefixed forward jump is relative to the next instruction | [[0, 0, "NOP", 0, null], [2, 4, "JUMP_FORWARD", 260, 524], [6, 6, "RETURN_VALUE", 0, null]] | [[0, 0, "NOP", 0, null], [2, 4, "JUMP_FORWARD", 260, 526], [6, 6, "RETURN_VALUE", 0, null]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗