microprocessor_kit_z80-book1:11
Приложение А. Кодовые таблицы команд
Основной набор команд
| По горизонтали:
старшая тетрада |
По вертикали:
младшая тетрада | |
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
0 | NOP | DJNZ e | JR NZ,e | JR NC,e | LD B,B | LD D,B | LD H,B | LD (HL),B | ADD A,B | SUB B | AND B | OR B | RET NZ | RET NC | RET PO | RET P |
1 | LD BC,nn | LD DE,nn | LD HL,nn | LD SP,nn | LD B,C | LD D,C | LD H,C | LD (HL),C | ADD A,C | SUB C | AND C | OR C | POP BC | POP DE | POP HL | POP AF |
2 | LD (BC),A | LD (DE),A | LD (nn),HL | LD (nn),A | LD B,D | LD D,D | LD H,D | LD (HL),D | ADD A,D | SUB D | AND D | OR D | JP NZ,nn | JP NC,nn | JP PO,nn | JP P,nn |
3 | INC BC | INC DE | INC HL | INC SP | LD B,E | LD D,E | LD H,E | LD (HL),E | ADD A,E | SUB E | AND E | OR E | JP nn | OUT (n),A | EX (SP),HL | DI |
4 | INC B | INC D | INC H | INC (HL) | LD B,H | LD D,H | LD H,H | LD (HL),H | ADD A,H | SUB H | AND H | OR H | CALL NZ,nn | CALL NC,nn | CALL PO,nn | CALL P,nn |
5 | DEC B | DEC D | DEC H | DEC (HL) | LD B,L | LD D,L | LD H,L | LD (HL),L | ADD A,L | SUB L | AND L | OR L | PUSH BC | PUSH DE | PUSH HL | PUSH AF |
6 | LD B,n | LD D,n | LD H,n | LD (HL),n | LD B,(HL) | LD D,(HL) | LD H,(HL) | HALT | ADD A,(HL) | SUB (HL) | AND (HL) | OR (HL) | ADD A,n | SUB n | AND n | OR n |
7 | RLCA | RLA | DAA | SCF | LD B,A | LD D,A | LD H,A | LD (HL),A | ADD A,A | SUB A | AND A | OR A | RST 00H | RST 10H | RST 20H | RST 30H |
8 | EX AF,AF' | JR e | JR Z,e | JR C,e | LD C,B | LD E,B | LD L,B | LD A,B | ADC A,B | SBC A,B | XOR B | CP B | RET Z | RET C | RET PE | RET M |
9 | ADD HL,BC | ADD HL,DE | ADD HL,HL | ADD HL,SP | LD C,C | LD E,C | LD L,C | LD A,C | ADC A,C | SBC A,C | XOR C | CP C | RET | EXX | JP (HL) | LD SP,HL |
A | LD A,(BC) | LD A,(DE) | LD HL,(nn) | LD A,(nn) | LD C,D | LD E,D | LD L,D | LD A,D | ADC A,D | SBC A,D | XOR D | CP D | JP Z,nn | JP C,nn | JP PE,nn | JP M,nn |
B | DEC BC | DEC DE | DEC HL | DEC SP | LD C,E | LD E,E | LD L,E | LD A,E | ADC A,E | SBC A,E | XOR E | CP E | CB | IN A,(n) | EX DE,HL | EI |
C | INC C | INC E | INC L | INC A | LD C,H | LD E,H | LD L,H | LD A,H | ADC A,H | SBC A,H | XOR H | CP H | CALL Z,nn | CALL C,nn | CALL PE,nn | CALL M,nn |
D | DEC C | DEC E | DEC L | DEC A | LD C,L | LD E,L | LD L,L | LD A,L | ADC A,L | SBC A,L | XOR L | CP L | CALL nn | DD | ED | FD |
E | LD C,n | LD E,n | LD L,n | LD A,n | LD C,(HL) | LD E,(HL) | LD L,(HL) | LD A,(HL) | ADC A,(HL) | SBC A,(HL) | XOR (HL) | CP (HL) | ADC A,n | SBC A,n | XOR n | CP n |
F | RRCA | RRA | CPL | CCF | LD C,A | LD E,A | LD L,A | LD A,A | ADC A,A | SBC A,A | XOR A | CP A | RST 08H | RST 18H | RST 28H | RST 38H |
Команда CB
| По горизонтали:
старшая тетрада |
По вертикали:
младшая тетрада | |
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
0 | RLC B | RL B | SLA B | - | BIT 0,B | BIT 2,B | BIT 4,B | BIT 6,B | RES 0,B | RES 2,B | RES 4,B | RES 6,B | SET 0,B | SET 2,B | SET 4,B | SET 6,B |
1 | RLC C | RL C | SLA C | - | BIT 0,C | BIT 2,C | BIT 4,C | BIT 6,C | RES 0,C | RES 2,C | RES 4,C | RES 6,C | SET 0,C | SET 2,C | SET 4,C | SET 6,C |
2 | RLC D | RL D | SLA D | - | BIT 0,D | BIT 2,D | BIT 4,D | BIT 6,D | RES 0,D | RES 2,D | RES 4,D | RES 6,D | SET 0,D | SET 2,D | SET 4,D | SET 6,D |
3 | RLC E | RL E | SLA E | - | BIT 0,E | BIT 2,E | BIT 4,E | BIT 6,E | RES 0,E | RES 2,E | RES 4,E | RES 6,E | SET 0,E | SET 2,E | SET 4,E | SET 6,E |
4 | RLC H | RL H | SLA H | - | BIT 0,H | BIT 2,H | BIT 4,H | BIT 6,H | RES 0,H | RES 2,H | RES 4,H | RES 6,H | SET 0,H | SET 2,H | SET 4,H | SET 6,H |
5 | RLC L | RL L | SLA L | - | BIT 0,L | BIT 2,L | BIT 4,L | BIT 6,L | RES 0,L | RES 2,L | RES 4,L | RES 6,L | SET 0,L | SET 2,L | SET 4,L | SET 6,L |
6 | RLC (HL) | RL (HL) | SLA (HL) | - | BIT 0,(HL) | BIT 2,(HL) | BIT 4,(HL) | BIT 6,(HL) | RES 0,(HL) | RES 2,(HL) | RES 4,(HL) | RES 6,(HL) | SET 0,(HL) | SET 2,(HL) | SET 4,(HL) | SET 6,(HL) |
7 | RLC A | RL A | SLA A | - | BIT 0,A | BIT 2,A | BIT 4,A | BIT 6,A | RES 0,A | RES 2,A | RES 4,A | RES 6,A | SET 0,A | SET 2,A | SET 4,A | SET 6,A |
8 | RRC B | RR B | SRA B | SRL B | BIT 1,B | BIT 3,B | BIT 5,B | BIT 7,B | RES 1,B | RES 3,B | RES 5,B | RES 7,B | SET 1,B | SET 3,B | SET 5,B | SET 7,B |
9 | RRC C | RR C | SRA C | SRL C | BIT l,C | BIT 3,C | BIT 5,C | BIT 7,C | RES l,C | RES 3,C | RES 5,C | RES 7,C | SET l,C | SET 3,C | SET 5,C | SET 7,C |
A | RRC D | RR D | SRA D | SRL D | BIT 1,0 | BIT 3,D | BIT 5,D | BIT 7,D | RES 1,D | RES 3,D | RES 5,D | RES 7,D | SET 1,D | SET 3,D | SET 5,D | SET 7,D |
B | RRC E | RR E | SRA E | SRL E | BIT 1,E | BIT 3,E | BIT 5,E | BIT 7,E | RES 1,E | RES 3,E | RES 5,E | RES 7,E | SET 1,E | SET 3,E | SET 5,E | SET 7,E |
C | RRC H | RR H | SRA H | SRL H | BIT l,H | BIT 3,H | BIT 5,H | BIT 7,H | RES l,H | RES 3,H | RES 5,H | RES 7,H | SET l,H | SET 3,H | SET 5,H | SET 7,H |
D | RRC L | RR L | SRA L | SRL L | BIT l,L | BIT 3,L | BIT 3,L | BIT 7,L | RES l,L | RES 3,L | RES 5,L | RES 7,L | SET l,L | SET 3,L | SET 5,L | SET 7,L |
E | RRC (HL) | RR (HL) | SRA (HL) | SRL (HL) | BIT 1,(HL) | BIT 3,(HL) | BIT 5,(HL) | BIT 7,(HL) | RES l,(HL) | RES 3,(HL) | RES 5,(HL) | RES 7,(HL) | SET 1,(HL) | SET 3,(HL) | SET 5,(HL) | SET 7,(HL) |
F | RRC A | RR A | SRA A | SRL A | BIT l,A | BIT 3,A | BIT 5,A | BIT 7,A | RES l,A | RES 3,A | RES 5,A | RES 7,A | SET l,A | SET 3,A | SET 5,A | SET 7,A |
Команды DD/FD
Первый байт:
Второй байт | Команда |
09 | ADD ii,BC |
19 | ADD ii,DE |
|
21 | LD ii,nn |
22 | LD (nn),ii |
|
23 | INC ii |
|
29 | ADD ii,ii |
|
2A | LD ii,(nn) |
|
2B | DEC ii |
34 | INC (ii+d) |
35 | DEC (ii+d) |
|
36 | LD (ii+d),n |
|
39 | ADD ii,SP |
|
46 | LD B,(ii+d) |
4E | LD C,(ii+d) |
56 | LD D,(ii+d) |
5E | LD E,(ii+d) |
66 | LD H,(ii+d) |
6E | LD L,(ii+d) |
|
70 | LD (ii+d),B |
71 | LD (ii+d),C |
72 | LD (ii+d),D |
73 | LD (ii+d),E |
74 | LD (ii+d),H |
75 | LD (ii+d),L |
77 | LD (ii+d),A |
|
7E | LD A,(ii+d) |
|
B6 | ADD A,(ii+d) |
BE | ADC A,(ii+d) |
96 | SUB (ii+d) |
9E | SBC A,(ii+d) |
A6 | AND (ii+d) |
AE | XOR (ii+d) |
B6 | OR (ii+d) |
BE | CP (ii+d) |
|
CB | DD CB / FD CB |
|
E1 | POP ii |
E3 | EX (SP),ii |
E5 | PUSH ii |
E9 | JP (ii) |
F9 | LD SP,ii |
Команда ED
| По горизонтали:
старшая тетрада |
По вертикали:
младшая тетрада | |
| 4 | 5 | 6 | 7 | A | B |
0 | IN B,(C) | IN D,(C) | IN H,(C) | INF | LDI | LDIR |
1 | OUT (C),B | OUT (C),D | OUT (C),H | - | CPI | CPIR |
2 | SBC HL,BC | SBC HL,DE | SBC HL,HL | SBC HL,SP | INI | INIR |
3 | LD (nn),BC | LD (nn),DE | - | LD (nn),SP | OUTI | OTIR |
4 | NEG | - | - | - | - | - |
5 | RETN | - | - | - | - | - |
6 | IM 0 | IM 1 | - | - | - | |
7 | LD I,A | LD A,I | RRD | - | - | - |
8 | IN C,(C) | IN E,(C) | IN | IN A,(C) | LDD | LDDR |
9 | OUT (C),C | OUT (C),E | L,(C) | OUT (C),A | CPD | CPDR |
A | ADC HL,BC | ADC HL,DE | OUT | ADC HL,SP | IND | INDR |
B | LD BC,(nn) | LD DE,(nn) | (C),L | LD SP,(nn) | OUTD | OTDR |
C | - | - | ADC | - | - | - |
D | REТI | - | HL,HL | - | - | - |
E | - | IM 2 | - | - | - | - |
F | LD R,A | LD A,R | RLD | - | - | - |
Команды DD CB / FD CB
Первый байт | DD: ii=IX
FD: ii=IY |
Второй байт | CB |
Третий байт | Смещение d |
Четвёртый байт | Команда |
06 | RLC (ii+d) |
0Е | RRC (ii+d) |
16 | RL (ii+d) |
1E | RR (ii+d) |
26 | SLA (ii+d) |
2E | SRA (ii+d) |
3E | SRL (ii+d) |
46 | BIT 0,(ii+d) |
4E | BIT 1,(ii+d) |
56 | BIT 2,(ii+d) |
5E | BIT 3,(ii+d) |
66 | BIT 4,(ii+d) |
6E | BIT 5,(ii+d) |
76 | BIT 6,(ii+d) |
7E | BIT 7,(ii+d) |
86 | RES 0,(ii+d) |
8E | RES 1,(ii+d) |
96 | RES 2,(ii+d) |
9E | RES 3,(ii+d) |
A6 | RES 4,(ii+d) |
AE | RES 5,(ii+d) |
B6 | RES 6,(ii+d) |
BE | RES 7,(ii+d) |
C6 | SET 0,(ii+d) |
CE | SET 1,(ii+d) |
D6 | SET 2,(ii+d) |
DE | SET 3,(ii+d) |
E6 | SET 4,(ii+d) |
EE | SET 5,(ii+d) |
F6 | SET 6,(ii+d) |
FE | SET 7,(ii+d) |
microprocessor_kit_z80-book1/11.txt · Последние изменения: 2020-07-12 14:58 — GreyWolf