Z80 and R800 Assembly/Machine Language Op-code Tables
Written by "Cyberknight" Masao Kawata.
E-Mail: cyberknight@catsrule.garfield.com
Home Page : http://welcome.to/unicorndreams
Revised: 1998-May-12 Tuesday.
Notes:
Z80/R800 Instruction Table:
Fast Reference (sorted op-codes) | ||
Op-codes (Hexadecimal) | Z80 Assembly Mnemonics | R800 Assembly Mnemonics |
00 | nop | nop |
01 nnl nnh | ld bc,nn | ld .bc,nn |
02 | ld (bc),a | ld [.bc],.a |
03 | inc bc | inc .bc |
04 | inc b | inc .b |
05 | dec b | dec .b |
06 n | ld b,n | ld .b,n |
07 | rlca | rola |
08 | ex af,af' | xch .af,.af' |
09 | add hl,bc | add .hl,.bc |
0A | ld a,(bc) | ld .a,[.bc] |
0B | dec bc | dec .bc |
0C | inc c | inc .c |
0D | dec c | dec .c |
0E n | ld c,n | ld .c,n |
0F | rrca | rora |
10 d | djnz d | dbnz d |
11 nnl nnh | ld de,nn | ld .de,nn |
12 | ld (de),a | ld [.de],.a |
13 | inc de | inc .de |
14 | inc d | inc .d |
15 | dec d | dec .d |
16 n | ld d,n | ld .d,n |
17 | rla | rolca |
18 d | jr d | short br d |
19 | add hl,de | add .hl,.de |
1A | ld a,(de) | ld .a,[.de] |
1B | dec de | dec .de |
1C | inc e | inc .e |
1D | dec e | dec .e |
1E n | ld e,n | ld .e,n |
1F | rra | rorca |
20 d | jr nz,d | short bnz d |
21 nnl nnh | ld hl,nn | ld .hl,nn |
22 nnl nnh | ld (nn),hl | ld [nn],.hl |
23 | inc hl | inc .hl |
24 | inc h | inc .h |
25 | dec h | dec .h |
26 n | ld h,n | ld .h,n |
27 | daa | adj .a |
28 d | jr z,d | short bz d |
29 | add hl,hl | add .hl,.hl |
2A nnl nnh | ld hl,(nn) | ld .hl,[nn] |
2B | dec hl | dec .hl |
2C | inc l | inc .l |
2D | dec l | dec .l |
2E n | ld l,n | ld .l,n |
2F | cpl | not .a |
30 d | jr nc,d | short bnc d |
31 nnl nnh | ld sp,nn | ld .sp,nn |
32 nnl nnh | ld (nn),a | ld [nn],.a |
33 | inc sp | inc .sp |
34 | inc (hl) | inc [.hl] |
35 | dec (hl) | dec [.hl] |
36 n | ld (hl),n | ld [.hl],n |
37 | scf | setc |
38 d | jr c,d | short bc d |
39 | add hl,sp | add .hl,.sp |
3A nnl nnh | ld a,(nn) | ld .a,[nn] |
3B | dec sp | dec .sp |
3C | inc a | inc .a |
3D | dec a | dec .a |
3E n | ld a,n | ld .a,n |
3F | ccf | notc |
40 | ld b,b | ld .b,.b |
41 | ld b,c | ld .b,.c |
42 | ld b,d | ld .b,.d |
43 | ld b,e | ld .b,.e |
44 | ld b,h | ld .b,.h |
45 | ld b,l | ld .b,.l |
46 | ld b,(hl) | ld .b,[.hl] |
47 | ld b,a | ld .b,.a |
48 | ld c,b | ld .c,.b |
49 | ld c,c | ld .c,.c |
4A | ld c,d | ld .c,.d |
4B | ld c,e | ld .c,.e |
4C | ld c,h | ld .c,.h |
4D | ld c,l | ld .c,.l |
4E | ld c,(hl) | ld .c,[.hl] |
4F | ld c,a | ld .c,.a |
50 | ld d,b | ld .d,.b |
51 | ld d,c | ld .d,.c |
52 | ld d,d | ld .d,.d |
53 | ld d,e | ld .d,.e |
54 | ld d,h | ld .d,.h |
55 | ld d,l | ld .d,.l |
56 | ld d,(hl) | ld .d,[.hl] |
57 | ld d,a | ld .d,.a |
58 | ld e,b | ld .e,.b |
59 | ld e,c | ld .e,.c |
5A | ld e,d | ld .e,.d |
5B | ld e,e | ld .e,.e |
5C | ld e,h | ld .e,.h |
5D | ld e,l | ld .e,.l |
5E | ld e,(hl) | ld .e,[.hl] |
5F | ld e,a | ld .e,.a |
60 | ld h,b | ld .h,.b |
61 | ld h,c | ld .h,.c |
62 | ld h,d | ld .h,.d |
63 | ld h,e | ld .h,.e |
64 | ld h,h | ld .h,.h |
65 | ld h,l | ld .h,.l |
66 | ld h,(hl) | ld .h,[.hl] |
67 | ld h,a | ld .h,.a |
68 | ld l,b | ld .l,.b |
69 | ld l,c | ld .l,.c |
6A | ld l,d | ld .l,.d |
6B | ld l,e | ld .l,.e |
6C | ld l,h | ld .l,.h |
6D | ld l,l | ld .l,.l |
6E | ld l,(hl) | ld .l,[.hl] |
6F | ld l,a | ld .l,.a |
70 | ld (hl),b | ld [.hl],.b |
71 | ld (hl),c | ld [.hl],.c |
72 | ld (hl),d | ld [.hl],.d |
73 | ld (hl),e | ld [.hl],.e |
74 | ld (hl),h | ld [.hl],.h |
75 | ld (hl),l | ld [.hl],.l |
76 | halt | halt |
77 | ld (hl),a | ld [.hl],.a |
78 | ld a,b | ld .a,.b |
79 | ld a,c | ld .a,.c |
7A | ld a,d | ld .a,.d |
7B | ld a,e | ld .a,.e |
7C | ld a,h | ld .a,.h |
7D | ld a,l | ld .a,.l |
7E | ld a,(hl) | ld .a,[.hl] |
7F | ld a,a | ld .a,.a |
80 | add a,b | add .a,.b |
81 | add a,c | add .a,.c |
82 | add a,d | add .a,.d |
83 | add a,e | add .a,.e |
84 | add a,h | add .a,.h |
85 | add a,l | add .a,.l |
86 | add a,(hl) | add .a,[.hl] |
87 | add a,a | add .a,.a |
88 | adc a,b | addc .a,.b |
89 | adc a,c | addc .a,.c |
8A | adc a,d | addc .a,.d |
8B | adc a,e | addc .a,.e |
8C | adc a,h | addc .a,.h |
8D | adc a,l | addc .a,.l |
8E | adc a,(hl) | addc .a,[.hl] |
8F | adc a,a | addc .a,.a |
90 | sub b | sub .a,.b |
91 | sub c | sub .a,.c |
92 | sub d | sub .a,.d |
93 | sub e | sub .a,.e |
94 | sub h | sub .a,.h |
95 | sub l | sub .a,.l |
96 | sub (hl) | sub .a,[.hl] |
97 | sub a | sub .a,.a |
98 | sbc a,b | subc .a,.b |
99 | sbc a,c | subc .a,.c |
9A | sbc a,d | subc .a,.d |
9B | sbc a,e | subc .a,.e |
9C | sbc a,h | subc .a,.h |
9D | sbc a,l | subc .a,.l |
9E | sbc a,(hl) | subc .a,[.hl] |
9F | sbc a,a | subc .a,.a |
A0 | and b | and .a,.b |
A1 | and c | and .a,.c |
A2 | and d | and .a,.d |
A3 | and e | and .a,.e |
A4 | and h | and .a,.h |
A5 | and l | and .a,.l |
A6 | and (hl) | and .a,[.hl] |
A7 | and a | and .a,.a |
A8 | xor b | xor .a,.b |
A9 | xor c | xor .a,.c |
AA | xor d | xor .a,.d |
AB | xor e | xor .a,.e |
AC | xor h | xor .a,.h |
AD | xor l | xor .a,.l |
AE | xor (hl) | xor .a,[.hl] |
AF | xor a | xor .a,.a |
B0 | or b | or .a,.b |
B1 | or c | or .a,.c |
B2 | or d | or .a,.d |
B3 | or e | or .a,.e |
B4 | or h | or .a,.h |
B5 | or l | or .a,.l |
B6 | or (hl) | or .a,[.hl] |
B7 | or a | or .a,.a |
B8 | cp b | cmp .a,.b |
B9 | cp c | cmp .a,.c |
BA | cp d | cmp .a,.d |
BB | cp e | cmp .a,.e |
BC | cp h | cmp .a,.h |
BD | cp l | cmp .a,.l |
BE | cp (hl) | cmp .a,[.hl] |
BF | cp a | cmp .a,.a |
C0 | ret nz | ret nz |
C1 | pop bc | pop .bc |
C2 nnl nnh | jp nz,nn | bnz nn |
C3 nnl nnh | jp nn | br nn |
C4 nnl nnh | call nz,nn | call nz,nn |
C5 | push bc | push .bc |
C6 n | add a,n | add .a,n |
C7 | rst 00H | brk 00H |
C8 | ret z | ret z |
C9 | ret | ret |
CA nnl nnh | jp z,nn | bz nn |
CB 00 | rlc b | rol .b |
CB 01 | rlc c | rol .c |
CB 02 | rlc d | rol .d |
CB 03 | rlc e | rol .e |
CB 04 | rlc h | rol .h |
CB 05 | rlc l | rol .l |
CB 06 | rlc (hl) | rol [.hl] |
CB 07 | rlc a | rol .a |
CB 08 | rrc b | ror .b |
CB 09 | rrc c | ror .c |
CB 0A | rrc d | ror .d |
CB 0B | rrc e | ror .e |
CB 0C | rrc h | ror .h |
CB 0D | rrc l | ror .l |
CB 0E | rrc (hl) | ror [.hl] |
CB 0F | rrc a | ror .a |
CB 10 | rl b | rolc .b |
CB 11 | rl c | rolc .c |
CB 12 | rl d | rolc .d |
CB 13 | rl e | rolc .e |
CB 14 | rl h | rolc .h |
CB 15 | rl l | rolc .l |
CB 16 | rl (hl) | rolc [.hl] |
CB 17 | rl a | rolc .a |
CB 18 | rr b | rorc .b |
CB 19 | rr c | rorc .c |
CB 1A | rr d | rorc .d |
CB 1B | rr e | rorc .e |
CB 1C | rr h | rorc .h |
CB 1D | rr l | rorc .l |
CB 1E | rr (hl) | rorc [.hl] |
CB 1F | rr a | rorc .a |
CB 20 | sla a | shl .b shla .b |
CB 21 | sla a | shl .c shla .c |
CB 22 | sla a | shl .d shla .d |
CB 23 | sla a | shl .e shla .e |
CB 24 | sla a | shl .h shla .h |
CB 25 | sla a | shl .l shla .l |
CB 26 | sla (hl) | shl [.hl] shla [.hl] |
CB 27 | sla a | shl .a shla .a |
CB 28 | sra b | shra .b |
CB 29 | sra c | shra .c |
CB 2A | sra d | shra .d |
CB 2B | sra e | shra .e |
CB 2C | sra h | shra .h |
CB 2D | sra l | shra .l |
CB 2E | sra (hl) | shra [.hl] |
CB 2F | sra a | shra .a |
CB 30 CB 37 | invalid op-codes | |
CB 38 | srl b | shr .b |
CB 39 | srl c | shr .c |
CB 3A | srl d | shr .d |
CB 3B | srl e | shr .e |
CB 3C | srl h | shr .h |
CB 3D | srl l | shr .l |
CB 3E | srl (hl) | shr [.hl] |
CB 3F | srl a | shr .a |
CB 40 | bit 0,b | bit 0,.b |
CB 41 | bit 0,c | bit 0,.c |
CB 42 | bit 0,d | bit 0,.d |
CB 43 | bit 0,e | bit 0,.e |
CB 44 | bit 0,h | bit 0,.h |
CB 45 | bit 0,l | bit 0,.l |
CB 46 | bit 0,(hl) | bit 0,[.hl] |
CB 47 | bit 0,a | bit 0,.a |
CB 48 | bit 1,b | bit 1,.b |
CB 49 | bit 1,c | bit 1,.c |
CB 4A | bit 1,d | bit 1,.d |
CB 4B | bit 1,e | bit 1,.e |
CB 4C | bit 1,h | bit 1,.h |
CB 4D | bit 1,l | bit 1,.l |
CB 4E | bit 1,(hl) | bit 1,[.hl] |
CB 4F | bit 1,a | bit 1,.a |
CB 50 | bit 2,b | bit 2,.b |
CB 51 | bit 2,c | bit 2,.c |
CB 52 | bit 2,d | bit 2,.d |
CB 53 | bit 2,e | bit 2,.e |
CB 54 | bit 2,h | bit 2,.h |
CB 55 | bit 2,l | bit 2,.l |
CB 56 | bit 2,(hl) | bit 2,[.hl] |
CB 57 | bit 2,a | bit 2,.a |
CB 58 | bit 3,b | bit 3,.b |
CB 59 | bit 3,c | bit 3,.c |
CB 5A | bit 3,d | bit 3,.d |
CB 5B | bit 3,e | bit 3,.e |
CB 5C | bit 3,h | bit 3,.h |
CB 5D | bit 3,l | bit 3,.l |
CB 5E | bit 3,(hl) | bit 3,[.hl] |
CB 5F | bit 3,a | bit 3,.a |
CB 60 | bit 4,b | bit 4,.b |
CB 61 | bit 4,c | bit 4,.c |
CB 62 | bit 4,d | bit 4,.d |
CB 63 | bit 4,e | bit 4,.e |
CB 64 | bit 4,h | bit 4,.h |
CB 65 | bit 4,l | bit 4,.l |
CB 66 | bit 4,(hl) | bit 4,[.hl] |
CB 67 | bit 4,a | bit 4,.a |
CB 68 | bit 5,b | bit 5,.b |
CB 69 | bit 5,c | bit 5,.c |
CB 6A | bit 5,d | bit 5,.d |
CB 6B | bit 5,e | bit 5,.e |
CB 6C | bit 5,h | bit 5,.h |
CB 6D | bit 5,l | bit 5,.l |
CB 6E | bit 5,(hl) | bit 5,[.hl] |
CB 6F | bit 5,a | bit 5,.a |
CB 70 | bit 6,b | bit 6,.b |
CB 71 | bit 6,c | bit 6,.c |
CB 72 | bit 6,d | bit 6,.d |
CB 73 | bit 6,e | bit 6,.e |
CB 74 | bit 6,h | bit 6,.h |
CB 75 | bit 6,l | bit 6,.l |
CB 76 | bit 6,(hl) | bit 6,[.hl] |
CB 77 | bit 6,a | bit 6,.a |
CB 78 | bit 7,b | bit 7,.b |
CB 79 | bit 7,c | bit 7,.c |
CB 7A | bit 7,d | bit 7,.d |
CB 7B | bit 7,e | bit 7,.e |
CB 7C | bit 7,h | bit 7,.h |
CB 7D | bit 7,l | bit 7,.l |
CB 7E | bit 7,(hl) | bit 7,[.hl] |
CB 7F | bit 7,a | bit 7,.a |
CB 80 | res 0,b | clr 0,.b |
CB 81 | res 0,c | clr 0,.c |
CB 82 | res 0,d | clr 0,.d |
CB 83 | res 0,e | clr 0,.e |
CB 84 | res 0,h | clr 0,.h |
CB 85 | res 0,l | clr 0,.l |
CB 86 | res 0,(hl) | clr 0,[.hl] |
CB 87 | res 0,a |