sd:isa
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sd:isa [2026/05/13 14:48] – appledog | sd:isa [2026/06/10 04:36] (current) – appledog | ||
|---|---|---|---|
| Line 38: | Line 38: | ||
| | 67 | JC | JC @label | | 67 | JC | JC @label | ||
| | 68 | JNC | JNC @label | | 68 | JNC | JNC @label | ||
| - | | 84 | CALL | CALL @label | + | | 84 | [[#call|CALL]] | CALL @label |
| | 85 | RET | | 85 | RET | ||
| | 86 | INT | INT 0x10 | Software interrupt | | | | 86 | INT | INT 0x10 | Software interrupt | | | ||
| Line 193: | Line 193: | ||
| == Dictionary | == Dictionary | ||
| here you will find information about each opcode. | here you will find information about each opcode. | ||
| + | |||
| + | <wrap #call />< | ||
| + | **'' | ||
| + | |||
| + | The CALLR instruction takes a register operand and dispatches based on the register' | ||
| <wrap #sez />< | <wrap #sez />< | ||
| Line 269: | Line 274: | ||
| <wrap #case /> | <wrap #case /> | ||
| **''# | **''# | ||
| + | |||
| + | CASE is unusual because it reads from the instruction stream as data. The inline jump table isn't fetched and decoded, it's just structured bytes. This is the same pattern as LD_IMM (where the operand is fetched), but pushed further: an opcode-controlled variable-size payload. The bookkeeping all comes down to two derived addresses: | ||
| + | |||
| + | * IP + 3 * sel: the table slot containing the jump target. Read with read_24bit. | ||
| + | * IP + 3 * lim + 3: the first byte after the table. Used as the return point (and as the IP destination on OOB). | ||
| + | |||
| + | Both are masked to 24 bits because IP arithmetic in a 24-bit address space wraps. | ||
| + | |||
| + | OOB sets two flags and falls through (doesn' | ||
| + | |||
| + | Flags otherwise untouched. CASE only writes V and ER. Z, N, C, etc. survive across the instruction, | ||
| + | |||
| + | Note: A single entry CASE can be used as a CALLZ. CALL if register is zero, otherwise not. | ||
| <wrap #case3 /> | <wrap #case3 /> | ||
sd/isa.1778683687.txt.gz · Last modified: by appledog
