jmp condition-suffix mnemonics work?Tracker: #151 (split from #144) ·
Marker site: demos/happy-path.a
Appendix B (p.276) of the LCC reference states that jmp uses the same
mnemonic suffixes as the branch instructions — implying jmpz, jmpnz,
jmpn, jmpp, jmplt, jmpgt, jmpc, jmpb, jmpal, etc. all exist. But the
suffixed jmp forms error on assembly in lccjs with Invalid operation. Is
that a documentation error, an lccjs gap, or an oracle gap?
Assembled minimal programs using suffixed jmp forms with both lccjs and the
reference oracle (cuh63 6.3 lcc, via LCC_ORACLE), e.g.:
.start main
main: mvi r0, 5
jmpz r0
halt
| form | lccjs | oracle (cuh63 6.3) |
|---|---|---|
jmp r0 (plain) |
✅ assembles | ✅ assembles |
jmpz r0 |
❌ Invalid operation (line 3) |
❌ Invalid operation (line 3) |
jmpn r0, jmpe r0, … |
❌ Invalid operation |
❌ Invalid operation |
jmp with the same
Invalid operation diagnostic..e after the errored assembly — that is the
documented deviation 10 blank/header-only artifact
(OG LCC writes a runnable-looking blank .e even on failed assembly), not a
successful assembly of jmpz.src/core/assembler.js recognises jmp (and ret)
but has no jmpXX cases — the condition suffixes (z/nz/n/p/lt/gt/c/b/al)
belong only to the br family. Any jmpXX token falls through to
Invalid operation. Consistent with the ISA: jmp is encoded 1100 000 baser offset6 with no condition-code field (see docs/lcc-isa.md).Documentation error in Appendix B p.276 — condition-suffixed jmp is not
implemented by the LCC architecture as realised in either lccjs or the reference
oracle. The conditional-control-flow instruction is br<cc>; jmp is the
unconditional register-relative jump.
jmpXX is correct, parity-preserving behaviour.