-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz80.axx
276 lines (233 loc) · 6.49 KB
/
z80.axx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/*
/* z80.axx z80 patternfile
/*
DEC IY :: 0xfd,0x2b
DEC IX :: 0xdd,0x2b
INC IY :: 0xfd,0x23
INC IX :: 0xdd,0x23
.setsym ::BC:: 0
.setsym ::DE::0x10
.setsym ::HL::0x20
.setsym ::SP:: 0x30
INC r :: 0x03|r
DEC r :: 0xb|r
.setsym ::B ::0
.setsym ::C ::1
.setsym ::D ::2
.setsym ::E ::3
.setsym ::H ::4
.setsym ::L ::5
.setsym ::A ::7
INC x :: 0x04|x<<3
DEC x :: 0x15|x<<3
INC (HL) :: 0x34
DEC (HL) :: 0x35
DEC (IY[[+!d]]) :: 0xfd,0x35,d
INC (IY[[+!d]]) :: 0xfd,0x34,d
DEC (IX[[+!d]]) :: 0xdd,0x35,d
INC (IX[[+!d]]) :: 0xdd,0x34,d
.setsym ::BC:: 0
.setsym ::DE:: 1
.setsym ::HL:: 2
.setsym ::SP:: 3
.setsym ::AF:: 3
ADD HL,s :: s<<4|0x09
ADC HL,s :: 0xed,s<<4|0x4a
SBC HL,s :: 0xed,s<<4|0x42
ADD IX,s :: 0xdd,0x09|s<<4
ADD IY,s :: 0xfd,0x09|s<<4
INC s :: s<<4|0x03
DEC s :: s<<4|0x0b
LD (IY[[+!d]]),s :: 0xfd,s|0x70,d
LD (IX[[+!d]]),s :: 0xdd,s|0x70,d
LD s,(IX[[+!d]]) :: 0xdd,0x46|(s<<3),d
LD s,(IY[[+!d]]) :: 0xfd,0x46|(s<<3),d
LD (HL),s :: s|0x70
LD s,(HL) :: (s<<3)|0x46
LD (HL),!d :: 0x36,d
LD (IY[[+!e]]),!d :: 0xfd,0x36,e,d
LD (IX[[+!e]]),!d :: 0xdd,0x36,e,d
LD A,(BC) :: 0xa
LD A,(DE) :: 0x1A
LD (BC),A :: 0x02
LD (DE),A :: 0x12
LD A,(!n) :: 0x3a,n&0xff,n>>8
LD (!n),A :: 0x32,n&0xff,n>>8
LD HL,(!d) :: 0x2a,d&0xff,d>>8
LD IX,(!d) :: 0xdd,0x2a,d&0xff,d>>8
LD IY,(!d) :: 0xfd,0x2a,d&0xff,d>>8
LD (!d),HL :: 0x22,d&0xff,d>>8
LD (!d),IX :: 0xdd,0x22,d&0xff,d>>8
LD (!d),IY :: 0xfd,0x22,d&0xff,d>>8
LD SP,HL :: 0xf9
LD SP,IX :: 0xdd,0xf9
LD SP,IY :: 0xfd,0xf9
LD A,I :: 0xed,0x57
LD A,R :: 0xed,0x5f
LD I,A :: 0xed,0x47
LD R,A :: 0xed,0x4f
LD IX,!d :: 0xdd,0x21,d&0xff,d>>8
LD IY,!d :: 0xfd,0x21,d&0xff,d>>8
LD HL,!d :: 0x21,d&0xff,d>>8
LD DE,!d :: 0x11,d&0xff,d>>8
LD BC,!d :: 0x01,d&0xff,d>>8
LD SP,!d :: 0x31,d&0xff,d>>8
LD HL,!d :: 0x21,d&0xff,d>>8
LD s,t :: 0x40|(s<<3)|t
LD s,!d :: (s<<3)|0x6,d
PUSH s :: 0xc5|(s<<4)
PUSH IX :: 0xdd,0xe5
PUSH IY :: 0xfd,0xe5
POP s :: 0xc1|(s<<4)
POP IX :: 0xdd,0xe1
POP IY :: 0xfd,0xe1
ADD A,(HL) :: 0x86
ADD A,(IX[[+!d]]) :: 0xdd,0x86,d
ADD A,(IY[[+!d]]) :: 0xfd,0x86,d
ADD A,s :: 0x80|s
ADD A,!d :: 0xc6,d
ADC A,(HL) :: 0x8e
ADC A,(IX[[+!d]]) :: 0xdd,0x8e,d
ADC A,(IY[[+!d]]) :: 0xfd,0x8e,d
ADC A,s :: 0x88|s
ADC A,!d :: 0xce,d
SUB A,(HL) :: 0x96
SUB A,(IX[[+!n]]) :: 0xdd,0x96,n
SUB A,(IY[[+!n]]) :: 0xfd,0x96,n
SUB A,s :: 0x90|s
SUB A,!d :: 0xd6,d
SBC A,(HL) :: 0x9e
SBC A,(IX[[+!n]]) :: 0xdd,0x9e,n
SBC A,(IY[[+!n]]) :: 0xfd,0x9e,n
SBC A,s :: 0x98|s
SBC A,!d :: 0xde,d
AND A,(HL) :: 0xa6
AND A,(IX[[+!n]]) :: 0xdd,0xa6,n
AND A,(IY[[+!n]]) :: 0xfd,0xa6,n
AND A,s :: 0x10|s
AND A,!d :: 0xe6|d
OR A,(HL) :: 0xb6
OR A,(IX[[+!n]]) :: 0xdd,0xb6,n
OR A,(IY[[+!n]]) :: 0xfd,0xb6,n
OR A,s :: 0xb0|s
OR A,!d :: 0xf6,d
XOR A,(HL) :: 0xae
XOR A,(IX[[+!n]]) :: 0xdd,0xae,n
XOR A,(IY[[+!n]]) :: 0xfd,0xae,n
XOR A,s :: 0x18|s
XOR A,!d :: 0xee,d
CP A,(HL) :: 0xbe
CP A,(IX[[+!n]]) :: 0xdd,0xbe,n
CP A,(IY[[+!n]]) :: 0xfd,0xbe,n
CP A,s :: 0xb8|s
CP A,!d :: 0xfe,d
BIT !x,s :: 0xcb,0x40|x<<3|s
BIT !x,(HL) :: 0xcb,0x46|x<<3
BIT !x,(IX[[+!d]]) :: 0xdd,0xcb,d,0x46|x<<3
BIT !x,(IY[[+!d]]) :: 0xfd,0xcb,d,0x46|x<<3
SET !x,s :: 0xcb,0xc0|x<<3|s
SET !x,(HL) :: 0xcb,0xc6|x<<3
SET !x,(IX[[+!d]]) :: 0xdd,0xcb,d,0xc6|x<<3
SET !x,(IY[[+!d]]) :: 0xfd,0xcb,d,0xc6|x<<3
RES !x,s :: 0xcb,0x80|x<<3|s
RES !x,(HL) :: 0xcb,0x86|x<<3
RES !x,(IX[[+!d]]) :: 0xdd,0xcb,d,0x86|x<<3
RES !x,(IY[[+!d]]) :: 0xfd,0xcb,d,0x86|x<<3
RLCA :: 0x07
RLA :: 0x17
RRCA :: 0x0f
RRA :: 0x1f
RLC (HL) :: 0xcb,0x06
RLC (IX[[+!d]]) :: 0xdd,0xcb,d,0x06
RLC (IY[[+!d]]) :: 0xfd,0xcb,0x00,0x06
RLC s :: 0xcb,s
RL (HL) :: 0xcb,0x10
RL (IX[[+!d]]) :: 0xdd,0xcb,d,0x10
RL (IY[[+!d]]) :: 0xfd,0xcb,d,0x10
RL s :: 0xcb,0x10|s
RRC (HL) :: 0xcb,0xe
RRC (IX[[+!d]]) :: 0xdd,0xcb,d,0x0e
RRC (IY[[+!d]]) :: 0xfd,0xcb,d,0x0e
RRC s :: 0xcb,0x08|s
RR (HL) :: 0xcb,0x1e
RR (IX[[+!d]]) :: 0xdd,0xcb,d,0x1e
RR (IY[[+!d]]) :: 0xfd,0xcb,d,0x1e
RR s :: 0xcb,0x18|s
SLA (HL) :: 0xcb,0x26
SLA (IX[[+!d]]) :: 0xdd,0xcb,d,0x26
SLA (IY[[+!d]]) :: 0xfd,0xcb,d,0x26
SLA s :: 0xcb,0x20|s
SRA (HL) :: 0xcb,0x2e
SRA (IX[[+!d]]) :: 0xdd,0xcb,d,0x2e
SRA (IY[[+!d]]) :: 0xfd,0xcb,d,0x2e
SRA s :: 0xcb,0x28|s
SRL (HL) :: 0xcb,0x3e
SRL (IX[[+!d]]) :: 0xdd,0xcb,d,0x3e
SRL (IY[[+!d]]) :: 0xfd,0xcb,d,0x3e
SRL s :: 0xcb,0x38|s
DAA :: 0x27
CPL :: 0x2f
NEG :: 0xed,0x44
CCF :: 0x3f
SCF :: 0x37
NOP :: 0x00
HALT :: 0x76
DI :: 0xf3
EI :: 0xfb
IM 0 :: 0xed,0x46
IM 1 :: 0xed,0x56
IM 2 :: 0xed,0x5e
EX DE,HL :: 0xeb
EX AF,AF' :: 0x08
EXX :: 0xd9
EX (SP),HL :: 0xe3
EX (SP),IX :: 0xdd,0xe3
EX (SP),IY :: 0xfd,0xe3
LDI :: 0xed,0xa0
LDIR :: 0xed,0xb0
LDD :: 0xed,0xa8
LDDR :: 0xed,0xb8
CPI :: 0xed,0xa1
CPIR :: 0xed,0xb1
CPD :: 0xed,0xa9
CPDR :: 0xed,0xb9
RLD :: 0xed,0x6f
RRD :: 0xed,0x67
IN A,(!n) :: 0xdb,n
IN s,(C) :: 0xed,0x40|s<<3
INI :: 0xed,0xa2
INIR :: 0xed,0xb2
IND :: 0xed,0xaa
INDR :: 0xed,0xba
OUT (!n),A :: 0xd3,n
OUT \(C\),s :: 0xed,0x41|s<<3
OUTI :: 0xed,0xa3
OTIR :: 0xed,0xb3
OUTD :: 0xed,0xab
OTDR :: 0xed,0xbb
.setsym ::NZ:: 0
.setsym ::Z :: 1
.setsym ::NC:: 2
.setsym ::C :: 3
.setsym ::PO:: 4
.setsym ::PE:: 5
.setsym ::P :: 6
.setsym ::M :: 7
JP (HL) :: 0xe9
JP (IX) :: 0xdd,0xe9
JP (IY) :: 0xfd,0xe9
JP s,!d :: 0xc2|s<<3,d&0xff,d>>8
JP !d :: 0xc3,d&0xff,d>>8
JR NZ,!e :: 0x20,e-2
JR Z,!e :: 0x28,e-2
JR NC,!e :: 0x30,e-2
JR C,!e :: 0x38,e-2
JR !e :: 0x18,e-2
DJNZ !e :: 0x10,e-2
CALL s,!d :: 0xc4|s<<3,d&0xff,d>>8
CALL !d :: 0xcd,d&0xff,d>>8
RET s :: 0xc0|s<<3
RET :: 0xc9
RETI :: 0xed,0x4d
RETN :: 0xed,0x45
RST !d :: 0xc7|(d//8)<<3