Sorry, I find this quite confusing. I'm familiar with more than one assembly language and SubX -- to the extent I can follow the docs -- seems excessively complicated and inconsistent, compared to a conventional one. Actually this may just be bad documentation. Turning to the list of opcodes[1], which exactly are the opcodes in,
01: add r32 to rm32 (add)
03: add rm32 to r32 (add)
05: add imm32 to EAX (add)
....etc
Is "01:" the opcode? Meaning we should memorize the hex values that it is the normal assembler's job to produce? And how does something like
bb: copy imm32 to EBX (mov)
relate to the example code
bb/copy-to-ebx 1/imm32
If "bb" is the opcode, why does it need to be repeated as text (metadata?) saying the same thing, only in a different order to the table? If the way to write a "bb" instruction is the above, what is the way to write an "0f" instruction?
0f 86: jump disp32 bytes away if lesser or equal (addr, float), if ZF is set or CF is set (jcc/jbe/jna)
I mean I'm guessing it would start "0f/" but after that, how much gets repeated and with what metadata?
[1] https://github.com/akkartik/mu/blob/main/subx_opcodes
[1] https://github.com/akkartik/mu/blob/main/subx_opcodes