z80 Assembly Language
z80 Assembly Language
TABLE OF CONTENTS
I. INTRODUCTION 1
II. SPECIFICATION OF Z80 ASSEMBLY LANGUAGE
A. THE ASSEMBLY LANGUAGE 2
B. OPERANDS , 4
C. RULES FOR WRITING ASSEMBLY STATEMENTS (SYNTAX).. 6
D. ASSEMBLY LANGUAGE CONVENTIONS , 7
E. ASSEMBLER COMMANDS 13
III. MACROS 15
IV. SUBROUTINES ig
V. Z80 CPU FLAGS 20
VI. Z80 INSTRUCTION SET 24
INSTRUCTION INDEX 275
APPENDIX:
A. ERROR MESSAGES 280
C. INSTRUCTION SORT LISTING (ALPHABETICAL) 284
C. INSTRUCTION SORT LISTING (NUMERICAL) 290
INTRODUCTION :
The assembly language provides a means for writing a program
without having to be concerned with actualmemory addresses
or machine Instruction formats. It allows the use of
symbolic addresses to Identify memory locations and mnemonic
codes (opcodes and operands) to represent the
Instructionsthemselves.
Labels (symbols)can be assigned to a particular instruction
step in a source program to identify that step as an entry
point for use in subsequent instructions. Operands following
each instruction represent storage locations, registers, or
constant values. The assembly language also includes
assembler directives that supplement the machine
instruction. A pseudo-op, for example, is a statement which
is not translated into a machine instruction, but rather is
Interpreted as a directive that controls the assembly
process.
A program written in assembly language is called a source
program. It consists of symbolic commaiids called
statements. Each statement is written on a single line and
may consist of from one to four entries: A label field, an
operation field, an operand field and a comment field. The
source program is processed by the assembler to obtain a
machine language program (object program) that can be
executed directly by the Z80-CPU.
Zilog provides several different assemblers which differ in
the features offered. Both absolute and relocatable
assemblers are available with the Development and
Microcomputer Systems. The absolute assembler Is contained
in base level software operating in a 16K memory space while
the relocating assembler is part of the RIO environment
operating in a 32K memory space.
B. OPERANDS
Operands modify the opcodes and provide the information needed by the
assembler to perform the designated operation.
Certain symbolic names are reserved as key words in the assembly language
operand fields.
They are:
A , B , C . D , E , H , L , I , R .
OPERAND NOTATIOM
A , B , C , D , E , H ,L .
EXPRESSIOHS
OPERATOR
FUNCTION
PRI ORITY
+ UNARY PLUS 1
UUARY IIIDUS 1
.RES. RESULT 1
** EXPONENTIATION 2
* MULTIPLICATIOU 3
/ DIVISION 3
.UOD. UODULO 3
.3HR. LOGICAL SHIFT RIGHT 3
.SHL. LOGICAL SHIFT LEFT 3
+ ADDITION 4
SUBTRACTION 4
LD HL,-0EA9H,
JR C,LOOP
JR C,$+5
10
CONDITIONAL PSEUDO-OPS
s tatements ,
DELIMITERS
11
COtlMENTS
I/O BUFFERS
UPPER/LOWER CASE
NUMBER BASES
* Heading s
*List OFF
*llaclist OFF
*Maclist ON
13
COND exp
*Include FILEl
ENDC
14
III. MACROS
MACRO DEFINITION
[<label>] ENDM
15
16
SYUBOL GENERATOR
LISTING FORUAT
17
IV. SUBROUTINES
CALL REWIND
18
19
7 6 5 4 3 2 1
S Z X H X P/V N C
WHERE:
C - CARRY FLAG
N = ADD/SUBTRACT FLAG
H - HALF-CARRY FLAG
Z = ZERO FLAG
S = SIGN FLAG
X = NOT USED
For Instructions RLA, RRA, RLS and RRS, the carry bit is
used as a link between the LSB and MSB for any register
or memory location. During Instructions RLCA, RLC s and
SLA s, the carry contains the last value shifted out of
bit 7 of any register or memory location. During
20
ADD/SUBTRACT FLAG (N )
PARITY/OVERFLOW FLAG
21
ADD
SUBTRACT
There is
borrow from
bit 4
There is no carry
from Bit 3 to Bit 4
There is no
borrow from
Bit 4
22
THE ZERO FLAG (Z)
23
24
PAGE
25
26
LD n, p'
Operation : r •<- r
Format :
Opcode Operands
LD r,r'
1 1 1 1 1 1 1
__l I I I I I I
Description:
Register r,r'
A - ill
B - 000
C - 001
D - 010
E - Oil
H - 100
L - 101
Example :
LD H, E
27
LD
Operation: r ■•
Format :
Opcode
Operands
0-
►110
— \ — I —
Description:
Register
A
B
C
D
E
H
L
111
000
001
010
Oil
100
101
28
LD p. CHLD
Operation: r-<-(HL)
Foriaat ;
Opcode Operands
LD r, (HL)
1 1 1 1 1 1 1
1^ r «►! 1
I I I I I i_— I I
Description:
Register r
A - 111
B - 000
C - 001
D - 010
E - on
H - 100
L - 101
LD C, (HL)
LD p, ClX + d]
Operation ; r-«-(IX+d)
Format ;
Opcode
LD
Operands
r, (IX+d)
— I —
1 1
1
I
LI
1 1
DD
Description ;
Register £
A = 111
B ■= 000
C - 001
D - 010
E - Oil
H - 100
L - 101
Example ;
30
LD B, (IX+19H)
31
LD p. CIY+d3
Operation ! r-*-(IY+d)
Format !
Opcode
LD
Operands
r, (lY+d)
— I 1 —
1 1
I I
-I — I —
FD
Description ;
Register £
ill
000
001
010
on
100
101
Examp 1 e :
LD B, (IY+I9H)
LD CHU.
Operation: (HL)-<-r
Fornat :
Opcode Operands
LD (HL) , r
I 1 1 1 1 1 1 1 1
111 -« — r—
' I I I I I — I
Description:
Register r
A - 111
B - 000
C - 001
D - 010
E - Oil
H - 100
L - 101
LD (HL) , B
LD CIX + dD, n
Operation: (IX+d)-<-r
Format :
Opcode Operands
LD (IX+d) , r
1 DD
Description;
Register r
A - 111
B - 000
C - 001
D - 010
E - Oil
H - 100
L - 101
35
Example :
LD (IX+6H), C
will perform the sum 3100H + 6H and will load ICH into
memory location 3106H.
36
LD ClY + d], p
Operation ; (IY+d)<*-r
Format ;
Opcode Operands
LD (lY+d) , r
1 1
1 FD
Description:
Register r
A - 111
B - 000
C - 001
D - 010
E - Oil
H - 100
L - 101
37
Example ;
LD (IY+4H), C
will perform the sum 2A11H + 4H, and will load 48H Into
memory location 2A15.
38
LD CHLD, n
Operation! (HL)-^n
Format :
Opcode
Operand
LD
(HL) ,n
110 110
36
Description:
39
LD ClX + d],
Operation: (IX+d)*-n
Opcode
1 1
1
I
Operands
(IX+d) , n
DD
36
Description :
The n operand is loaded into the raemory address
specified by the sum of the contents of the Index
Register IX and the two's complement displacement
operand d .
Example ;
LD (IX+5H), 5AH
40
LD ClY + d], n
Operation : (IY+d)-<-n
Forma t ;
Opcode
LD
Operands
(lY+d) ,n
1111
FD
36
Description :
LD (lY+lOH), 97H
41
LD A. CBC]
Operation; A *- (BC)
Format :
Opcode
Operands
LD
A, (BC)
1 1
OA
Description:
LD A, (BC)
42
LD A, CDED
Operation! A ^ (DE)
Fo rmat :
Opcode
Operands
LD
A, (DE)
1 1 1
lA
Description:
LD A, (DE)
43
LD A, Cnn]
Operation : A (nn)
Fo rma t :
Op code
LD
Ope rands
A, (nn)
1
1 1 '0 1
3A
De script Lon :
LD A, (nn)
44
LD CBC). A
Operation: (BC) *- A
Format :
Opcode
Operands
LD
(BC) ,A
0. 1
02
Description:
Example:
45
LD CDE3
Operation : (DE)*-A
Format ;
Opcode
Ope rands
LD
(DE) .A
1 1
12
Description :
LD (DE),A
will result In AOH being in memory location 1128H.
46
LD Cnn], A
Operation : (nn) ^ A
Fo rma t :
Opcode
LD
Ope rands
(nn) ,A
32
Description ;
Examp 1 e :
LD (3141H),A
47
LD A, I
Operation : A <- I
Format :
Opcode
LD
Operands
A, I
1110 110 1
I I I I I I I
10 10 111
I I I I I I I
ED
57
Description :
reset otherwise
Z: Set if I-Reg. is zero;
reset otherwise
H: Reset
P/V: Contains contents of IFF2
N: Reset
C: Not affected
Note:
48
LD A. R
Operation : A <- R
Opcode
LD
Operands
A.R
10 11111
ED
5F
Description :
reset otherwise
Z: Set If R-Reg. Is zero;
reset otherwise
H: Reset
P/V: Contains contents of IFF2
N : Reset
C: Not affected
49
LD I, A
Operation : I <- A
Format ;
Opcode
Operands
LD
I ,A
1110 110 1
ED
1 1 1 1
47
50
LD R. A
Operation : R A
Fo rmat :
Opcode
LD
Operands
R,A
— I 1 1 1 1 1 1 —
1110 110 1
I I I I I I I
— I — I — I — I — I — I — I —
1 n 1 1 1 1
■ I I I I I I I
ED
4F
Description :
51
52
LD dd, nn
Operation : dd nn
Fo rma t :
Opcode
LD
— I 1 1 1 1 1 1 —
d d 1
__i I I 1 I I J
— I — I — I — I — I — I — I —
• n ^
I I I — I — I — I — I —
-* n
I \ I I I I I I
Description :
BC 00
DE 01
HL 10
SP 11
Operands
dd , nn
53
LD IX. nn
Operation : IX-e-nn
Fo rmat :
Opcode
Operands
IX, nn
DD
21
De script Ion :
Example :
54
LD lY. nn
Operation ; IY<-nn
Format :
p c o d.e
1 1
Operands
lY.nn
FD
21
Description ;
Example :
LD HL, CnnD
Opcode Operands
LD
HL, (nn)
2A
Description ;
56
LD dd, Cnn3
Opcode Operands
LD dd,(nn)
1 1
1 ED
Description !
Pair dd
BC 00
DE 01
HL 10
SP 11
Example :
LD BC, (2130H)
58
LD IX, Cnn]
Opcode Operands
LD
IX, (nn)
1 1
DD
2A
Description ;
The contents of the address (nn) are loaded Into the low
order portion of Index Register IX, and the contents of
the next highest memory address (nn+l) are loaded into
the high order portion of IX. The first n operand after
the op code is the low order byte of nn .
M CYCLES: 6 T STATES: 20(4,4,3,3,3,3) 4 MHZ E.T.: 5.00
Condition Bits Affected ; None
Example ;
LD IX, (6666H)
59
LD lY, Cnn]
Opcode Operands
LD
I Y , ( nn )
110
FD
2A
LD lY, (6666H)
LD Cnn], HL
Opcode Operands
LD
(nn
— I I i| — r— I —
1 .0
I I — I — I, I.
-I — T — f — r
n r..
,HL
22
Description ;
LD Cnn]
Opcode Operands
LD
(nn) ,dd
ED
Description :
Pair dd
BC 00
DE 01
HL 10
SP 11
Example :
LD (1000H),BC
63
LD Cnn],
Format ;
Opcode Operands
LD (nn),IX
1 1
DD
22
Description ;
Example :
LD (4392H),IX
memory location 4392H will contain number 30H and
location 4393H will contain 5AH.
64
LD CnnD. lY
1 1
L.
L.
(nn) ,IY
FD
22
Description ;
Exampl e ;
LP (8838H),IY
LD SP. HL
operation! SP-«-HL
Format :
Opcode
Operands
LD
SP.HL
111110 1
F9
Description:
Example:
LD SP.HL
66
LD SP. IX
Operation: SP<-IX
Format :
Opcode
Operands
SP, IX
— I 1 1 1 — I — I 1 —
110 1110 1
I I t I I L_JI
— I 1 1 1 1 1 1 —
111110 1
I — I — I I — I — I I —
DD
F9
Description:
LD SP.IX
LD SP
Operation: SP<-IY
Format :
Opcode
Operands
SP, lY
— I 1 1 1 1 1 1 —
1111110 1
I I 1 I I 1 I
— I 1 \ 1 1 1 1 —
111110 1
I I I I I l_J
FD
F9
Description:
68
PUSH qq
PUSH qq
Format ;
Opcode Operands
PUSH qq
Description :
Pair qq^
BC 00
DE 01
HL 10
AF 11
PUSH AF
69
PUSH
Format :
Opcode
Operands
PUSH
IX
110 1110 1
DD
1110 10 1
E5
Description:
None
PUSH IX
70
PUSH lY
Operation; (SP-2) ^ I Yl , (SP-1) I Yh
Format :
Opcode
Operands
PUSH
lY
1111110 1
FD
1110 10 1
E5
Description:
Example:
If the Index Register lY contains 2233H and the Stack
Pointer contains 1007H, after the instruction
None
PUSH lY
71
POP qq
qPH^ISP+D, qqL^(SP)
Opcode Operands
POP qq
1 1 q q 1
_J I I I I I 1—
Pair r
BC 00
DE 01
HL 10
AF 11
72
Example ;
POP HL
73
POP
Operation; I Xh (SP+1 ) . IXl^(SP)
Format :
Opcode
Operands
POP
IX
110 1110 1
DD
1 1 1 1
El
Description:
Example:
If the Stack Pointer contains lOOOH, memory location
lOOOH contains 55H, and location lOOlH contains 33H, the
instruction
None
POP IX
74
POP lY
Opcode
Operands
— I 1 1 1 —
11111.,
I I I I I I L
T 1
1 1
— I 1 1 1 1 1 1 —
1 1 1 1
I I I I I I I
FD
El
Description:
POP lY
76
EX DE. HL
Operation: DE HL
Format :
Opcode
Operands
EX
DE.HL
1110 10 11
EB
Description:
77
EX AF, AF'
Operation; AF AF*
Format :
Opcode
Operands
EX
AF.AF'
08
Description:
Example :
M CYCLES: 1 T STATES
EX AF.AF'
78
EXX
Operation; (BO « (BC), (DE) « (DE'I, (HL) ^ (HL')
Format ;
Opcode Operands
EXX
I 1 1 1 1 1 1 1 —
110 110 1
I t I I I I '
Description:
EXX
79
EX CSPD. HL
Format :
Opcode
Operands
EX
(SP) ,HL
1 1 1 Q 1 1
E3
Description;
Example:
EX (SP) ,HL
80
EX CSPD, IX
Opcode
EX
Operands
(SP) ,IX
— I 1 1 1 1 1 1 —
110 1110 1
I I I I ' ■ '
— I — I — I — I — I — I — I —
1 1 1 1 1
I I I I I I l_
DD
E3
Description:
Example:
If the Index Register IX contains 3988H, the SP register
pair contains OlOOU, the memory location OlOOH contains
the byte 90H, and memory location OlOlH contains byte
48H, then the Instruction
EX (SP),IX
81
EX CSP3,
Opcode
EX
Operands
(SP) ,IY
— I — 1 — I — I — I — I — I —
1111110 1
I— —I I I I L—J
— I 1 1 1 1 1 1
1 1 1 1 1
— I — I — I I I — I — I
FD
E3
Description:
Example;
EX (SP) ,IY
82
LDI
Operation: (DE)^(HL), DE ^ DE+1 , HL ^ HL+1 , BC ^ BC-1
Operands
1110 11
1 1
I — I I I I 1 I
ED
AO
Description:
S: Not affected
Z: Not affected
H: Reset
reset otherwise
N: Reset
C: Not affected
83
Example ;
LDI
HL
( 1 1 IIH)
DE
(2222H)
BC
1112H
88H
2223H
8 811
6H
84
LDIR
LDIR
Format ;
Opcode
Operands
LDIR
1110 110 1
ED
1 1 1
BO
Descrlpt Ion ;
For BC-0:
85
S: Not affected
Z: Not affected
H: Reset
P/V: Reset
N: Reset
C: Not affected
Example :
HL : HUH
DE : 2225H
BC : OOOOH
(HUH)
(1112H)
(1113H)
88H
36H
ASH
(2222H)
(2223H)
(2224H)
66H
59H
C5H
88H
36H
ASH
LDD
Operation: (DE)^{HL), DE ^ DE-1 , HL^HL-1, BC<-BC-1
Opcode
Operands
— I 1 1 1 1 1 1 —
1110 110 1
I I ■ I I l—J
— I — I — I — I — I — I — I —
10 10 10
I — I I I I I — I
ED
A8
Descripttion;
S: Not affected
Z: Hot affected
H: Reset
reset otherwise
N: Reset
C: Not affected
87
Example :
LDD
HL
(HUH)
DE
(2222H)
BC
11 lOH
88H
222 1H
8 8H
6H
88
LDDR
Operands
— I 1 1 1 1 1 1 —
1110 110 1
I I ■ I I I 1 —
ED
— I 1 1 1 1 1 1 —
10 1110
I I 1 1 1 1 1 — .
Description ;
For BC-0:
M CYCLES: 5 T STATES: 21(4,4,3,5,5) 4 MHZ E.T.: 5.25
For BC=0:
S: Not affected
Z: Not affected
H: Reset
P/V: Reset
N: Reset
89
Example :
LDDR
HL : llllH
DE : 2222H
BC : OOOOH
90
CPI
Opcode
Operands
— I 1 1 1 1 1 1 —
1110 110 1
1 1 1
I — I — I — I — I — I — I —
ED
Al
Desc r Ip tlon :
T STATES: 16(4,4,3,5)
P/V:
N:
C :
reset otherwise
Set if A=(HL);
reset otherwise
Set if BC-1=0;
reset otherwise
Set
Not affected
Example ;
91
CPI
92
CPIR
Opcode Operands
CPIR
1110 110 1 ED
' I I I I I I-
— I 1 1 1 1 1 1 —
1 1 1 1
I L.J 1 1 1 1
Bl
Description ;
93
Condition Bits Affected;
S:
Z:
Set if A-(HL) ;
reset otherwise
H:
P/V:
Set If BC-1-0;
reset otherwise
N:
Set
C:
Not affected
Example :
(llllH)
(1112H)
(1113H)
52H
OOH
F3H
CPIR
94
CPD
Opcode Operands
CPD
11101101
— I 1 1 I \ 1 I
10 10 10 1
ED
A9
Description ;
The contents of the memory location addressed by the HL
register pair Is compared with the contents of the
Accumulator. In case of a true compare, a condition bit
Is set. The HL and the Byte Counter (register pair BC)
are decremented.
reset otherwise
Z: Set If A=(HL);
reset otherwise
H: Set If borrow from
reset otherwise
N: Set
C: Not Affected
Example :
95
CPD
96
CPDR
Operation ; A - (HL) , HL ^ HL-1 , BC ^ BC-1
Format ;
Opcode
Operands
CPDR
1110 110 1
ED
10 1110 1
B9
Description :
97
Condition Bits Affected ;
S :
reset otherwise
Z :
%et if A=(HL);
reset otherwise
H:
P/V:
Set if BC-1-0;
reset otherwise
N:
Set
C:
Not affected
Example ;
If the HL register pair contains 11 1 8H , the Accumulator
contains F3H, the Byte Counter contains 0007H, and
memory locations have these contents:
(1118H)
(1117H)
(1116H)
52H
OOH
F3H
CPDR
98
99
ADD A, p
Operation: A A + r
Fornat :
Opcode
Operands
ADD
A,r
1 -^ r-*
Description :
S:
Z:
reset otherwise
H:
P/V:
Set if overflow;
reset otherwise
N:
Reset
C:
Register
A
B
C
D
E
H
L
111
000
001
010
oil
100
101
100
Ex am p 1 c :
101
ADD A, n
Format :
Operation: A •<- A + n
Opcode
ADD
Operands
A,n
— I 1 1 1 1 1 1 —
1 1 1 1
— I — I — I — I I I — I —
-1 — I — I — I — r-
C6
Description:
4 MHZ E.T. : 1. 75
P/V:
N:
C:
reset otherwise
reset otherwise
Set if overflow;
reset otherwise
Reset
Example :
ADD A,33H
102
ADD A. CHU
Format :
Opcode
Operands
ADD
A, (HL)
1 1 1
86
Description:
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Set If carry from
reset otherwise
N: Reset
Example :
Bit 7;
reset otherwise
ADD A,(HL)
the Accumulator will contain ASH.
103
ADD A. CIX+dD
Opcode
ADD
Operands
A, (IX+d)
1 1
DD
Description ;
reset otherwise
Z: Set If result is zero;
reset otherwise
H: Set if carry from
Example :
104
ADD A, (IX+5H)
the contents of the Accumulator will be 33H.
105
ADD A, ClY+d]
Operation ; A A+( I Y+d)
Format ;
Opcode
ADD
Operands
A, (lY+d)
— I 1 —
1 1
I I
1 1
FD
Description ;
S:
reset otherwise
Z:
H:
P/V:
Set if overflow;
reset otherwise
N:
Reset
C:
Set if carry from bit 7;
reset otherwise
Example :
106
ADD A, (IY+5H)
the contents of the Accumulator will be 33H.
107
ADC A. s
Operation: A ^ A + s + CY
Format :
Opcode
ADC
Operands
A, s
ADC A,(HL)
ADC A, (IX+d)
ADC A,(IY+d)
1 1
1 1
__l
1 1
I
1 1
1 1
1 1
CE
8E
DD
8E
FD
8E
H,L or A assembled as
108
Register r
B 000
C 001
D 010
E Oil
H 100
L 101
A 111
Description;
reset otherwise
H: Set if carry from
reset otherwise
N; Reset
Example :
ADC A,(HL)
109
SUB s
operation: A A - s
Format ;
Opcode
SUB
Operands
SUB (HL)
SUB (IX+d)
SUB (lY+d)
*r identifies registers B
D6
96
DD
96
FD
96
C,D,E,H,L or A assembled as
110
Register
000
001
010
Oil
H
100
101
111
Description ;
INSTRUCTION
T STATES
4 MHZ E.T.
SUB r
SUB n
SUB (HL)
SUB (IX+d)
SUB (lY+d)
7(4,3)
7(4,3)
19(4, 4,3,5.3)
19(4,4,3,5,3)
1 . 00
1 .75
1 . 75
4. 75
4.75
Condition Bits Affected:
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Set if borrow from
reset otherwise
N : Set
C: Set if borrow;
reset otherwise
Examp 1 e :
SUB D
the Accumulator will contain 18H.
Ill
SBC A, s
Operation: A ^ A - s - CY
Format :
Opcode
Operands
A,s
SBC A,r
SBC A,n
SBC A,(HL)
SBC A, (IX+d)
SBC A,(IY+d)
DE
9E
DD
9E
FD
9E
000
001
010
Oil
100
L
101
111
INSTRUCTION
SBC A,r
SBC A,n
SBC A, (HL)
SBC A, (IX+d)
SBC A, (lY+d)
M CYCLES
2
2
5
5
T STATES
4
7(4,3)
7(4,3)
19(4,4,3,5,3)
19(4,4,3,5,3)
reset otherwise
Z: Set If result is zero;
reset otherwise
H: Set if borrow from
reset otherwise
N: Set
C: Set if borrow;
reset otherwise
4 MHZ E.T.
1.00
1 . 75
1.75
4. 75
4. 75
Examp 1 e :
SBC A, (HL)
AND s
Operation: A A A s
Opcode
AND
Operands
AND n
AND (HL)
AND (IX+d)
AND (lY+d)
E6
A6
DD
A6
FD
A6
114
Register £
000
001
D
010
Oil
100
101
111
Description :
INSTRUCTION M CYCLES
AND r 1 4 1.00
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Set
P/V: Set if parity even;
reset otherwise
N: Reset
C: Reset
Exampl e :
AND B
OR s
Operation ; A^AVs
Format ;
Opcode Operands
OR s
OR n
OR (HL)
OR (IX+d)
OR (lY+d)
F6
DD
B6
FD
B6
116
Register
000
001
010
Oil
100
101
111
Description ;
INSTRUCTION
OR r
OR n
OR (HL)
OR (IX+d)
OR (lY+d)
M CYCLES
1
2
2
5
5
T STATES
4
7(4,3)
7(4,3)
19(4,4,3,5, 3)
19(4,4,3,5,3)
reset otherwise
Z: Set if result Is zero;
reset otherwise
H: Reset
P/V: Set If parity even;
reset otherwise
N: Reset
C: Reset
4 MHZ E.T.
1.00
1 . 75
1.75
4.75
4.75
Example :
117
XOR s
Operation: A*-A®s
Format ;
Opcode
XOR
Operands
XOR (HL)
XOR (IX+d)
XOR (lY+d)
EE
AE
DD
AE
FD
AE
118
Register
000
001
010
Oil
100
101
111
Description :
INSTRUCTION
XOR r
XOR n
XOR (HL)
XOR (IX+d)
XOR (lY+d)
M CYCLES
1
2
2
5
5
T STATES
4
7(4,3)
7(4,3)
19(4,4,3,5,3)
19(4,4,3,5,3)
4 MHZ E.T.
1 . 00
1.75
1. 75
4. 75
4. 75
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Reset
P/V: Set if parity even;
reset otherwise
N: Reset
C: Reset
Example ;
119
CP s
Operation: A-s
Foraat ;
Opcode Operands
CP s
CP n
CP (HL)
CP (IX+d)
CP (lY+d)
FE
BE
1 DD
"ol BE
1 FD
BE
120
Register
B 000
C 001
D 010
E Oil
H 100
L 101
A 111
Description ;
The contents of the s operand are compared with the
contents of the Accumulator. If there is a true
compare, the Z flag is set. The execution of this
Instruction does not affect the contents of the
Accumulator.
CP r 1 4 1.00
CP n 2 7(4,3) 1.75
reset otherwise
Z; Set if result is zero;
reset otherwise
H; Set if borrow from
C; Set if borrow;
reset otherwise
Example ;
CP (HL)
121
INC r
Operation; r r + 1
Format :
Opcode
Operands
INC
— ^1
Description:
S:
reset otherwise
Z:
reset otherwise
H:
P/V:
N:
Reset
C:
Not affected
Register
r
A
B
C
D
E
H
L
111
000
001
010
oil
100
101
122
Ex am p 1 e :
If the contents of register D are 2811, after the
execution of
INC D
123
INC CHU
Format :
Opcode
Operands
INC
(HL)
110 10
34
Description:
reset otherwise
Z:
reset otherwise
H:
P/V:
Reset
C:
Not Affected
Example :
124
INC ClX+d]
Format :
Opcode
INC
Operands
(IX+d)
DD
34
Description :
P/V:
N:
C:
reset otherwise
Set if result Is zero;
reset otherwise
Reset
Not affected
125
Example :
INC (IX+IOH)
Opcode
INC
Operands
(lY+d)
— I 1 1 —
1111
110 1
I I I
FD
34
Description;
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Set if carry from
Example;
INC (lY+lOH)
131
Register r
B
000
001
010
Oil
100
101
A
111
Description :
DEC r 1 4 1.00
S:
Z:
reset otherwise
H:
P/V:
N:
Set
C:
Not affected
Example ;
DEC D
130
Condition Bits Affected;
S:
reset otherwise
Z:
reset otherwise
U:
See Instruction
P/V:
N:
Not affected
C:
See instruction
Ex anple ;
15
+2 7
42
0001 0101
+0010 QUI
0011 1100 3C
0011 1100
+0000 QUO
0100 0010 - 42
133
DAA
Operation ;
Format ;
Opcode
BAA
— I 1 1 1 1 1 1 —
1 1 1 1
I I I I I L— I
27
Description:
HEX
VALUE
VALUE
NUMBER
C
IN
IN
ADDED
BEFORE
UPPER
BEFORE
LOWER
TO
AFTER
OPERATION
DAA
DIGIT
DAA
DIGIT
BYTE
DAA
(bit
(bit
7-4)
3-0)
0-9
0-9
00
0-8
A-F
06
ADD )
0-9
0-3
06
ADC >
A-F
0-9
60
INC )
9-F
A-F
66
1
A-F
0-3
66
0-2
0-9
60
1
0-2
A-F
66
0-3
1
0-3
66
SUB )
0-9
0-9
00
SBC (
0-8
6-F
FA
DEC (
7-F
0-9
AO
NEG ;
6-F
6-F
9A
Operation : A 0-A
Format ;
Opcode
NEG
— I 1 1 1 1 1 1 —
1110 110 1
— I 1 1 1 1 1 1 —
1 1
__l I I I I — I — I —
ED
44
Description ;
S:
reset otherwise
Z:
H;
P/V:
N:
Set
C;
Set If Acc. was not OOH before
135
CPL
Operation ; A A
Format !
Opcode
CPL
— I 1 1 1 1 1 1 —
10 1111
2F
Description ;
S: Not affected
Z: Not affected
H: Set
N; Set
C: Not affected
Example :
CPL
the Accumulator contents will be 0100 1011.
134
operation; CY-«-CY
Opcode
CCF
— I 1 1 1 1 1 1 —
00111111
I I I I I I — I —
3F
Description !
S: Not affected
Z: Not affected
N: Reset
137
Example :
1
after the execution of
NEG
1
136
NOP
Operation: —
Opcode
NOP
— 1 1 1 1 1 1 1 —
00000000
I I I I I I I
00
Description:
139
SCF
Operation ; CY 1
Format ;
Opcode
SCF
1 T 1 1 1 1 1
110 111
-t-
37
Desc rlpt Ion ;
S :
Z :
H:
P/V:
N:
C :
Not affected
Not affected
Reset
Not affected
Reset
Set
138
Operation: IFF-*-0
Format :
Opcode
DI
— I 1 1 1 1 1 1 —
11110 11
— I — I — I — I — I — |_l —
F3
Description:
Example:
141
HALT
operation;
format ;
Opcode
HALT
— I 1 1 1 1 1 1 —
1110 110
I I 1 1 1 1 1 —
76
Description:
IM
Operation :
Format :
Opcode
Operands
IM
1110 110 1
ED
1 1 1
46
Description :
None
143
Operation; IFF 1
Format ;
Opcode
EI
— I 1 1 1 1 1 1 —
1 1 1 1 1 Q 1 1
— I 1 1 1 1 1— I
FB
Description;
The enable interrupt Instruction will set both Interrupt
enable flip flops (IFFl and XFF2) to a logic '1'
allowing recognition of any maskable Interrupt. Note
that during the execution of this instruction and the
following instruction, maskable interrupts will be
disabled.
RETT
142
IM
Operation ; —
Format ;
Opcode
Operands
IM
1110 110 1
ED
—I — I — I — I — I — r — I —
10 11110
5E
Description :
None
145
IM 1
Operation: —
Opcode
IM
Operands
1 1 1
I I
1 1
— I I —
1
I — I —
10 10 110
I I I I I
ED
56
Description:
144
Example :
ADD HL.DE
148
ADD HL, ss
Operation: HL-^HL+ss
Format :
Opcode
Operands
ADD
HL, ss
OS, Si, 0. 0, 1
Description:
S:
Not affected
Z:
Not affected
H:
P/V:
Not affected
N:
Reset
C:
Register
Pair
ss
BC
DE
HL
SP
00
01
10
11
147
Example :
ADC HL.BC
150
ADC HL. ss
Operation: HL<-HL+ss+CY
Format :
Opcode
ADC
Operands
HL,ss
— I 1 1 1 1 1 \ —
1110 110 1
I I I — I — I — I — I —
— I — I — I — I — I — I — I —
1 s s 1 1
I I I I I I — I
ED
Description:
Register
Fair ss
BC
DE
HL
SP
00
01
10
11
M CYCLES: 4 T STATES: 15(4,4,4,3) 4 MHZ E.T.: 3.75
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Set if carry out of
reset otherwise
N: Reset
149
Ex am p 1 e :
If the contents of the HL register pair are 9999H, the
contents of register pair DE are 111111, and the Carry
Flag is set, after the execution of
SBC UL.DE
152
SBC HL, ss
Operation : HL-<-HL-ss-CY
Format :
Opcode Operands
SBC HL.ss
I'l'i'o'i'i'o'i
ED
1 s s 1
1 I I 1 1 1 1 —
Description :
EC
DE
HL
SP
00
01
10
11
reset otherwise
Z: Set if result is zero;
reset otherwise
H: Set if a borrow from
reset otherwise
N: Set
C: Set if borrow;
reset otherwise
151
Example :
154
ADD IX. pp
Operation: IX-«-IX + pp
Opcode
Operands
IX, pp
I'l'o'i'i'i'o'i
I I 1 I I I I
DD
o'o'p'p'i'o'o'i
I I I I I I I
Description:
Register
Pair pp
BG
DE
IX
SP
00
01
10
11
S:
Not
affected
Z:
Not
affected
H:
Set
if carry out of
Bit
P/V:
Not
affected
N:
Reset
C:
Set
if carry from
Bit
153
Example ;
ADD lY.BC
ADD lY, rr
Operation: lY-^IY+rr
Opcode
Operands
lY.rr
— I 1 1 1 1 1 1 —
1111110 1
— I I I 1 I I I
--T \ 1 1 1 1 1 —
r r 1 1
— I I I — I I I I
FD
Description:
Register
Pair rr
BC
DE
lY
SP
00
01
10
11
M CYCLES:
T STATES: 15(4,4,4,3) 4 MHZ E.T.: 3.75
S: Not affected
Z; Not affected
H: Set If carry out of
INC
Operation! IX <*- IX + 1
Format :
Opcode
Operands
IX
— I 1 1 1 1 1 1 —
110 1110 1
— I — I — I — I — I 1 I
— I — I — I — I — I — I — I —
1 1 1
I I I I ' I I
DD
23
Description:
Example :
INC IX
158
INC ss
Operation: ss*-ss+1
Format :
Opcodes
Operands
INC
ss
s s 1 1
Description:
Example :
INC HL
HL will contain lOOlH.
Register
ss
BC
DE
HL
SP
CO
01
10
11
157
DEC ss
Operation: ss-<-ss-1
Format :
Opcode
Operands
DEC
ss
s s 1 1 1
I I ■ I I I L
Description:
Example:
DEC HL
Pair
ss
BC
DE
HL
SP
00
01
10
11
160
lY
Operation; IY-«-IY+1
Format :
Opcode
Operands
INC
lY
1111110 1
—I I I \ 1 I L_
FD
1 1 1
23
Description:
Example:
INC lY
159
DEC
Operation: IY-*-|Y-1
Opcode
DEC
Operands
lY
— I 1 1 1 1 1 1 —
1111110 1
— I — I — I I I I I
— I — I — 1 — I — I — I — I —
10 10 11
I I I I I ■ '
FD
2B
Description:
Example :
DEC lY
162
DEC IX
Operation: IX-«-IX-1
Fo rmat :
Opcode
Operands
DEC
IX
110 1110 1
DD
10 10 11
2B
Description:
Example:
DEC IX
161
163
Example :
7 6 5 4 3 2 1
[i|o|o[o|i|o[o|o|
C 7 6 5 4 3 2 1
IT] |o|o|o|i|o|oio|i|
165
RLCA
Ope r
Fo rma t ;
Opcode Operands
1 1 1
__l I I I I — I I —
07
Description :
S: Not affected
Z: Not affected
H: Reset
N: Reset
C: Data from Bit 7 of Acc.
164
Example :
C 7 6
10 1
2
1
II 1 1 1
1
1
167
RLA
Operation:
Format ;
Opcode
Operands
RLA
1 1 1 1
17
Not affected
Not affected
Res e t
P/V
N
C
Not affected
Rese t
166
Ex am pi e :
If the contents of the Accumulator are
1
1
7 6 5
4
1 II 1
1
1
169
RRCA
Operation :
7—^0 -Mcv
Fo rma t :
Opc ode
Operands
RRCA
1 1 1 1
OF
Description :
Not affected
Not affected
Reset
P/V
Not affected
Reset
N
C
Example :
1
1
10
1
1
oil.
171
RRA
Ope ration
Format ;
Opcode
Operands
RRA
1 1 1 1 1
IF
Description:
Not affected
Not affected
Reset
P/V
Not affected
Reset
N
C
S:
reset otherwise
Z :
reset otherwise
11:
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
Example :
If the contents of register r are
1
1
6
5
1
1
173
RLC p
Operation
Fo rmat :
Opcode
Operands
RLC
110 10 11
CB
-« r— *►
Description:
B
C
D
E
H
L
A
000
001
010
Oil
100
101
111
172
Example :
1
1
rri ioioioiiioioioii
175
RLC CHLD
Operation
(HL)
Format :
Opcode
Operands
RLC
(HL)
110 10 11
CB
1 1
06
Description ;
S:
Z :
H:
Reset
P/V:
Reset
C:
source register
174
Example :
7
6
1
1
C 76543210
nn io|oioiiioio{oii
177
RLC CIX+dD
Operation
Format :
. Jcvj-J-?-*—
(IX+d)
Opcode
RLC
Operands
(IX+d)
1 1
1
1 DD
CB
06
Description;
S:
reset otherwise
Z:
reset otherwise
H:
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
176
Example :
1
1
1
1
179
RLC CIY+d3
Operation !
Format :
. jcvlX?-*— ^
(lY+d)
Opcode
Operands
(lY+d)
FD
CB
06
Description ;
S ;
reset otherwise
Z;
reset otherwise
H;
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
178
RL (lY+d)
1 FD
CB
16
B
C
D
E
H
L
A
000
001
010
Oil
Oil
101
111
Description:
INSTRUCTION
M CYCLES T STATES
4 MHZ E.T.
RL r 2 8(4,4) 2.00
181
RL m
Operation
Format :
opcode
Operands
RL m
RL r
RL (HL)
RL (IX+d)
t
1
I
CB
CB
16
DD
CB
180
RRC
Operation
Format :
Opcode
RRC
Operands
CB
RRC (HL)
RRC (IX+d)
CB
OE
DD
CB
OE
183
s *
reset otlierwise
Z:
reset otherwise
H:
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
Example ;
5
4
1
1
182
S:
Z:
reset otherwise
H:
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
Example :
5
A 3
1 j
1
after the execution of
RRC A
76543210 C
1 1 1 1
185
RRC (lY+d)
1 FD
CB
OE
Register
Description;
000
001
010
Oil
100
101
111
INSTRUCTION
RRC r
RRC (HL)
RRC (IX+d)
RRC (lY+d)
M CYCLES T STATES
8(4,4)
15(4,4,4,3)
23(4,4,3,5,4,3)
23(4,4,3,5,4,3)
4 MHZ E.T.
2.00
3.75
5.75
5. 75
184
RR (lY+d)
1 1
1 1
0.1 FD
CB
Register
B
C
D
E
H
L
A
000
001
010
Oil
100
101
111
Description;
INSTRUCTION
RR r
RR (HL)
RR (IX+d)
RR (lY+d)
M CYCLES T STATES
4 MHZ E.T.
8(4,4) 2.00
15(4,4,4,3) 3.75
23(4,4,3,5,4,3) 5.75
23(4,4,3,5,4,3) 5.75
187
RR m
Operation
Opcode
Operand
RR r
CB
RR (HL)
RR (IX+d)
CB
IE
DD
CB
IE
SLA
Operation :
Format :
Opcode Operands
SLA m
SLA (IIL)
SLA (IX+d)
1 CB
CB
26
DD
1 CB
26
189
S:
reset otherwise
Z :
reset otherwise
H:
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
Exampl e :
1
1
10
C
1
1 1
188
Set if result is
reset otherwise
negative
Z :
Set If result Is
reset otherwise
zero ;
II:
Reset
P/V:
Set if parity Is
reset otherwise
even ;
N:
Reset
C:
Example :
6
5
3 2
1
1
1 1 1 1
191
SLA (lY+d)
1 1
26
*r Identifies registers B,C,D,E,H,L or A specified as
follows in the assembled object code field above:
1 1 1
FD
CB
Register
000
C
001
010
oil
100
101
ill
Description :
An arithmetic shift
left
INSTRUCTION
SLA r
SLA (HL)
SLA (IX+d)
SLA (lY+d)
M CYCLES T STATES
8(A.4)
15(4,4,4,3)
23(4,4,3,5,4,3)
23(4,4,3,5,4,3)
4 MHZ E.T.
2.00
3.75
5. 75
5.75
SRA(I Y+d)
*r identifies registers
1
I
1
_J
1 1
1
FD
CB
2E
C,D,E,H,L or A specified as
Register r
000
C
001
010
Oil
100
101
A
111
193
SRA m
Operation:
Format ;
Opcode Operands
SRA n
SRA r
SRA(HL)
SRA(IX+d)
1
1
I
1 1
I —
1 1
-J
1 1
1 CB
2E
192
SRL
Operation
Opcode
Operands
SRL m
SRL (IX+d)
1111
I I I
CB
CB
3E
DD
CB
3E
195
Condition Bits Affected:
S:
reset otherwise
Z:
reset otherwise
H:
Reset
P/V:
reset otherwise
N:
Reset
C:
source register
Example :
1
1
6
5
1
1
194
S :
Rese t
Z :
Set if result is zero
reset otherwise
H:
Reset
P/V:
reset otherwise
N:
Reset
C:
Data from Bit of
source register
Example :
5 4
2
1
'll'l
197
SRL (lY+d)
1 1
1
_J
1
I
1
I
1 1
FD
CB
3E
Register
B
C
D
E
H
L
A
000
001
010
Oil
100
101
111
Description!
INSTRUCTION
SRL r
SRL (HL)
SRL (IX+d)
SRL (lY+d)
M CYCLES T STATES
8(4,4)
15(4,4,4,3)
23(4,4,3,5,4,3)
23(4,4,3,5,4,3)
4 MHZ E.T.
2. 00
3.75
5.75
5.75
196
Example :
5
4
1
1
Accumulator
7 6 5 4 3 2 1
(5000H)
6
5
1
1
Accumulator
7 6 5 4 3 2 1
1
1
(5000H)
199
RLD
Operation:
Opcode
Operands
RLD
1110 110 1
I I I I I I I
— I 1 1 1 1 1 1 —
110 1111
— I — I I I I I I
ED
6F
Description:
The contents of the low order four bits (bits 3,2,1 and
0) of the memory location (HL) are copied into the high
order four bits (7,6,5 and 4) of that same memory
location; the previous contents of those high order four
bits are copied Into the low order four bits of the
Accumulator (register A); and the previous contents of
the low order four bits of the Accumulator are copied
into the low order four bits of memory location (HL).
The contents of the high order bits of the Accumulator
are unaffected. Note: (HL) means the memory location
specified by the contents of the HL register pair.
S:
Z :
H:
Reset
P/V:
N:
Reset
C:
Not affected
198
Example :
1
1
Accumulator
7 6 5 4 3 2 1
1
(5000H)
I
Accumulator
7 6 5 4 3 2 1
10 10 (5000H)
201
RRD
Operation ; *Q^^^]<"U
Format ;
Opcode
RRD
Operands
1110 110 1
— I — I — I — I I I I
— r— T — I — I — I — I — I —
110 111
— I 1 1 1 1 U_l
ED
67
Description:
The contents of the low order four bits (bits 3,2,1 and
0) of memory location (HL) are copied Into the low order
four bits of the Accumulator (register A) ; the previous
contents of the low order four bits of the Accumulator
are copied Into the high order four bits (7,6,5 and A)
of location (HL) ; and the previous contents of the high
order four bits of (HL) are copied into the low order
four bits of (HL) . The contents of the high order bits
of the Accumulator are unaffected. Note: (HL) means
the memory location specified by the contents of the HL
register pair.
S:
H:
P/V:
N:
C:
Set If Acc. is negative after
operation; reset otherwise
Set if Acc. is zero after
operation; reset otherwise
Reset
Reset
Not affected
200
202
Exampl e :
204
BIT b, r
Operation: Z r jj
Fo rmat !
Opcode
Operands
BIT
b ,r
— I 1 1 1 1 ! 1 —
110 10 11
■ I I I I I I —
J 1 L.
CB
Description:
Bit Tested
Register
r
000
000
001
001
010
D
010
Oil
oil
100
100
5
101
101
110
111
111
M CYCLES: 2 T STATES: 8(4,4) 4 MHZ E.T.: 2.00
Condition Bits Affected :
S: Unknown
0; reset otherwise
H: Set
P/V: Unknown
N: Reset
C: Not affected
203
Example :
BIT 4, (HL)
BIT b, CHLD
Operation ; Z-«-(HL)j,
Format :
Opcode
Operands
BIT
b,(HL)
110 10 11
CB
1-1 — b ^1 1
Description ;
Bit Tested
b
1
2
3
4
5
6
7
000
001
010
Oil
100
101
110
111
S;
Z :
Unknown
Not affected
P/V
H
C
205
S: Unknown
0; reset otherwise
H: Set
P/V: Unknown
N: Reset
C: Not affected
Example :
BIT 6, (IX+4H)
208
BIT b. CIX+dD
Operation ; Z-«-{IX+d)jj
Fo rmat ;
Opcode
BIT
Operands
b , (IX+d)
1 1
DD
CB
Description ;
This instruction tests bit b in the memory location
specified by the contents of register pair IX combined
with the two's complement displacement d and sets the Z
flag accordingly. Operand b is specified as follows in
the assembled object code.
Tested
000
001
010
3
on
100
101
110
111
S : Unknown
207
S; Unknown
0; reset otherwise
H: Set
P/V: Unknown
N: Reset
C: Not affected
Example :
BIT 6, (IY+4H)
210
BIT b, ClY+d]
BIT b,(IY+d)
Operation ! Z (I Y+tl)b
Format ;
Opcode
BIT
Operands
b , (lY+d)
1 1
1 FD
CB
Description ;
Bit Tested
1
2
3
4
5
6
7
000
001
010
Oil
100
101
110
111
209
SET b. CHL3
Operation : (HLlj,"*-!
Format ;
Opcode
SET
Operands
b , (HL)
I'l'o'o'
•1
I L.
1 — I — I —
-b — .-1
1 1
CB
1
2
3
4
5
6
7
M CYCLES: 4 T STATES:
Condition Bits Affected :
Example :
000
001
010
Oil
100
101
110
111
15(4,4,4,3)
None
4 MHZ E.T. : 3.75
SET 4,(HL)
212
SET b, r
Operation ; rjj 1
Forma t ;
Opcode Operands
SET b,r
1 'l 'O 'O 'l 'O 'l 'l I CB
I I I 1 I 1 I
Description ;
Bit
Register
000
B
000
001
001
010
010
3
Oil
Oil
100
100
101
101
6
110
111
ill
Example :
SET 0,(IX+3H)
214
SET b. ClX+d]
Operation ; (IX+dlj,-*-!
Format ;
Opcode
SET
Operands
b, (IX+d)
1 DD
1 CB
Description ;
1
2
3
4
5
6
7
000
001
010
Oil
100
101
no
111
M CYCLES: 6
5.75
213
the execution of
SET 0,(IY+3H)
216
SET b. ClY+d]
Operation ; (I Y+d)b 1
Format ;
Opcode
SET
Operands
b , (lY+d)
1 1
FD
CB
Description !
Bit Tested
1
2
3
4
5
6
7
000
001
010
Oil
100
101
110
111
M CYCLES: 6
5.75
Reset
Reg Is t er
nnn
u uu
000
1
001
001
010
010
on
oil
4
100
100
101
101
no
A
111
111
Description:
RES r 4
RES (HL) 4
RES (IX+d) 6
RES (lY+d) 6
8/(4,4) 2.00
15(4,4,4,3) 3.75
23(4,4,3,5,4,3) 5.75
23(4,4,3,5,4,3) 5.75
Example:
RES 6,D
RES b. m
Operation; Sjj *"
Opcode
RES
Operands
RES b,r
1
CB
RES b,(HL)
CB
RES b,(IX+d)
DD
CB
RES b,(iy+d)
FD
CB
-JlfP GROUP-
219
JP cc, nn
Operation; IF cc TRUE, PC nn
Opcode
JP
Operands
cc ,nn
Description:
CONDITION
RELEVANT
FLAG
000
001
010
on
100
101
110
111
NZ non zero
Z zero
NC no carry
C carry
PO parity odd
PE parity even
P sign positive
M sign negative
Z
Z
C
C
P/V
P/V
S
S
221
JP nn
Operation ; PC nn
Format ;
Opcode
JP
Ope rands
1 1
C3
Description ;
220
JR
Operation: PC PC + e
Format :
Opcode
Operand
— I 1 1 1 1 1 1 —
1 1
I 1 I I I I I
18
-e-2-
-J — I I I I I i_
Description:
Example :
JR $+5
480
481
482
483
484
485
Instruction
03
PC after jump
223
JP C,1520H
222
JR C,$-4
Location Instruction
47C •* — PC after jump
47D
47E
47F
480 38
225
JR C, e
Operation: If C = 0, continue
If C= 1, PC^PC + e
Format :
Opcode
Operands
JR
C,e
1 1 1
38
e-2
Description:
This instruction provides for conditional branching to
other segments of a program depending on the results of
a test on the Carry Flag. If the flag is equal to a
' 1 ' , the value of the displacement e is added to the
Program Counter (PC) and the next instruction is fetched
from the location designated by the new contents of the
PC. The jump is measured from the address of the
instruction opcode and has a range of -126 to +129
bytes. The assembler automatically adjusts for the
twice incremented PC.
If condition is met:
224
JR NC , $
Location Instruction
481 00
227
JR NC. e
Operation: If C = 1 , continue
lfC = 0, PC*-PC + e
Fo rmat :
Opcode
Operands
JR
NC,e
1 1
30
e-2
Description:
This instruction provides for conditional branching to
other segments of a program depending on the results of
a test on the Carry Flag. If the flag is equal to '0',
the value of the displacement e is added to the Program
Counter (PC) and the next instruction is fetched from
the location designated by the new contents of the PC.
The Jump Is measured from the address of the instruction
opcode and has a range of -126 to +129 bytes. The
assembler automatically adjusts for the twice
incremented PC.
M CYCLES: 7
T STATES: 7(4,3)
4 MHZ E.T. : 1 . 75
Condition Bits Affected:
None
Example :
JR Z,$ +5
Location Instruction
300 28
301 03
302
303
304
229
JR Z. e
Operation: If Z = 0, continue
lfZ = 1, PC^PC + e
Opcode
Operands
JR
Z,e
— I 1 1 1 1 1 1 —
1 1
I I I I I I I
28
-e-2-
Description :
228
JR NZ,$-4
The resulting object code and final PC value is shown
below:
Location Instruction
4 7D
A7E
47F
480 20
231
JR NZ, e
Operation ; If Z = 1, continue
lfZ = 0, PC^PC + e
Format:
Opcode
Operands
NZ,e
1 1 1 1 1 1 1 1 1
I I I I L__
20
-e-2-
Description:
Example:
The Zero Flag is reset and it is required to jump back 4
locations from 480. The assembly language statement is;
230
JP CIXD
Operation ; PC-«-IX
Format !
Opcode
Operands
JP
(IX)
110 1110 1
DD
1110 10 1
E9
Description ;
None
Example ;
JP (IX)
233
JP CHLD
Operation: PC-<-HL
Format :
Opcode
Operands
JP
(HL)
1110 10 1
E9
L-j I I I I I L
Description:
Example:
JP (HL)
232
DJNZ
Operation:
Format :
Opcode
Operand
— I 1 1 1 1 1 1 —
1
— I 1 I 1 1 I I
10
Description:
This instruction is similar to the conditional jump
instructions except that a register value is used to
determine branching. The B register Is decremented and
if a non zero value remains, the value of the
displacement e is added to the Program Counter (FC).
The next instruction is fetched from the location
designated by the new contents of the PC. The jump is
measured from the address of the Instruction opcode and
has a range of -126 to +129 bytes. The assembler
automatically adjusts for the twice Incremented PC.
If B/0:
235
JP CIY]
Operation ! PC-«-IY
Format :
Opcode
Operands
JP
(lY)
1111110 1
FD
1110 10 1
E9
Description:
Example ;
None
JP (lY)
234
237
LD DE.Outbuf
LD
A, (HL)
LD
CP
JR
INC
INC
DJNZ
(DE) ,A
ODH
Z.DONE
HL
DE
LOOP
;input buffer
;Is it a CR?
;Yes finished
;Increment pointers
;Loop back if 80
;byte8 have not
;been moved
236
Exampl e ;
If the contents of the Program Counter are 1A47H, the
contents of the Stack Pointer are 3002H, and memory
locations have the contents:
Location
Con tents
1A47H
1A48H
1A49H
CDH
35H
21H
CALL 2135H
239
CALL nn
Format ;
Opcode Operands
CALL nn
1 1
CD
Description :
238
cc
Condition
Relevant
Flag
000
NZ non zero
001
Z zero
010
NO non carry
Oil
C carry
C
100
PO parity odd
P/V
101
PE parity even
P/V
no
P sign positive
111
M sign negative
If cc is true:
Example:
Location
1A47H
1A48U
1A49H
Contents
D4H
35H
21H
CALL NC,2135H
241
CALL cc, nn
(SP-2) ^ PC, , PC ^ nn
Opcode
CALL
Operands
Description:
RET
Fo rmat :
Opcode
RET
1 1 1 1
C9
Description:
Example :
None
RET
243
242
M CYCLES: 3 T STATES: 11(5,3,3) 4 MHZ E.T.: 2.75
If cc is false:
RET M
245
RET cc
I I I 1 1 1 1 1 1
1 1 — CC — ^0
L__l 1 1 1— I 1 1
Description ;
Condition
Relevant
Flag
000
NZ non zero
001
Z zero
Z
010
NC non carry
Oil
C carry
100
PO parity odd
P/V
101
PE parity even
P/V
110
P sign positive
111
M sign negative
If cc is true:
244
B generates an interrupt and is acknowledged. (The
interrupt enable out, lEO, of B goes low, blocking any
lower priority devices from interrupting while B is
being serviced). Then A generates an interrupt,
suspending service of B. (The lEO of A goes 'low'
indicating that a higher priority device is being
serviced.) The A routine is completed and a RETI Is
issued resetting the lEO of A, allowing the B routine to
continue. A second RETI is issued on completion of the
B rou-tine and the lEO of B is reset (high) allowing
lower priority devices interrupt access.
RETI
Format ;
Opcode
RETI
— I \ 1 1 1 \ 1 —
1110 110 1
I — I — I — I — 1 —
— I — I — I — I — \ — I — I —
10 110 1
ED
40
Description:
Examp 1 e :
lEI lEO
lEI lEO
*
249
RETN
Format :
Opcode
RETN
1110 110 1
ED
1 1 1
45
Description ;
Example :
None
248
Example :
code IIOIIII)
as the address of the next
RST p
RST p
I 1 1 1 1 1 1 1 —
1 1 ^1 1 1
1 I 1 1 1 1 I —
Description:
P t
OOH 000
08H 001
lOH 010
18H Oil
20H 100
2 on 101
30H 110
38H 111
250
IN p. CCD
Format :
Opcode
Operands
r,(C)
1110 110 1
ED
1 — r — ^0
I I i I I I I
Description:
Reg .
000
C
001
010
oil
100
101
A
111
254
A, Cn]
Operation: A ^ (n)
Format :
Opcode
Operands
IN
A,(n)
110 110 11
DB
Description:
Example :
If the contents of the Accumulator are 23H and the byte
7BH is available at the peripheral device napped to I/O
port address OIH, then after the execution of
IN A, (OIH)
253
Opcode
1110 110 1
I — \ I I I I I
1 1 1
__J — I — I — I — I — I — 1__
ED
A2
Description:
Z: Set if B-1-0;
reset otherwise
H: Unknown
P/V: Unknown
M: Set
C: Not affected
Example :
256
Z:
H:
Reset
P/V:
N:
Reset
C:
Not affected
Example :
IN D, (C)
255
INIR
Opcode
INIR
— I 1 r— I 1 1 1
ED
— I 1 1 1 1 1 1 —
1110 110 1
■ I I I I I I —
— I 1 1 1 1 1 1 —
10 110 10
I I I I I I I
B2
If B=0:
258
IND
Opcode
1110 110 1 ED
_l I — I — I — I — I — I-
— I — I — I — I — 1 — I — I —
10 10 10 10
[ 1 I I I — I I
AA
Description :
S: Unknown
Z: Set if B-1-0;
reset otherwise
H: Unknown
P/V: Unknown
K: Set
C: Not affected
Example :
260
S: Unknown
Zs Set
H: Unknown
P/V: Unknown
N: Set
C: Hot affected
Example :
51H
A9H
03H
Location
Contents
lOOOH
lOOIH
1002H
51H
A9H
03H
259
INDR
Operation ; (HL)*-(C). B ^ B-1 - HL^HL-1
Format ;
Opcode
INDR
— I 1 1 1 1 1 1 —
1110 110 1
I I I i 1 1 1 —
— I 1 1 1 1— 1 1 —
10 1110 10
' ■ I I I \ I
ED
BA
Desc ription :
If B=0:
262
IND
memory location lOOOH will contain 7BH, the HL register
pair will contain OFFFH, and register B will contain
OFH.
261
OUT CnD
Operation ; (n) A
Format ;
Opcode
Operands
OUT
(n) ,A
110 10 11
D3
Description ;
Example :
OUT (OIH), A
264
S: Unknown
Z: Set
H: Unknown
P/V: Unknown
N: Set
Example :
51H
A9H
03H
INDR
Location Contents
OFFEH 03H
OFFFH A9H
lOOOH 51H
263
Example:
OUT (C) ,D
266
□ UT CCD. n
Opcode
OUT
Operands
(C) .r
— I 1 1 1 1 1 1 —
1110 110 1
— I — I — I — I — I — I — I —
1 -« — r -0 1
■ I I L_-I I I—
ED
Description:
Register
B
000
001
010
Oil
100
101
A
111
265
268
OUTI
Operation: (C) ^ (HL) , B ^ B-1 , HL HL + 1
Format :
Opcode
OUTI
— I 1 1 1 1 1 1 —
1110 110 1
I I — I — I — I — I — I —
1 1 1 1
■ ■ I I L— I I
ED
A3
Description:
S: Unknown
Z: Set If B-1-0;
reset otherwise
H; Unknown
P/V: Unknown
N: Set
C: Not affected
Example:
267
S: Unknown
Z: Set
H: Unknown
P/V: Unknown
N: Set
C: Not affected
Example :
Location Contents
lOOOH
lOOlH
1002H
51H
A9H
03H
OTIR
51H
A9H
03H
270
OTIR
Operation : (C) (HL) , B ^ B-U HL^HL + 1
Format ;
Opcode
—1 1 1 1 1 1 1 —
1110 110 1
I I I I I I I
— I — I — I — I — I — I — I —
10 110 11
I — I I — I I — I I —
ED
B3
Description:
If B-0:
269
272
OUTD
Opcode
OUTD.
I'l'i'o'i'i'o'i
■ ■ ■ ■ ■ l_l
ED
AB
Description ;
Unknown
Z:
Set If B-l-O;
reset otherwise
H:
Unknown
P/V:
Unknown
N:
Set
C:
Not affected
Example ;
271
S: Unknown
Z : Set
H: Unknown
P/V: Unknown
N: Set
C: Not affected
Example :
If the contents of register C are 07H, the contents of
register B are 03H, the contents of the HL register pair
are lOOOH, and memory locations have the following
contents :
Location Contents
OFFEH 51H
OFFFH A9H
lOOOH 03H
OTDR
03H
A9H
51H
274
OTDR
Operation ; (C) ^ (HL) . B ^ B-1 , HL^HL-1
Format ;
Opcode
OTDR
— I 1 1 1 1 1 1 —
1110 110 1
I I I I \ I I
10 1110 11
I I I I I I
ED
BB
Description ;
If B-0:
273
and lY 82
BC'.DE'.HL' respectively 79
JR e Unconditional Jump
276
Z80-CPU INSTRUCTION SET
ALPHABETICAL
at location nn 238
decrement HL and EC 95
and HL 80
275
LDI Load location (DE) with location (HL),
decrement HL and B,
cc is true 244
278
277
APPENDIX A
ERROR MESSAGES AND EXPLANATIONS
3) INVALID OPCODE
4) INVALID NUMBER
6) SYNTAX ERROR
7) ASSEMBLER ERROR
8) UNDEFINED SYMBOL
280
279
282
281
APPENDIX B
INSTRUCTION SET ALPHABETICAL ORDER
2-80 CROSS ASSEMBLER VERSION 1.06 OF 06/18/76
U//UV/IO 1U>££>
STMT
SOURCE STATEMENT
LOC
08J CODE
STMT
SOURCE STATEMENT
0000
8E
AOC
Al (HLi
007C
CB56
70
BIT
2.(HL)
inni
0D8E05
AOC
A> ( IX + INO)
007E
DDCB0556
71
BIT
2. ( tX«^IN0)
0004
FDBE05
AOC
A, ( lY-flNOI
U082
F0CB0556
72
BIT
2.(lY+IN0)
0007
AOC
Af A
0086
CB57
73
BIT
2.A
0008
68
AOC
AfB
U088
CB50
74
BIT
2.B
89
AOC
AtC
008A
CB51
75
BIT
2,C
OOOA
8A
7
AOC
AtO
008C
CB52
76
8IT
2,0
OOOB
88
g
AOC
A.E
008E
CB53
77
BIT
2.E
OOOC
ac
AOC
A,H
009Q
CB54
78
BIT
2|H
80
10
ADC
AtL
0092
Ca55
79
BIT
2.L
OOOE
CE20
AOC
A(N
0094
CB5E
80
BIT
3. IHL)
0010
E04A
12
AOC
HL.BC
0096
0DCB055E
61
BIT
3t( tXt-INO)
0012
E05A
13
AOC
HL.DE
009A
FDCB055E
62
BIT
StllY^-INO)
E06A
14
AOC
HLfHL
009E
CB5F
83
BIT
3. A
0016
ED7A
15
AOC
HL.SP
00 AO
CB58
84
BIT
3,B
86
ADD
A , ( HL )
O0A2
CBS9
85
BIT
3tC
0019
008605
17
ADU
At ( IX+IND)
00A4
CB5A
86
BIT
3.0
OOlC
FD8605
18
ADO
A, ( lYt-INO)
00A6
CB5B
87
BIT
3.E
OOIF
87
19
ADD
A, A
O0A8
CB5C
88
BIT
3.H
80
20
ADO
A>B
OOAA
CB5D
89
BIT
3.L
0021
21
ADO
A ,C
OOAC
CB66
90
BIT
4. IHL)
0022
82
ADD
At D
OOAE
00CB0S66
91
BIT
4tltX4-IND)
23
ADD
A tE
00B2
FOCB0566
92
BIT
4t( IY4-IN0)
0024
84
24
ADD
AtH
O0B6
CB67
93
BIT
4. A
0025
85
ADO
AtL
0068
CB60
94
BIT
4.B
0026
C620
26
ADO
A,N
OOBA
CB6 1
95
BIT
4.C
ADD
HLtBC
ODBC
CB62
96
BIT
4.0
0029
19
28
AOO
HLtOE
OOBE
CB63
97
BIT
4.E
002A
29
ADD
HLtHL
OOCO
CB64
98
BIT
4.H
002B
39
30
ADD
HLtSP
00C2
CB65
99
BIT
4.L
002C
0009
31
ADO
IX. BC
00C4
CB6E
100
BIT
5.(I*LI
OOZE
0019
32
ADD
IX. DE
00C6
0DCB056E
101
BIT
5,1 IX+INOi
33
AOO
IX. IX
OOCA
FDCS056E
102
BIT
5,IIY*IND)
0032
DD39
34
AOO
UtSP
OOCE
CB6F
103
BIT
5, A
0034
F009
ADO
lYtBC
OODO
CB68
104
BIT
5,B
0036
F019
36
AOO
lY.OE
0002
CB69
105
BIT
5,C
U038
FD29
37
ADO
lY.IY
0004
CB6A
106
BIT
5,0
003A
FD39
36
ADO
lY.SP
0006
CB6S
107
BIT
5.E
003C
A6
39
AND
IHL )
0008
CB6C
108
BIT
5.H
0030
00A605
40
AND
(IXtlNO)
OOOA
CB60
109
BIT
5,L
F0A605
41
AND
( lYtlND)
OOOC
CB76
110
BIT
6.llj<L)
0043
A7
42
AND
OOOE
D0CB0576
111
BIT
6,IIX>^IN0i
0044
AO
AND
00E2
FDCB0576
112
BIT
6,1 1Y*IN0)
0045
Al
44
AND
00 E6
CB77
113
BIT
6, A
0046
A2
45
AND
O0E8
CB70
114
BIT
6.B
0047
A3
46
AND
E
OOEA
CB71
115
BIT
6,C
0048
A4
47
AND
H
OOEC
CB72
116
BIT
6.0
0049
AS
48
AND
OOEE
CB73
117
BIT
6.E
004A
E620
49
AND
OOFO
CB74
118
BIT
6.H
CB46
50
BIT
. ( HL )
00F2
CB75
119
BIT
6,L
004E
0OCB0546
51
BIT
Ot ( IX + INDI
O0F4
CB7E
120
BIT
7,(HL)
0052
F0CB0546
52
BIT
Ot( lYt^INO)
O0F6
0DCB057E
121
BIT
7,(IX^IN0I
0056
CB4 7
53
BIT
OtA
OOFA
FDCB0S7E
122
BIT
7,iIY*INDI
0058
CB40
54
BIT
OtB
OOFE
CB7F
123
BIT
7,A
005A
CB41
55
BIT
O.C
0100
CB78
124
BIT
7.B
005C
C642
56
BI T
O.D
0102
CB79
125
BIT
7,C
005E
CB43
57
BIT
OtE
0104
CB7A
126
BIT
7,0
0060
CB44
56
BIT
O.H
0106
CB7B
127
BIT
7,E
0062
CB45
59
BIT
O.L
0108
C87C
128
BIT
7.H
0064
CB4E
60
BIT
1 . ( HL 1
OlOA
CB70
129
BIT
7.L
0066
00CB0S4E
61
BIT
If (IXt^IND)
OlOC
0CB405
130
CALL
C.NN
006A
FDCB054E
62
BIT
lt( lY+INO)
OlOF
FC6405
131
CALL
M.NN
006E
C84F
63
BIT
l.A
0112
048405
132
CALL
NC.NN
0070
C848
64
BIT
l.B
0115
C08405
133
CALL
NN
0072
CB49
65
BIT
l.C
0118
C48405
134
CALL
HI , NN
0074
CB4A
66
BIT
1 .0
OllB
F48405
135
CALL
P,NN
0076
CB4B
67
BIT
liE
QUE
EC8405
136
CALL
PE.NN
0078
CB4C
68
BIT
l.H
0121
E48405
137
CALL
POtNN
007A
CB40
69
BIT
l.L
0124
CC8405
138
CALL
ZtNN
284
LOC
OBJ CODE
STMT
SOURCE STATEMENT
022E
70
277
LO
A.L
022F
3620
278
1.0
A.N
0231
46
279
LO
B.tHLI
0232
004605
280
LO
B,( IX»INOt
0235
F0460S
261
LO
Bi( lY+INO)
0238
47
282
LO
B.A
0239
40
283
LO
BtB
023A
41
284
LO
BiC
023B
42
285
LO
BtO
023C
43
266
LO
BtE
0230
44
287
LO
B.H.NN
023E
45
288
LO
BtL
023F
0620
289
LO
B«N
0241
E04B8405
290
LO
BCt(NNi
0245
018405
291
LO
BCtNN
0248
4E
292
LO
C.lHLI
0249
D04E0S
293
LO
Ctt IXtINO)
02 4C
F04E0S
294
LO
Ci ( lY^-INOI
024F
4F
295
LO
Ci A
0250
48
296
LO
C.B
0251
49
297
LO
CO
0252
4A
298
LO
C«D
0253
4B
299
LD
C.E
0254
4C
300
LO
C.H
0255
40
301
LO
C.L
0256
0E20
302
LO
C.N
025B
56
303
LO
0. (HL)
0259
005605
304
LO
0.( IX»IND1
025C
F05605
305
LO
D.I lY+INDI
02 5F
57
306
LO
O.A
0260
50
307
LO
o.a
0261
51
306
LO
O.C
0262
52
309
LO
6.0
0263
53
310
LO
DfE
0264
54
311
LO
O.H
026 5
55
312
LO
O.L
0266
1620
313
LD
O.N
0268
E05B8405
314
LO
OE.(NNi
026C
1 1B405
315
LD
OE.NN
026F
5E
316
LD
E.(HL)
0270
0D5E05
317
LO
Et( IX+INO)
0273
F05E05
318
LO
E.( IY«^INO)
0276
5F
319
LO
E.A
0277
58
320
LO
E.a
0278
59
321
LO
E.C
0279
5A
322
LD
E.O
02 7A
5B
323
LO
EiE
027B
5C
324
LO
E.H
02 7C
SO
325
LO
E.L
0270
1E20
326
LO
E.N
027F
66
327
LO
H.IHL)
0280
006605
328
LO
H. I IXf-INOI
0283
F06605
329
LO
Ht(IY*lNO)
0286
67
330
LO
H.A
0287
60
331
LO
H.B
0288
61
332
LO
H.C
0289
62
333
LO
H.O
02 8A
63
334
LD
H.E
028B
64
335
LD
H.H
028C
65
336
LO
H.L
0280
2620
337
LD
H.N
2A8405
338
LD
HL, (NN)
0292
218405
339
LD
HL.NN
0295
E047
340
LO
t.A
0297
DD2A8405
341
LO
IX, INNi
029B
00216405
342
LO
IX. NN
029F
FD2A8405
343
LO
lY, INN)
02A3
F0218405
344
LO
IY,NN
02A7
6E
345
LO
L.(HL)
OF 06/18/76
LOC
OBJ CODE
STMT
SOURCE STATEMENT
02A8
006E05
346
LO
L.dittINO)
02AB
FD6E05
347
LO
L.llV^INOi
02AE
6F
348
LO
L,A
02 AF
66
349
LO
L,8
69
350
LD
L,C
0281
6A
351
LO
L,D
352
LO
L.E
02B3
6C
353
LO
L,H
Q2B4
60
354
LO
L.L
02B5
2E20
355
LO
L,N
E07B8405
356
LO
SP.INNI
02BB
F9
357
LO
SP.Ht
n»Br
LO
SP.IX
02BE
FDF9
359
LD
sp.iy
nf rn
LD
SP.NN
njf *
FDAB
361
LOO
07 r 5
FOBS
362
LOOK
nfr7
FOAO
363
LOI
02C9
EOBO
364
LOIR
02CB
E044
365
NEC
02C0
00
366
NOP
02CE
B6
367
OR
<HL) :
02CF
00B605
368
OR
(IX+INOi
0202
FOB605
369
OR
(IY4^fN0)
0205
B7
370
OR
371
OR
njnT
b?
372
OR
07Da
B2
373
OR
nfno
nfnA
374
OR
E
OR
nfnn
B5
OR
Djnr
F62
377
OR
of np
FDBB
378
OTOR
of EO
EDB3
379
OTIR
nfp7
E079
380
OUT
(C)«A
02E4
£041
381
OUT
(C)^B
02 E6
ED49
382
OUT
ICI»C
E05i
383
OUT
(ChO
02EA
E059
384
OUT
(CI *E
02 EC
ED61
385
OUT
(CI<H
386
OUT
(oa
0320
387
OUT
N,A
cnA?
OUTD
n7Fl
369
OUT I
POP
AF
n7P7
391
POP
BC
nfcn
01
392
POP
OE
02F9
£1
393
POP
HL
n7FA
ODEl
394
POP
IX
02 FC
395
POP
lY
02FE
396
PUSH
AF
C5
397
PUSH
BC
0300
05
398
PUSH
OE
0301
E5
399
PUSH
HL
0302
DOES
400
PUSH
IX
0304
FOES
401
PUSH
lY
0306
CB86
402
RES
O.iHLi
0308
D0CSO586
403
RES
0,IIX«^INDi
030C
F0CB0586
404
RES
0.(IY«-INO)
0310
CB87
405
RES
O.A
0312
CBao
406
RES
0,8
0314
CB81
407
RES
O.C
0316
CB82
408
RES
0,0
0318
CB83
409
RES
O.E
031A
CBa4
410
RES
O.H
031C
CB85
411
RES
0,L
031E
CB8E
412
RES
1,(HL»
0320
0DCB058E
413
RES
l,n^4-|NOI
0324
F0CB058E
414
RES
i.nVuNoi
286
U7/04/76 10:22:
OPCODE LISTiNG
LOC
na 1 rnnp
STbI
SOURCE STATEMENT
LOC
OBJ CODE
STMT
SOURCE STATEMENT
0127
3r
139
CCF
018F
2C
208
INC
L
140
CP
(HL)
33
209
INC
SP
D0BE05
CP
(IX^INO)
0191
EOAA
210
INO
nl »r
F0BE05
142
CP
(IY»INO)
0193
EDBA
211
I NOR
012r
143
CP
A
0195
EDA2
212
INI
aa
144
CP
0197
E0B2
213
INIR
(HLI
0131
ao
145
CP
0199
E9
214
JP
RA
146
CP
019A
0OE9
215
JP
(IX>
ni
RR
147
CP
019C
FDE9
216
JP
(lY)
013^
ar
148
CP
019E
DAS405
217
JP
CtNN
0135
8D
149
CP
01 Al
FA8405
218
JP
MiNN
15Q
CP
219
JP
NCtNN
ni IB
Fnffl
151
CPD
01A7
C38405
220
JP
NN
013A
152
CP OR
01 AA
C28405
221
JP
NZ,NN
013C
cnA 1
153
CPI
01 AO
F28405
222
JP
PfNN
013E
cnui
154
CPIR
OIBO
EA8405
223
JP
PEtNN
,P
155
CPL
224
JP
POiNN
nit?
57
156
OAA
01B6
CA8405
225
JP
Z<NN
157
DEC
(HLi
0189
382E
226
JR
CtOIS
158
OEC
( IX4-IN0)
OIBB
182E
227
JR
OIS
ni
PD3905
159
UEC
(IY«^INO)
302E
228
JR
NCtDIS
160
OEC
OIBF
202E
229
JR
NZ »OIS
OS
161
DEC
OlCl
282E
230
JR
Zf DIS
DEC
BC
01C3
02
231
LO
( BC 1 f A
f .
on
1 A»
OEC
01C4
12
232
LO
(DEI f A
ni2n
IS
1 AA
OEC
01C5
77
233
LO
(HL)iA
ni te
I R
IAS
165
DEC
DE
01C6
70
234
LD
(HLItB
ni AC
ID
166
DEC
E
01C7
fl
235
LD
(HL) fC
nl sn
25
167
OEC
H
72
236
LD
(HLItO
0151
28
168
OEC
HL
01C9
73
237
LD
(HL)tE
0152
0026
169
OEC
IX
LD
(HL)«H
0154
FD2B
170
OEC
lY
QICB
7S
239
LD
(HL),L
0156
2D
171
OEC
OICC
3620
240
LD
(HL)fN
0157
3B
172
OEC
SP
O'lCE
007705
241
LD
( IX't'INOItA
0156
173
01
LD
(IX*IND).8
0159
102E
174
OJNZ
OIS
0104
007 105
243
LD
( IX-ftND) tC
0158
FB
175
El
oidI
LD
( IX«IND),0
OISC
E3
176
EX
(SP)fHL
007305
245
LO
( IX«^IND)tE
0150
0DE3
177
EX
(SPl.IX
ninn
LO
( IX«'1N0)«H
015F
FDE3
178
EX
(SP)f lY
OlFO
D0750S
247
LD
(IXtlNOifL
179
EX
AFtAF'
01E3
nn^ AOS70
LO
(IXI-INDIfN
ni A»
FR
180
EX
OE.HL
01E7
F07705
249
LD
(lY^INDIrA
ni
09
181
EXX
01 EA
FD7005
250
LO
( lY^'INDItB
01 fc4
76
HALT
OlED
F0710S
251
LD
(IY«'IND) fC
1B»
IH
OlFO
F0720S
252
LD
( I Yf-INO) tD
0167
. fr
184
IN
01F3
F07305
253
LD
(IY«'INO)iE
185
IH
01F6
F07405
254
LO
(lY-tlNOItH
nJiB
Fn7H
186
IN
A.(Ci
01F9
FD7505
255
LO
( lY^-INOItL
OIAD
DB20
187
IN
AM
OlFC
F0360520
256
LD
(IV«'IND)tN
niAC
cnlo
168
IN
B.tCi
0200
328405
257
LO
(NN) tA
cn2s
189
IN
C.IC)
0203
ED43840S
258
LD
(NN)tBC
01 73
cneh
190
IN
0.(C)
0207
E053640S
259
LO
(NN)tOE
Fnsa
191
IN
E.(C)
LD
(NN) tHL
ni 77
Fnfco
192
IN
H,(C)
02 OE
nn? 711405
261
LO
(NN)tlX
01 7fl
EU68
193
IN
L.(C)
0212
FD228405
262
LD
(NN) tlY
01 7B
194
INC
(HL)
0216
E0738405
263
LO
(NN)tSP
017C
DD3405
INC
( IXi-INO)
021 A
OA
264
LO
At(BCI
ni 7e
F03403
196
INC
(lYt-INO)
0218
lA
265
LO
At (OE)
01fl2
1 at
197
INC
021c
7E
266
LO
A t ( HL 1
ftl «4
. ,
198
INC
0210
007E0S
267
LD
Ai ('IX4IND)
0184
03
199
INC
BC
0220
FD7E05
268
LO
At( lYf-INO)
0185
oc
INC
C
0223
3A8405
269
LO
A.(NNI
0186
14
201
INC
0226
7F
270
LO
A, A
0187
13
202
INC
OE
0227
78
271
LD
AiB
0188
IC
203
INC
0228
79
272
LO
AtC
0189
24
204
INC
0229
7A
273
LO
A.O
018A
23
205
INC
HL
022A
78
274
LD
A.E
018B
0D23
206
INC
IX
0228
7C
275
LO
A.H
0180
FD23
207
INC
lY
022c
E057
276
LD
All
285
Z-80
CROSS
ASSEMBLER
VERSION 1.06
OF 06/18/76
07/09/76 10:22:4 7
OPCODE LISTING
LUC
OBJ COOb
LOC
OBJ CODE
0440
'*
553
SBC
A.O
04EA
CBEO
622
SET
5tL
044 E
96
554
SBC
A.E
04 EC
CBF6
623
SET
6f C HL J
044F
9C
555
SBC
AtH
DUC&05F6
624
SET
6f ( IX^INOI
0450
9D
556
SBC
A.L
04 F2
F0CB05F6
625
SET
6f ( 1 Yf INOI
04t»l
0E20
557
SBC
AiN
04F6
CBF7
626
SET
6t A •
0453
ED42
558
SBC
HLtBC
04F8
CBFO
627
SET
6tB
0455
ED52
559
SBC
HLtOE
04 FA
CBFl
628
SET
6tC
0457
E062
560
SBC
HLtHL
04FC
CBF2
629
SET
6 iD
0459
ED72
561
SBC
HLtSP
04Ft
CBF3
630
c^I
045B
3 7
562
SCF
CBF4
631
SET
6tH
045C
CBC6
563
SET
0.(HLJ
0502
CBF5
632
SET
6rL
045E
0DCB05C6
564
SET
OtdX^-IND)
0504
CBFE
633
SET
7 ff (HLl
0462
F0CB05C6
565
SET
0t( IV«^INO)
0506
00CB05FE
634
SET
7ff t IX^INO)
0466
CBC7
S66
SET
O.A
05 OA
F0CB05FE
635
SET
7t ( lY^IND)
0468
CBCO
567
SET
OiB
050E
C8FF
636
SET
7tA
046A
CBCl
568
SET
0,C
CBF8
637
SET
7tB
046C
CBC2
569
SET
OfD
0512
CBF9
638
SET
7tC
046E
CBC3
570
SET
O.E
05 14
CBFA
639
SET
7f
0470
C6C4
57i
SET
OfH
0516
CBFB
640
SET
7f E
0472
CBC5
572
SET
O.L
0518
CBFC
641
SET
7tH
0474
CBCE
573
SET
lilHL)
CBFD
642
SET
7iL
0476
0DCB05CE
574
SET
1,(IX+IN0I
05 IC
CB26
643
SLA
(HL)
04 7 A
F0Cd05Cc
575
SET
1,( lYtlNO)
05 IE
00CB0526
644
SLA
{ IX'flNOI
04 7E
CBCF
5 76
SET
IfA
0522
FDCB0526
645
SLA
( lY't'IND)
0480
CBC8
577
SET
IfB
0526
CB27
646
SLA
0482
578
SET
ItC
647
SLA
0484
rSfA
CBCA
579
SET
ItO
052A
CB2X
648
SLA
0486
CBCB
580
SET
1>E
052C
C822
649
SLA
0488
CBCC
581
SET
l.H
052E
CB23
650
SLA
048A
CBCD
582
SET
ItL
0530
CB24
651
SLA
04 8C
CB06
583
SET
2.(HL)
0532
CB25
652
SLA
048E
0OCBO506
584
SET
2f (IX«^IND)
0534
CB2E
653
SRA
(HL 1
0492
FOCB0506
585
SET
2t(IY<'IND)
0536
OOCB052E
654
SRA
( IX4-IN0)
0496
C807
586
SET
2, A
053A
FDCB052E
655
SRA
( lYf-INO)
0498
CBDO
587
SET
2.B
053E
CB2F
656
SRA
049A
CBOl
588
SET
2.C
CB28
657
SRA
B
04 9C
CB02
589
SET
2i0
0542
CB29
658
SRA
C
049E
CB03
590
SET
2.E
0544
CB2A
659
SRA
04 AO
C804
591
SET
2..H
0546
CB26
660
SRA
04A2
CB05
592
SET
2tL
C62C
661
SRA
04A4
CB08
593
SET
3 8
054A
CB2D
662
SRA
04A6
C6DE
594
SET
3tlHL»
054C
CB3E
663
SRL
04 A 8
595
SET
3«<IX*IN0)
054E
0DCB053E
664
SRL
1 IX-*-lNOI
04AC
F0CB050E
596
SET
3f lIYt-INO)
0552
F0CB053E
665
( 1 Y ^iMO 1
0480
597
SET
3tA
0556
CB3F
666
*
04B2
CB09
598
SET
3»C
0558
CB38
«B1
599
SET
3>0
055A
CB39
QBl
Ihi
rnoB
600
SET
3tE
055C
CB3A
669
n oa
rnnr
601
SET
3,H
055E
CB3B
A7i*
«i
n^RA
f Run
602
SET
3f L
0560
CB3C
671
SRL
nlar
C6E6
603
SET
4t (HL)
0562
CB3D
672
SRL
n^BC
604
SET
4<( IXtlNOI
0564
96
673
SUB
(HL)
n^rj
605
SET
4t ( lY+INO)
0565
009605
674
SUB
( IX>I^O)
606
SET
4t A
0568
FD9605
675
SUB
( IY«^INO)
□tea
cbIo
607
SET
4fB
0568
97
676
SUB
n^r A
608
SET
4iC
056C
90
677
SUB
nVrr
r ?
609
SET
4tD
0560
91
678
SUB
7^
rRF3
610
SET
4tE
056E
92
679
SUB
0400
CBc4
611
SET
4f H
056F
93
680
SUB
0402
CBE5
612
0570
94
0404
CBEE
613
SET
5> (HLi
0571
95
682
SUB
L
0406
DDCBOSEE
614
SET
S.(IXtlNO)
0572
D620
683
SUB
H
040A
FDCB05EE
615
SET
5f (IY*INDI
0574
AE
684
XOR
(HL)
04UE
CBEF
616
SET
5, A
0575
00AE05
685
XOR
(IXtlNOI
04 EO
CBE8
617
SET
5,B
0578
F0AE05
686
XOR
(lYl-IND)
04E2
CBE9
618
SET
5,C
057B
AF
687
XOR
04E4
CBEA
619
SET
SfO
057C
A8
688
XOK
04E6
CBEB
620
SET
5,E
05 70
A9
689
XOR
04EB
CBEC
621
SET
5,H
057E
AA
690
XOR
0328
CB8F
416
RES
1 1
|A
032A
ceaa
416
RES
li
iB
03 2 C
ceev
417
RES
li
rC
032E
CB8A
418
RES
1<
>0
0330
CB8B
419
RES
li
lE
0332
CB8C
420
RES
1,
>H
0334
CBBD
421
RES
1<
>L
0336
CB96
422
RES
2,
>(HLI
033B
DDCB0596
423
RES
2.
r ( IX+IND)
33C
F0CB0596
424
RES
2i
,( lYI-INDI
03«0
€697
425
RES
2i
rA
0342
CB90
426
RES
2i
rB
0344
CB91
42 7
RES
2i
>C
0346
CB92
428
RES
2.
.0
0348
CB93
429
RES
2,
,E
034A
CB94
430
RES
2i
iH
034C
C695
431
RES
2,
rL
034E
CB9E
432
RES
3,
, IHL)
0350
D0CB059E
433
RES
3,
,(IXtINDI
03S4
F0CB059E
434
RES
3,
, ( lY + IND)
0358
CB9F
435
RES
3,
>A
035A
C698
436
RES
3i
rB
035C
CB99
43 7
RES
3i
rC
035E
CB9A
438
RES
3,
rO
0360
CB9B
439
RES
3,
,E
0362
CB9C
440
KES
3,
rH
0364
CB90
441
RES
3,
,L
0366
CBA6
442
RES
4,
, (HL)
0368
0UCB05A6
443
RES
4,
,( IX+INDl
036C
F0CB05A6
444
RES
4,
,( lY+INOl
0370
CBA7
445
RES
4,
.A
0372
CBAO
446
RES
4,
>B
0374
CBAl
447
RES
4,
rC
0376
CBA2
448
RES
4,
rO
0378
CBA3
449
RES
4,
,E
037A
CBA4
450
RES
4,
.H
037C
CBA5
451
RES
4i
,L
03 7E
CBAE
452
RES
5i
r (HLI
U380
0OCBO5AE
453
RES
5,
0384
FDCBOSAE
454
RES
5,
, { lY + INDJ
0388
CBAF
455
RES
5f
>A
038A
CBA8
456
RES
5,
rB
038C
CBA9
457
RES
5,
,C
038E
CBAA
458
RES
5,
rD
0390
CBAB
459
RES
5,
,E
0392
C8AC
460
RES
5,
.H
0394
CBAO
461
RES
5,
>L
0396
CBB6
462
RES
6i
, (HL)
0398
00CB05B6
463
RES
6,
i(IX«^INU)
039C
FDCB05B6
464
RES
6,
r ( IY*IND)
03 AO
CBB7
465
RES
6,
>A
03A2
CBBO
466
RES
6i
tB
03 A4
CBBl
467
RES
6i
iC
03A6
CBB2
468
RES
6i
rO
3A8
CBB3
469
RES
6,
lE
03AA
C6B4
470
RES
6i
iH
03 AC
CBB5
471
RES
6,
iL
03AE
CBBE
472
RES
7.
> ( HL )
03 BO
DDCB05BE
473
RES
7,
, ( IX+INO)
03B4
FDCB05BE
474
RES
7,
, ( lYi-INO)
03B8
CBBF
475
RES
7i
lA
03BA
CBB8
476
RES
7,
rB
03BC
CBB9
477
RES
7,
>c
03BE
CBBA
478
RES
7,
>D
03C0
CBBB
479
RES
7,
>E
03C2
CBBC
480
RES
7,
iH
03C4
CBBD
481
RES
7,
iL
03C6
C9
482
RET
03C/
08
483
RET
C
OF 06/18/76
03C8
F8
484
03C9
485
RPT
03CA
CO
486
OCT
U7
03CB
FO
487
RET
D
03CC
,E8
488
PC
03CD
EO
489
HPT
on
03CE
C8
490
OCT
03CF
E040
491
DCTI
03DI
ED45
492
OCTN
RETN
0303
CB16
493
d*^
(HL )
03DS
OOCB0516
494
03 D9
F0CB0516
495
Dl
I 1 T* IMU 1
03 OD
CB17
496
RL
*
03DF
CBIO
497
RL
OiEl
CBll
498
RL
03E3
CB12
Ri*^
J"
03E5
CB13
sin
500
03E7
CB14
501
D
03 E9
CB15
502
RL
03EB
1 7
503
RLA
03EC
CB06
504
RLC
IHLJ
03EE
DOCB0506
505
RLC
( IX-*-lND)
03f 2
FDC6U506
506
RLC
1 1 T * 1 nu 1
03F6
CB07
507
RLC
03F8
CBOO
508
RLC
03FA
CBOl
509
RLC
03FC
CB02
510
RLC
03FE
CB03
511
RLC
0400
CB04
512
RLC
H
0402
CB05
513
RLC
*-
0404
07
514
RLCA
0405
ED6F
515
RLD
0407
CBIE
516
RR
IHL I
0409
ODCBOSlt
517
( I X+ INO )
040D
FDCBU51t
5 18
RR
111*1 nui
0411
CBIF
519
*
0413
CB 16
520
DO
RR
0415
CB19
521
C
0417
CBIA
522
RR
0419
CBIB
523
E
041B
CBIC
524
DD
RR
0410
CBIO
525
RR
041F
IF
525
RRA
0420
Cboe
527
RRC
( HL 1
0422
0DCB050E
528
RRC
1 IX4-IND)
0426
FDCB050E
529
II Y+IND)
042A
CBOF
530
Dor
*
042C
CB08
531
RRC
042E
CB09
532
RRC
C
0430
CBOA
533
0432
CBOB
534
aor
0434
CBOC
Dor
0436
CBOD
BRf
0438
RHf A
0439
ED6 7
DBn
04 3 B
C7
tin
OCT
043C
07
OCT
0430
OF
541
R^T
in
04 3 E
E7
542
RST
f «H
043F
EF
544
RST
30H
0441
FF
545
RST
38H
0442
CF
546
RST
0443
9E
547
SBC
A.(HL)
0444
DD9E05
548
SBC
A.IIXi^INOi
0447
Fl)9E05
549
SBC
A,( lY^INOI
044A
9F
550
SBC
At A
044B
98
551
SBC
A,B
04 4C
99
552
SBC
A,C
287
APPENDIX C
INSTRUCTION SET NUMERICAL ORDER
LOC
OBJ CODE
STMT
SOURCE STATEMENT
LOC
OBJ CODE
STMT
SOURCE STATgMENT
0000
00
NOP
0063
45
70
LO B.L
0001
018405
LO BC.NN
0064
46
71
LO B.(HL)
0004
02
LO (BC).A
0065
47
72
LO B.A
0005
03
4
INC BC
0066
48
73
LD C.B
0006
04
INC B
0067
49
74
LO C.C
0007
05
DEC B
0068
4A
75
LO CD
0008
0620
LO B,N
0069
4B
76
LO C.E
OOOA
07
8
RLCA
006A
4C
77
LO C.H
oooa
08
EX AFfAF*
006B
40
78
LO C.L
oooc
09
10
AOO HLfBC
006C
4E
79
LD C.IHL)
0000
OA
11
LO A.IBC)
0060
4F
80
LD C.A
UOOE
OB
12
DEC BC
006E
50
81
LO O.B
OOOF
OC
13
INC C
006F
51
82
LO D.C
0010
00
14
DEC C
0070
52
S3
LD 0.0
0011
0E20
15
LO C.N
0071
53
84
LO O.E
0013
OF
16
RRCA
0072
54
85
LO D.H
0014
102 E
17
OJNZ DIS
0073
55
86
LD D.L
0016
118405
18
LO OE.NN
0074
56
87
LD O.(HL)
0019
12
19
LO (OEI.A
0075
57
88
LO O.A
OOIA
13
20
INC OE
0076
58
89
LD E.a
0018
14
21
INC
0077
59
90
LO E.C
OOlC
15
22
DEC
0078
5A
91
LO E.O
0010
1620
23
LO O.N
0079
SB
92
LO E.E
00 IF
17
24
RLA
007A
5C
93
LO E.H
0020
182E
25
JR OIS
007B
50
94
LO E.L
0022
19
26
AOD HL.OE
007C
SE
95
LO E.lHLt
0023
lA
27
LO A.(OE)
0070
5F
96
LO E.A
0024
IB
28
DEC DE
007E
60
97
LO H.B
0025
IC
29
INC E
007F
61
98
LO H.C
0026
10
30
DEC E
0080
62
99
LD H.D
0027
1E20
31
LO E.N
0081
63
100
LO H.E
0029
IF
32
RRA
0082
64
101
LO H.H
002A
202E
33
JR NZ.DIS
0083
65
102
LO H.L
002C
218405
34
LO HL.NN
0084
66
103
LD H.IHLi
002 F
228405
35
LO INNI.HL
0085
67
104
LO H.A
0032
23
36
INC HL
0086
68
105
LD L.B
0033
24
37
INC H
0087
69
106
LO L.C
0034
25
38
OEC H
0088
6A
107
LO L.O
0035
262 U
39
LO H.N
0089
6B
108
LD L.E
0037
27
40
DAA
008A
6C
109
LD L.H
0038
282E
41
JR Z.OIS
008B
60
110
LO L.L
003A
29
42
AOO HL.HL
OOSC
6E
111
LO LtiHLI
003B
2A8405
43
LO HL.INNl
0080
6F
112
LO L.A
003E
2B
44
DEC HL
008E
70
113
LO (HL).B
003F
2C
45
INC L
008F
71
114
LD (HLI.C
U040
20
46
OEC L
0090
72
115
LO (HL).O
0041
2E20
47
LO L.N
0091
73
116
LO (HLt.E
0043
2F
48
CPL
0092
74
117
LO (HL)iH
0044
302 E
49
JR NC.OIS
0093
75
118
LO (HL).L
0046
318405
50
LO SP.NN
0094
76
119
HALT
0049
328405
51
LO (NNi.A
0095
77
120
LD IHD.A
004C
33
52
INC SP
0096
78
121
LO A.B
0040
34
53
INC (HL)
009 7
79
122
LO AtC
004E
35
54
OEC (HLt
0098
7 A
123
LO A.O
004F
3620
55
L0>' (HD.N
0099
7B
124
LO A.E
0051
37
56
SCF
009A
7C
125
LD A.H
0052
3e2E
57
JR C.OIS
009B
70
126
LD A.L
0054
39
58
AOD HL.SP
009C
7E
127
LO A.(HL)
0055
3A840S
59
LO A. INN)
0090
7F
128
LD A.A
U05S
3B
60
OEC SP
009E
80
129
AOO A.B
0059
3C
61
INC A
009F
81
130
AOD AtC
OOSA
30
62
OEC A
OOAO
82
131
ADO A.O
00 SB
3E20
63
LO A.N
OOAl
83
132
AOO A.E
0050
3F
64
CCF
00A2
84
133
AOO A.H
005E
40
65
LO B.B
00A3
65
134
ADD A.L
OOSF
41
66
LO B.C
00A4
86
135
AOD A.IHLi
0060
42
67
LD B.D
OOAS
87
136
AOO A.A
0061
43
68
LO B.E
00A6
88
137
ADC A.B
0062
44
69
LO B.H.NN
00A7
S9
138
AOC A.C
290
Z-80 CROSS ASSEMBLER VERSION 1.06 OF 06/18/76
07/09/76 I0!2<i:*7 OPCODE LISTING
057F AB
0580 AC
0581 AO
0582 ££20
0584
691
XOR
692
XOR
693
XOR
694
XOR
695
NN
DEFS
696
I NO
Ego
697
EUU
lOH
698
EOU
20H
699
OIS
EQU
30H
700
END
289
1 nr
LOC
STMT
SOURCE STATEMENT
LOC
OBJ COOk
STMT
SOURCE STATEMENT
0178
CB18
277
RR B
0202
CB65
346
BIT
4.L
017A
CB19
278
RR C
0204
CB66
347
BIT
4. (HLi
017C
CBIA
279
RR
0206
C867
348
BIT
4. A
017E
CBIB
280
RR
0208
CB68
349
BIT
5.B
0180
CBIC
281
RR H
020A
CB69
350
dIT
5.C
0182
CBIO
282
RR 1
02 OC
CB6A
351
BIT
5,0
0184
CBIE
283
RR
HL)
020E
Ca6B
352
BIT
5.E
0186
CBIF
284
RR /
0210
CB6C
353
BIT
5.H
0188
CB20
285
SLA
0212
CB60
354
BIT
5.L
018A
C621
286
SLA
0214
CB6E
355
BIT
5. (ML)
018C
CB22
287
SLA
0216
CB6F
356
BIT
5. A
018E
CB23
288
SLA
E
0218
CB70
357
BIT
6iB
0190
CB24
289
SLA
H
02 lA
CBTl
358
BIT
6iC
0192
CB25
290
SLA
02 IC
CB72
359
BIT
6.0
0194
CB26
291
SLA
IHL)
02 IE
Ca73
360
BIT
6.E
0196
CB27
292
SLA
0220
CB74
361
BIT
6.H
0198
CB2S
293
SRA
0222
CB75
362
BIT
6.L
019A
CB29
294
SRA
0224
CB76
363
BIT
6. (HLI
019C
CB2A
295
SRA
0226
CB77
364
BIT
6. A
019E
C82B
296
SRA
0228
CB78
365
BIT
7.B
OlAO
CB2C
297
SRA
022A
CB79
366
BIT
7.C
01A2
CB2D
298
SRA
022C
CB7A
367
BIT
7.0
01A4
CB2E
299
SRA
(HL)
022E
CB7B
368
BIT
7.E
01A6
CB2F
300
SRA
A
0230
CB7C
369
BIT
7.H
OlAS
CB36
301
SRL
0232
CB7D
370
BIT
7.L
OlAA
CB39
302
SRL
0234
CB7E
371
BIT
7.(HL)
OlAC
CB3A
303
SRL
0236
CB7F
372
BIT
7. A
OlAE
CB3B
304
SRL
0238
CBSO
373
RES
O.B
01 BO
CB3C
305
SRL
023A
CB81
374
RES
O.C
6lB2
CB3D
306
SRL
023C
CB82
375
RES
0.0
0184
CB3E
307
SRL
(HLi
023E
CB83
376
RES
O.E
0186
CB3F
308
SRL
0240
CB84
377
RES
O.H
01B8
CB40
309
BIT
O.B
0242
CB85
378
RES
O.L
OIBA
CB41
310
BIT
OtC
0244
CB86
379
RES
0. (HLi
OIBC
CB42
3U
BIT
OtO
0246
CB87
380
RES
O.A
OIBE
CB43
312
BIT
OiE
0248
CB88
381
RES
l.B
OICO
CB44
313
BIT
O.H
024A
CB89
382
RES
l.C
01C2
CB45
314
BIT
OtL
024C
CB8A
383
RES
1.0
01C4
CB46
315
BIT
OflHL)
024E
CB8B
384
RES
I.E
01C6
C847
316
BIT
OtA
0250
CB8C
385
RES
l.H
01C8
CB4B
317
BIT
i.e
0252
CBttD
386
RES
l.L
OICA
CB49
318
BIT
l.C
0254
CB8E
387
RES
1 . ( HL )
OICC
CB4A
319
BIT
liO
0256
CB8F
388
RES
l.A
OICE
CB4B
320
BIT
I.E
0258
CB90
389
RES
2.B
0100
CB4C
321
BIT
ItH
025A
CB91
390
RES
2.0
0102
CB4U
322
BIT
ItL
025C
CB92
391
RES
2.0
0104
CB4E
323
BIT
I.IHLI
025E
CB93
392
0106
C84F
324
BIT
ItA
0260
CB94
393
oe«
»'u
0108
CBSO
325
BIT
2.B
0262
CB9S
394
RES
» 1
OlOA
CB51
326
BIT
2.C
0264
CB96
395
RES
2)1 HLI
OlDC
CB52
327
BIT
2.0
0266
CB97
396
RES
2. A
OlOE
CBS3
328
BIT
2.E
0268
CB98
397
RES
3.8
01 EO
CB54
329
BIT
2.H
026A
CB99
398
RES
3.0
01E2
cess
330
BIT
2.L
026C
CB9A
399
RES
3.0
01E4
CB56
331
BIT
2. (HLI
026E
CB9B
400
RES
3.E
01E6
CB57
332
BIT
2. A
0270
CB9C
401
RES
01E8
CBS8
333
BIT
3.B
0272
CB90
402
s'l
OlEA
CBS9
334
BIT
3.C
0274
CB9E
403
RES
3ff(HL)
OlEC
CBSA
335
BIT
3.0
0276
CB9F
404
OlEE
CB5B
336
BIT
3iE
0278
CBAO
405
RES
4tB
OlFO
case
337
BIT
3.H
027A
CBAl
406
RES
4.0
01F2
CBSO
338
BIT
3tL
02 7C
CBA2
407
RES
4.0
01 F4
CSSE
339
BIT
3. (HL)
02 7E
CBA3
408
RES
4.E
01F6
cesF
340
BIT
3.A
0280
CBA4
409
RES
4.H
01F8
CB60
341
BIT
4.B
0282
CBAS
410
RES
4.L
01 FA
CB61
342
BIT
4.C
0284
CBA6
411
RES
4. (HLI
OlFC
CB62
343
BIT
4.D
0286
CBA7
412
RES
4.A
OlFE
CB63
344
BIT
4.E
0288
CBAB
413
RES
5,B
0200
0664
345
BIT
4,H
02eA
CBA9
414
RES
S.C
292
LOC
OBJ CODE
STMT
SOURCE STATEMENT
LOC
OBJ CODE
STMT
00 AS
8A
139
AOC AtO
OOFB
00
208
00A9
8B
140
ADC AffE
OOFC
POP DE
OOAA
BC
141
ADC AfH
n?nn
111
JP NCtNN
OOAB
80
142
AOC AtL
0320
OUT N»A
OOAC
8E
143
AOC Af 1 HL 1
D484 05
712
CALL NC t NN
OOAQ
SF
144
AOC ArA
0105
5^
PUSH OE
OOAE
90
145
SUB B
0106
0620
D^T I'nu
OOAF
91
146
SUB C
01 08
07
lis
OOBO
92
147
SUB
0109
08
OOBl
93
148
SUB E
OlOA
09
00B2
94
149
SUB H
01 OB
0A8405
218
ID r uu
00B3
95
150
sue L
lOE
0B20
IM AW
j! A. r '/•
00B4
96
151
SUB (HLJ
01 10
DC 8405
CALL CffNN
00B5
97
152
SUB A
0113
DE20
221
OCT ?ou
00B6
98
153
SBC AtB
0115
OF
W\
00B7
99
154
SBC AtC
0116
EO
ncT on
00B8
9A
155
SBC A>0
0117
El
?P%
POP HL
00B9
9B
156
SBC AtE
01 18
E 28405
OOBA
9C
157
SBC AfH
3 3A
jIt
pv f CP 1 . Ul
OOBB
90
158
SBC AfL
ni ir
E48405
r Al 1 pn. isjM
OOBC
9E
159
SBC At(HL)
OllF
£5
AMn*^*!^*^
OOBO
9F
160
SBC AfA
120
E620
229
OOBE
AO
161
AND B
0122
DCT »nu
OOBF
Al
162
AND C
0123
E6
231
OCT PC
OOCO
A2
163
AND
0124
E9 .
232
JP I HL 1
OOCl
A3
164
AND E
0125
E A8405
233
c» nc'ui*
00C2
A4
165
AND H
0128
^.1 P oe ....
00C3
A5
166
AND L
0129
EC 8405
235
CALL PEtNN
OOC*
A6
167
AND (HLl
012C
EE20
00C5
A7
168
AND A
012E
£F
237
RST 28H
00C6
A8
169
XOR B
012F
FO
238
RET P
00C7
A9
170
XOR C
0130
F 1
239
POP AF
O0C8
AA
171
XOR D
JP PtNN
00C9
AB
172
XOR E
0134
F3
241
01
OOCA
AC
173
XOR H
0135
F48405
242
CALL PffNN
OOCB
AU
174
XOR L
0138
F5
243
PUSH AF
OOCC
AE
175
XOR (HL)
0139
F62
244
OOCU
AF
176
XOR A
013B
F 7
245
RST 30H
OOCE
BO
177
OR B
2}f ^
?n^^p HI
OOCF
Bl
178
OR C
0130
Ji7
OOUO
B2
179
OR
FA8405
248
IP M NN
JP HfNN
0001
83
180
OR E
0141
249
f }
U0D2
B4
181
OR H
0142
FC8405
250
CALL MfNN
0003
B5
182
OR L
0145
FE20
251
CP N
0004
86
183
OR ( HL )
0147
OOOS
87
184
OR A
0148
' CBOO
253
RLC B
0006
B6
185
CP 8
014A
CBOl
254
RLC C
0007
B9
186
CP C
014C
CB02
255
RLC
0008
8A
187
CP D
014E
CB03
256
?|-^ f
0009
BB
188
CP E
01 50
CB04
257
RLC H
OODA
BC
189
CP H
0152
CB05
OOOB
BO
190
CP L
0154
CB06
259
RLC iHLi
OODC
BE
191
CP ( HL I
0156
CB07
260
OOOD
BF
192
CP A
01 58
CB08
Bor B
OOOE
CO
193
RET NZ
JA^
opr r
OOOF
Ci
194
POP BC
015C
jaI
KHr n
OOEO
C28405
195
JP NZfNN
OlSE
CBOB
ppr c
00E3
C38405
196
JP NN
0160
CBOC
J s
Dpr u
00E6
C48405
19 7
ni^i
5AA
5a5
RRC L
Q0E9
C5
198
rnnp
opr fui \
OOEA
C620
199
ADD AtN
ni
r Bnc
268
OOEC
C7
200
ni fc«
TBI n
JAQ
OOED
C8
201
RET Z
016A
CBll
270
RL C
202
RET
016C
CB12
271
RL D
OOEF
CA8405
203
JP Z.NN
016E
CB13
272
RL E
00F2
CC8405
204
CALL Z.NN
0170
CB14
273
RL H
OOFS
C08405
205
CALL NN
0172
CB15
274
RL L
00F8
CE20
206
ADC A,N
0174
CB16
275
RL (HL)
OOFA
CF
207
RST 8
0176
CB17
276
RL A
291
042 8
042C
062 E
0630
0632
0634
0436
0436
043A
043 E
0440
0442
0444
0446
044A
044C
044 E
0450
0452
0454
0458
045A
045C
0456
0460
0462
0464
0666
0668
066A
066C
0670
0672
0674
0476
047A
047C
047E
0480
0482
0484
0486
0488
048A
048C
048 E
0490
0492
0DCB0576
DDCB0S7E
OOCB0586
DOC BOS 8 E
00CB0596
0DCB0S9E
DDCB0SA6
OOCBOSAE
00CB0SB6
00CB05BE
0DCB09C6
0OCB05CE
00CB0506
OOCBOSOE
OOC805E6
OOCBOSEE
0DCB05F6
OOCBOSFE
ED60
ED41
ED62
ED6384a5
E044
E045
E046
E047
E068
E049
E06A
E06B8405
E040
ED50
E051
EDS2
E0S38405
E056
E0S7
EDS8
E059
ED5A
EOS 88405
E05E
E060
E061
ED62
ED67
E068
ED69
E06A
E06F
E072
E0738405
E078
E079
ED7A
ED 7B 8405
EDAO
EOAl
EDA2
EDA3
EDA8
E0A9
EOAA
EDAB
EDBO
EOBl
E0a2
EDB3
E088
553
556
555
556
557
558
559
560
561
S62
563
566
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
S90
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
IN Dt(C)
OUT lO.D
sac HLfOE
LO (NNt,DE
IM 1
LD All
IN EtCCI
OUT IC),E
AOC HL.OE
LO OE.INNI
IM 2
IN HtICi
OUT tC)>H
sec HL.HL
RRD
IN Lt(C)
OUT (C).L
AOC HL.HL
RLO
SBC HLtSP
LO (NN),SP
IN A.(C)
OUT ICt,A
AOC HL.SP
LD SPt(NN)
LDI
CPI
INI
OUTI
LOO
CPO
IND
OUTD
LOIR
CPIR
INIR
OTIR
LDDR
LOC
OBJ CODE
STMT
0494
E0B9
622
0496
EDBA
623
0498
EDBB
624
049A
F009
625
049C
FD19
626
049E
F 02 18405
627
04A2
F0228405
628
04A6
FD23
629
04AB
F029
630
04AA
FD2A8405
631
04AE
F02B
632
0480
FD3405
633
0483
FD3505
634
04B6
FD3 60520
635
04 B A
F039
636
04BC
F04605
637
04BF
FD4E05
638
04C2
FD5605
639
04CS
FOSE 05
640
04C8
FD6605
641
04CB
FD6E05
642
04CE
FDT005
643
04D1
F07105
644
0404
F07205
645
04D7
F07305
646
040A
FD7405
647
0400
F07505
648
04E0
F07705
649
04E3
F07E05
650
04E6
FDa60S
651
04fc9
F08E05
652
04EC
F 096 05
653
04EF
FD9E05
654
04 F2
FDA605
655
04F5
F0AE05
656
04F8
FDB605
657
04Fa
F0BE05
658
04FE
FDEl
659
0500
F0E3
660
0502
FOES
661
0504
FDE9
662
0506
F0F9
663
0508
FDCB0506
664
050C
FOCB050E
665
0510
F0CB0516
666
0514
F0C8051E
667
0518
FOCB0526
668
05 10
F0CB052E
669
0520
FaCB0S3E
670
0524
F0CB0546
671
0S2e
FDCB054E
672
052C
FOCB0556
673
0530
FOCB05SE
t}t
0534
FOCB0566
675
0538
F0CB056E
676
053C
F0CB0576
677
0540
F0CB057E
678
0544
FOCB0586
679
0548
FOCB058E
680
054C
FDCB0596
681
0550
FDCB059E
682
0554
FOCB05A6
0558
FDCB05AE
684
055C
FDCB05B6
685
0560
FDCBOSBE
686
0564
FDCB0SC6
687
0568
FDCBOSCE
688
056C
FDCB0SD6
689
0570
FDCB050E
690
CPOR
I NOR
OTDR
ADD lY.BC
ADO iY«oe
LO lY.NN
LO (NN),IY
INC lY
ADD lYtlY
LO IY,<NN)
DEC lY
INC dY-^INDI
DEC
: (lYI^INO)
LO (lY+INOl.N
ADO lY.SP
LO B.(iy«^INO)
LO C,dy«INOI
LO 0.(IY«INOI
LO EtdYtlNO)
LO H.dY + INO>
LO L.dYVINOI
LD (lYtlNbt.B
LO (IY4lNbJ,C
LD dYflNbi.O
LO dY«INpt,E
LD (lY+INDItH
LD dY4-INpt,L
LO dY«'INp),A
LO A.dY + INO)
ADO A.ilYjflND)
ADC A,dY»INOI
SUB dY+INOl
SBC A.CIY^tNO)
AND ( IY»l|«Oi
XOR CIY+INOl
OR (lY^INb)
CP (IY*INOi
POP IV
EX iSPt.IY
PUSH lY
JP (lYI
LO SP.IY
RLC IIY+INO)
RRC dV+iNO)
RL (lY+INp)
RR dY+INp)
SLA (IY4-IN0i
SRA (lYl-lNO)
SRL IIY+llHD)
BIT O.dYl-INDI
BIT ItdYflND)
BIT Z.dYflNDi
BIT 3,(IY*IN0»
BIT 4.dY4^IND)
BIT S.dY+INO)
BIT 6.(tYllNDi
BIT T.dY+INOi
RES O.dYtINO)
RES l.dYtIND)
RES 2«dY|IND)
RES 3.dV|lND)
RES 4,IIY^IN0)
RES S.dY^-INO)
RES 6.IIYVlNDt
RES T.dYflNOi
SET a,dY4IN0l
SET l.dYtlND)
SET 2tdY4INDi
SET 3,dY«IND)
294
028G
CbAA
415
RES
5.0
028E
CBA8
416
RES
5,E
0290
CBAC
417
RES
5,H
0292
CBAO
418
RES
5,L
0294
CBAE
419
RES
5,(HL)
02 96
CBAF
420
RES
5, A
0298
CB80
421
RES
6iB
029A
CBBl
422
RES
6,C
029C
CBB2
423
RES
6,0
029E
CB83
424
RES
6.E
O2A0
CBB4
425
RES
6tH
02A2
CBB5
426
RES
6.L
02A4
CBB6
427
RES
6«(HLI
02A6
CBB7
428
RES
6, A
02A8
C&B8
429
RES
7,B
02AA
CB89
430
RES
7,C
02AC
CB8A
431
RES
7,0
02 AE
CBBB
432
RES
7,E
0280
C8BC
433
RES
7,H
0282
CB8D
434
RES
7,L
028*
C88E
435
RES
7,(HLI
0286
CB8F
436
RES
7, A
0288
CBCO
437
SET
O.B
028A
CBCl
438
SET
O.C
02BC
CBC2
439
SET
0,0
02BE
CBC3
440
SET
O.E
02G0
CBC4
441
SET
0,H
02C2
CBC5
442
SET
0,L
02C*
CBC6
443
SET
0,(HLJ
02C6
CBC7
444
SET
0,A
02C8
CBC8
445
SET
1,B
02CA
CBC9
446
SET
1,C
02CC
CBCA
447
SET
1,0
02Ce
CBCB
448
SET
l.E
02 DO
CBCC
449
SET
l,H
0202
CBCD
450
SET
1,L
0204
CBCE
451
SET
1,(HL)
0206
CBCF
452
SET
1,A
02DB
CBOD
453
SET
2,8
020A
CBUl
454
SET
2,C
U2DC
CBD2
455
SET
2,0
02DE
CB03
456
SET
2.E
02E0
CBU4
457
SET
2,H
02E2
CBD5
458
SET
2,L
02E4
CBt)6
459
SET
2,(HL)
02E6
CBD7
460
SET
2, A
02E8
CBD8
461
SET
3 8
02tA
CBD9
462
SET
3,C
02EC
CBOA
463
SET
3,0
02EE
CBDB
464
SET
3,E
O2F0
CBOC
465
SET
3,H
02F2
CBOO
466
SET
3,L
02F4
CBDE
467
SET
3,(HL)
02F6
CBOF
468
SET
3, A
02F8
CBEO
469
SET
4,8
02FA
CBEl
470
SET
4,C
02FC
CBE2
471
SET
4,0
02FE
C8E3
472
SET
4,E
0300
C8E4
473
SET
4,H
0302
CBES
474
SET
4,L
U304
CBE6
475
SET
4, (HL)
0306
CBE7
476
SET
4, A
0308
C8E8
477
SET
5,B
030A
CBE9
478
SET
5,C
030C
CBEA
479
SET
5,0
030E
CBEB
480
SET
5.E
U310
CBEC
481
SET
5,H
0312
CBEO
482
SET
5,L
0314
CBEE
483
SET
5,(HLI
0316
CBEF
484
SET 5, A
0318
CBFO
485
SET 6,B
03 I A
CBFl
486
SET 6,C
031C
CBF2
487
SET 6,0
031E
CBF3
488
SET 6,E
0320
CBF4
489
SET 6,H
0322
CBF5
490
SET 6,L
0324
CBF6
491
SET 6,(HL)
0326
CBF7
492
SET 6, A
0328
CBF8
493
SET 7,B
032A
CBF9
494
SET 7,C
032C
CBFA
495
SET 7,0
032E
CBFB
496
SET 7,E
0330
CBFC
497
SET 7,H
0332
CBFO
498
SET 7,L
0334
CBFE
499
SET 7,(HL)
0336
CBFF
500
SET 7, A
0338
U009
501
ADO IX,BC
033A
0019
502
ADO IX, OE
033C
00218405
503
LO IX,NN
0340
DD228405
504
LO INNI,IX
0344
0023
505
INC IX
0346
0029
506
ADD IX, IX
0348
0D2A8405
507
LO IX, INN)
034C
0028
508
DEC IX
034E
0D3405
509
0351
003505
510
DEC IIX+INO>
0354
00360520
511
LO ( I Xi-I NO) ,N
0358
DD39
512
ADO IX, SP
035A
0D4605
513
LO BtllX-t-INO)
0350
0D4E05
514
LD C, ( IX+INO)
0360
005605
515
LD 0, 1 IX+INO)
0363
005E05
516
LO E, (IX+INO)
0366
006605
517
LO H,( IX+INO)
0369
DO6E05
518
LO L, ( IX + INO)
036C
007005
519
LD (IX+INO), B
036F
DD7105
520
LD (IX+INO). G
0372
007205
521
LD (IX+INO),
0375
007305
522
LO ( IX+IND) ,E
0378
007405
523
LO ( IX+INO), H
037B
007505
524
LO (IX+INO), L
037E
007705
525
LO IIX+INO),A
0381
0D7E05
526
LD A, ( IX+IND)
0384
DD8605
527
ADD A, (IX+INO)
0387
D08E05
528
ADC A, (IX+INO)
03 8 A
009605
529
0380
009E05
530
SBC A, (IX+INO)
0390
0DA605
531
0393
0DAE05
532
XOR (IX+INO)
0396
00B605
533
OR ( IX+I NO)
0399
00BE05
534
CP ( IX+INO)
039G
ODE 1
535
POP IX
039E
0DE3
536
EX ( SPI , t X
03A0
D0E5
537
PUSH IX
03A2
0DE9
538
JP ( IXI
03 A4
0DF9
539
LD SP, IX
03 A6
D0C80506
540
RLC (IX+INO)
03AA
ODC8050E
541
RRC (IX+INO)
03AE
0DCB0516
542
RL ( IX+INO)
03 82
0DCB051E
543
RR ( IX + IND)
03B6
0OCB0526
544
SLA (IX + 1 NO )
03BA
00CB052E
545
SRA ( IX + INO)
03BE
00CB053E
546
SRL (IX+IND)
03C2
ODCB0546
547
BIT 0, (IX+IND)
03C6
DDCB054E
548
BIT 1, (IX+IND)
03CA
0DCe0556
549
BIT 2, (IX+INO)
03CE
00CB055E
550
BIT 3, ( IX+INO)
0302
0DCB0566
551
BIT 4, (IX+INO)
0306
D0CB056E
552
BIT 5, (IX+IND)
293
ACCUMULATOR
HEXADECIMAL COLUMNS™
1 6S.53e
2 131,072
3 I96,<0a
2 2,097,1S
4,1M,304
5 5,242.Ma
6 6.291.4S6
7,340,032
8,388,608
9 9,437,184
« 10,485,760
B 11,534,336
C 12,582,912
O 13,631,488
14,680,0*4
15,728,640
4 262,14
5 327,680
6 393.216
7 468,762
8 524,288
g 589,824
A 665,360
B 720,896
C 786.432
D 851.968
E 917.504
F 983.040
4567
4,096
8,192
3 12,288
■ 16,384
5 20,480
6 24,576
7 28,672
8 32,768
9 36,864
A 40,960
B 45,056
C «9,1S2
D 53,248
E 57,344
HEX-DEC HEX- DEC
0123
2 612
3 768
1.024
5 1.280
6 1.536
7 1,792
8 2.048
9 2.304
A 2.500
2.816
C 3.072
D 3.328
E 3«>4
f 3.840
4567
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0C2
DC3
DC4
NAK
SYN
ETB
CAN
26S
512
1024
2 04S
4 096
a 192
16 384
32 768
65 536
131 072
262144
524 288
1048 576
2 097152
4194 304
8 388 608
16 777 216
232.188
2»-16«
2". 16"
244 . ,jll
2" - 16"
2« - 16"
2» - 16"
2" - 16«
POWERS OF 16
16
256
4096
66 536
1048S76
18 777 216
2664354B6
4294 967 296
68 71*476 736
1099 511627 776
17 592 186 044 416
261 474 976 710 666
4 503 599 627 370 496
72 057 594 037 927 936
152 921 504 608 846 976
296
LOC
OBJ CODE
STMT
SOURCE STATEMENT
0574
FDCB05E6
691
F0CB05EE
692
SET SidY+IND)
057C
F0CB05F6
693
05B0
FOCB05FE
694
SET TilIYtIND)
0584
695
NN
OEFS 2
696
IND
EQU 5
697
EQU lOH
698
EQU 20H
699
OIS
EQU 30H
700
END
295