The first byte of an instruction is looked up in the first-byte map when it is $00–$7F; from $80 it is a prefix
and the byte after the operand is looked up in one of the three second-byte maps (memory source, register, destination). A · is an undefined encoding.
In the second-byte maps the letters B, W and L show for which operand sizes the second byte is defined; the byte table covers the prefixes $80/$C0 (B), the word table $90/$D0 (W)
and the long table $A0/$E0 (L), and likewise for the register prefixes $C7/$C8, $D7/$D8, $E7/$E8.
First byte
| x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x | NOP | NORMAL | PUSH | POP | MAX | HALT | EI | RETI | LD | PUSH | LDW | PUSHW | INCF | DECF | RET | RETD |
| 1x | RCF | SCF | CCF | ZCF | PUSH | POP | EX | LDF | PUSH | POP | JP | JP | CALL | CALL | CALR | · |
| 2x | LD | LD | LD | LD | LD | LD | LD | LD | PUSH | PUSH | PUSH | PUSH | PUSH | PUSH | PUSH | PUSH |
| 3x | LD | LD | LD | LD | LD | LD | LD | LD | PUSH | PUSH | PUSH | PUSH | PUSH | PUSH | PUSH | PUSH |
| 4x | LD | LD | LD | LD | LD | LD | LD | LD | POP | POP | POP | POP | POP | POP | POP | POP |
| 5x | · | · | · | · | · | · | · | · | POP | POP | POP | POP | POP | POP | POP | POP |
| 6x | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR | JR |
| 7x | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL | JRL |
Rows 2x to 5x: columns 0–7 load or push or pop the 8 registers of the size of the row ($2x bytes W A B C D E H L; $28+R push a word register; $3x load a word register / $38+R push a long register;
$4x load a long register / $48+R pop a word register; $58+R pop a long register). The condition code of rows 6x and 7x is the low nibble.
$80–$F5 are the prefixes, $F7 is LDX and $F8–$FF are SWI 0–7.
Second byte after a memory source operand
Prefixes $80–$BF (B $80, W $90, L $A0) and $C0–$C5, $D0–$D5, $E0–$E5. “R” is the 3-bit number in the low bits of the second byte; “m” the memory operand; “#” an immediate after the second byte.
| Second byte | Instruction | Sizes |
|---|---|---|
04 | PUSH m | B W |
06 | RLD A,m | B |
07 | RRD A,m | B |
10 | LDI (XDE+),(XHL+) | B W |
11 | LDIR | B W |
12 | LDD | B W |
13 | LDDR | B W |
14 | CPI A,(R+) | B W |
15 | CPIR | B W |
16 | CPD | B W |
17 | CPDR | B W |
19 + 16-bit address | LD (n16),m | B W |
20–27 | LD R,m | B W L |
30–37 | EX m,R | B W |
38 + # | ADD m,# | B W |
39 + # | ADC m,# | B W |
3A + # | SUB m,# | B W |
3B + # | SBC m,# | B W |
3C + # | AND m,# | B W |
3D + # | XOR m,# | B W |
3E + # | OR m,# | B W |
3F + # | CP m,# | B W |
40–47 | MUL RR,m | B W |
48–4F | MULS RR,m | B W |
50–57 | DIV RR,m | B W |
58–5F | DIVS RR,m | B W |
60–67 | INC #3,m | B W |
68–6F | DEC #3,m | B W |
78 | RLC m | B W |
79 | RRC m | B W |
7A | RL m | B W |
7B | RR m | B W |
7C | SLA m | B W |
7D | SRA m | B W |
7E | SLL m | B W |
7F | SRL m | B W |
80–87 | ADD R,m | B W L |
88–8F | ADD m,R | B W L |
90–97 | ADC R,m | B W L |
98–9F | ADC m,R | B W L |
A0–A7 | SUB R,m | B W L |
A8–AF | SUB m,R | B W L |
B0–B7 | SBC R,m | B W L |
B8–BF | SBC m,R | B W L |
C0–C7 | AND R,m | B W L |
C8–CF | AND m,R | B W L |
D0–D7 | XOR R,m | B W L |
D8–DF | XOR m,R | B W L |
E0–E7 | OR R,m | B W L |
E8–EF | OR m,R | B W L |
F0–F7 | CP R,m | B W L |
F8–FF | CP m,R | B W L |
Every second byte not listed is undefined for that size.
Second byte after a register operand
Prefixes $C7/$C8–$CF (B), $D7/$D8–$DF (W), $E7/$E8–$EF (L). “r” is the register of the prefix.
| Second byte | Instruction | Sizes |
|---|---|---|
03 + # | LD r,# | B W L |
04 | PUSH r | B W L |
05 | POP r | B W L |
06 | CPL r | B W |
07 | NEG r | B W |
08 + # | MUL rr,# | B W |
09 + # | MULS rr,# | B W |
0A + # | DIV rr,# | B W |
0B + # | DIVS rr,# | B W |
0C + d16 | LINK r,d16 | L |
0D | UNLK r | L |
0E | BS1F A,r | W |
0F | BS1B A,r | W |
10 | DAA r | B |
12 | EXTZ r | W L |
13 | EXTS r | W L |
14 | PAA r | W L |
16 | MIRR r | W |
19 | MULA rr | W |
1C + d8 | DJNZ r,addr | B W |
20 + #4 | ANDCF #4,r | B W |
21 + #4 | ORCF #4,r | B W |
22 + #4 | XORCF #4,r | B W |
23 + #4 | LDCF #4,r | B W |
24 + #4 | STCF #4,r | B W |
28 | ANDCF A,r | B W |
29 | ORCF A,r | B W |
2A | XORCF A,r | B W |
2B | LDCF A,r | B W |
2C | STCF A,r | B W |
2E + cr | LDC cr,r | B W L |
2F + cr | LDC r,cr | B W L |
30 + #4 | RES #4,r | B W |
31 + #4 | SET #4,r | B W |
32 + #4 | CHG #4,r | B W |
33 + #4 | BIT #4,r | B W |
34 + #4 | TSET #4,r | B W |
38 + #16 | MINC1 #,r | W |
39 + #16 | MINC2 #,r | W |
3A + #16 | MINC4 #,r | W |
3C + #16 | MDEC1 #,r | W |
3D + #16 | MDEC2 #,r | W |
3E + #16 | MDEC4 #,r | W |
40–47 | MUL RR,r | B W |
48–4F | MULS RR,r | B W |
50–57 | DIV RR,r | B W |
58–5F | DIVS RR,r | B W |
60–67 | INC #3,r | B W L |
68–6F | DEC #3,r | B W L |
70–7F | SCC cc,r | B W |
80–87 | ADD R,r | B W L |
88–8F | LD R,r | B W L |
90–97 | ADC R,r | B W L |
98–9F | LD r,R | B W L |
A0–A7 | SUB R,r | B W L |
A8–AF | LD r,#3 | B W L |
B0–B7 | SBC R,r | B W L |
B8–BF | EX R,r | B W |
C0–C7 | AND R,r | B W L |
C8 + # | ADD r,# | B W L |
C9 + # | ADC r,# | B W L |
CA + # | SUB r,# | B W L |
CB + # | SBC r,# | B W L |
CC + # | AND r,# | B W L |
CD + # | XOR r,# | B W L |
CE + # | OR r,# | B W L |
CF + # | CP r,# | B W L |
D0–D7 | XOR R,r | B W L |
D8–DF | CP r,#3 | B W |
E0–E7 | OR R,r | B W L |
E8 + #4 | RLC #4,r | B W L |
E9 + #4 | RRC #4,r | B W L |
EA + #4 | RL #4,r | B W L |
EB + #4 | RR #4,r | B W L |
EC + #4 | SLA #4,r | B W L |
ED + #4 | SRA #4,r | B W L |
EE + #4 | SLL #4,r | B W L |
EF + #4 | SRL #4,r | B W L |
F0–F7 | CP R,r | B W L |
F8 | RLC A,r | B W L |
F9 | RRC A,r | B W L |
FA | RL A,r | B W L |
FB | RR A,r | B W L |
FC | SLA A,r | B W L |
FD | SRA A,r | B W L |
FE | SLL A,r | B W L |
FF | SRL A,r | B W L |
Every second byte not listed is undefined for that size.
Second byte after a destination operand
Prefixes $B0–$BF and $F0–$F5; the operand has no size of its own.
| Second byte | Instruction |
|---|---|
00 + #8 | LD m,#8 |
02 + #16 | LDW m,#16 |
04 | POP m (byte) |
06 | POPW m |
14 + address16 | LD m,(n16) (byte) |
16 + address16 | LDW m,(n16) |
20–27 | LDA RR,m (word register) |
28 | ANDCF A,m |
29 | ORCF A,m |
2A | XORCF A,m |
2B | LDCF A,m |
2C | STCF A,m |
30–37 | LDA XRR,m (long register) |
40–47 | LD m,R (byte) |
50–57 | LD m,R (word) |
60–67 | LD m,R (long) |
80–87 | ANDCF #3,m |
88–8F | ORCF #3,m |
90–97 | XORCF #3,m |
98–9F | LDCF #3,m |
A0–A7 | STCF #3,m |
A8–AF | TSET #3,m |
B0–B7 | RES #3,m |
B8–BF | SET #3,m |
C0–C7 | CHG #3,m |
C8–CF | BIT #3,m |
D0–DF | JP cc,m |
E0–EF | CALL cc,m |
F0–FF | RET cc (only with the prefix B0; the operand is not used) |
Every second byte not listed is undefined.
Not described
- The maps are the encodings the decoder and the RACE core agree on (status page); no printed code map of the manual was read to compare them.
- RACE also defines the register-table slot
1A(second byte after$C7,$C8–$CF) as a hook for its own BIOS emulation; it is not part of the instruction set and is shown as undefined.