OpenCores
URL https://opencores.org/ocsvn/z80control/z80control/trunk

Subversion Repositories z80control

[/] [z80control/] [trunk/] [DE1/] [ROM/] [z80.lib] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 tylerapohl
;       @CHK MACRO USED FOR CHECKING 8 BIT DISPLACMENTS
2
;
3
@CHK    MACRO   ?DD     ; USED FOR CHECKING RANGE OF 8-BIT DISP.S
4
        IF (?DD GT 7FH) AND (?DD LT 0FF80H)
5
 'DISPLACEMENT RANGE ERROR - Z80 LIB'
6
        ENDIF
7
        ENDM
8
LDX     MACRO   ?R,?D
9
        @CHK    ?D
10
        DB      0DDH,?R*8+46H,?D ;LDX
11
        ENDM
12
LDY     MACRO   ?R,?D
13
        @CHK    ?D
14
        DB      0FDH,?R*8+46H,?D ;LDY
15
        ENDM
16
STX     MACRO   ?R,?D
17
        @CHK    ?D
18
        DB      0DDH,70H+?R,?D ;STX
19
        ENDM
20
STY     MACRO   ?R,?D
21
        @CHK    ?D
22
        DB      0FDH,70H+?R,?D ;STY
23
        ENDM
24
;
25
;MVIX    MACRO   ?N,?D
26
;        @CHK    ?D
27
;        DB      0DDH,36H,?D,?N ;MVIX
28
;        ENDM
29
;MVIY    MACRO   ?N,?D
30
;        @CHK    ?D
31
;        DB      0FDH,36H,?D,?N ;MVIY
32
;        ENDM
33
 
34
LDAI    MACRO
35
        DB      0EDH,57H ;LDAI
36
        ENDM
37
LDAR    MACRO
38
        DB      0EDH,5FH ;LDAR
39
        ENDM
40
STAI    MACRO
41
        DB      0EDH,47H ;STAI
42
        ENDM
43
STAR    MACRO
44
        DB      0EDH,4FH ;STAR
45
        ENDM
46
 
47
LXIX    MACRO   ?NNNN
48
        DB      0DDH,21H ;LXIX
49
        DW      ?NNNN
50
        ENDM
51
LXIY    MACRO   ?NNNN
52
        DB      0FDH,21H ;LXIY
53
        DW      ?NNNN
54
        ENDM
55
LDED    MACRO   ?NNNN
56
        DB      0EDH,5BH ;LDED
57
        DW      ?NNNN
58
        ENDM
59
LBCD    MACRO   ?NNNN
60
        DB      0EDH,4BH ;LBCD
61
        DW      ?NNNN
62
        ENDM
63
;
64
;LSPD    MACRO   ?NNNN
65
;        DB      0EDH,07BH ;LSPD
66
;        DW      ?NNNN
67
;        ENDM
68
;LIXD    MACRO   ?NNNN
69
;        DB      0DDH,2AH ;LIXD
70
;        DW      ?NNNN
71
;        ENDM
72
;
73
;LIYD    MACRO   ?NNNN
74
;        DB      0FDH,2AH ;LIYD
75
;        DW      ?NNNN
76
;        ENDM
77
;
78
SBCD    MACRO   ?NNNN
79
        DB      0EDH,43H ;SBCD
80
        DW      ?NNNN
81
        ENDM
82
SDED    MACRO   ?NNNN
83
        DB      0EDH,53H ;SDED
84
        DW      ?NNNN
85
        ENDM
86
;
87
;SSPD    MACRO   ?NNNN
88
;        DB      0EDH,73H ;SSPD
89
;        DW      ?NNNN
90
;        ENDM
91
;SIXD    MACRO   ?NNNN
92
;        DB      0DDH,22H ;SIXD
93
;        DW      ?NNNN
94
;        ENDM
95
;SIYD    MACRO   ?NNNN
96
;        DB      0FDH,22H ;SIYD
97
;        DW      ?NNNN
98
;        ENDM
99
;SPIX    MACRO
100
;        DB      0DDH,0F9H ;SPIX
101
;        ENDM
102
;SPIY    MACRO
103
;        DB      0FDH,0F9H ;SPIY
104
;        ENDM
105
;
106
PUSHIX  MACRO
107
        DB      0DDH,0E5H ;PUSHIX
108
        ENDM
109
PUSHIY  MACRO
110
        DB      0FDH,0E5H ;PUSHIY
111
        ENDM
112
POPIX   MACRO
113
        DB      0DDH,0E1H ;POPIX
114
        ENDM
115
POPIY   MACRO
116
        DB      0FDH,0E1H ;POPIY
117
        ENDM
118
EXAF    MACRO
119
        DB      08H ;EXAF
120
        ENDM
121
EXX     MACRO
122
        DB      0D9H ;EXX
123
        ENDM
124
;
125
;XTIX    MACRO
126
;        DB      0DDH,0E3H ;XTIX
127
;        ENDM
128
;XTIY    MACRO
129
;        DB      0FDH,0E3H ;XTIY
130
;        ENDM
131
;
132
LDI     MACRO
133
        DB      0EDH,0A0H ;LDI
134
        ENDM
135
LDIR    MACRO
136
        DB      0EDH,0B0H ;LDIR
137
        ENDM
138
LDD     MACRO
139
        DB      0EDH,0A8H ;LDD
140
        ENDM
141
LDDR    MACRO
142
        DB      0EDH,0B8H ;LDDR
143
        ENDM
144
CCI     MACRO
145
        DB      0EDH,0A1H ;CCI
146
        ENDM
147
CCIR    MACRO
148
        DB      0EDH,0B1H ;CCIR
149
        ENDM
150
CCD     MACRO
151
        DB      0EDH,0A9H ;CCD
152
        ENDM
153
CCDR    MACRO
154
        DB      0EDH,0B9H ;CCDR
155
        ENDM
156
;
157
;ADDX    MACRO   ?D
158
;        @CHK    ?D
159
;        DB      0DDH,86H,?D ;ADDX
160
;        ENDM
161
;ADDY    MACRO   ?D
162
;        @CHK    ?D
163
;        DB      0FDH,86H,?D ;ADDY
164
;        ENDM
165
;ADCX    MACRO   ?D
166
;        @CHK    ?D
167
;        DB      0DDH,8EH,?D ;ADCX
168
;        ENDM
169
;ADCY    MACRO   ?D
170
;        @CHK    ?D
171
;        DB      0FDH,8EH,?D ;ADCY
172
;        ENDM
173
;SUBX    MACRO   ?D
174
;        @CHK    ?D
175
;        DB      0DDH,96H,?D ;SUBX
176
;        ENDM
177
;SUBY    MACRO   ?D
178
;        @CHK    ?D
179
;        DB      0FDH,96H,?D ;SUBY
180
;        ENDM
181
;SBCX    MACRO   ?D
182
;        @CHK    ?D
183
;        DB      0DDH,9EH,?D ;SBCX
184
;        ENDM
185
;SBCY    MACRO   ?D
186
;        @CHK    ?D
187
;        DB      0FDH,9EH,?D ;SBCY
188
;        ENDM
189
;ANDX    MACRO   ?D
190
;        @CHK    ?D
191
;        DB      0DDH,0A6H,?D ;ANDX
192
;        ENDM
193
;ANDY    MACRO   ?D
194
;        @CHK    ?D
195
;        DB      0FDH,0A6H,?D ;ANDY
196
;        ENDM
197
;XORX    MACRO   ?D
198
;        @CHK    ?D
199
;        DB      0DDH,0AEH,?D ;XORX
200
;        ENDM
201
;XORY    MACRO   ?D
202
;        @CHK    ?D
203
;        DB      0FDH,0AEH,?D ;XORY
204
;        ENDM
205
;ORX     MACRO   ?D
206
;        @CHK    ?D
207
;        DB      0DDH,0B6H,?D ;ORX
208
;        ENDM
209
;ORY     MACRO   ?D
210
;        @CHK    ?D
211
;        DB      0FDH,0B6H,?D ;ORY
212
;        ENDM
213
;CMPX    MACRO   ?D
214
;        @CHK    ?D
215
;        DB      0DDH,0BEH,?D ;CMPX
216
;        ENDM
217
;CMPY    MACRO   ?D
218
;        @CHK    ?D
219
;        DB      0FDH,0BEH,?D CMPY
220
;        ENDM
221
;INRX    MACRO   ?D
222
;        @CHK    ?D
223
;        DB      0DDH,34H,?D ;INRX
224
;        ENDM
225
;INRY    MACRO   ?D
226
;        @CHK    ?D
227
;        DB      0FDH,34H,?D ;INRY
228
;        ENDM
229
;DCRX    MACRO   ?D
230
;        @CHK    ?D
231
;        DB      0DDH,035H,?D ;DCRX
232
;        ENDM
233
;DCRY    MACRO   ?D
234
;        @CHK    ?D
235
;        DB      0FDH,35H,?D ;DCRY
236
;        ENDM
237
;
238
NEG     MACRO
239
        DB      0EDH,44H ;NEG
240
        ENDM
241
IM0     MACRO
242
        DB      0EDH,46H ;IM0
243
        ENDM
244
IM1     MACRO
245
        DB      0EDH,56H ;IM1
246
        ENDM
247
IM2     MACRO
248
        DB      0EDH,5EH ;
249
        ENDM
250
;
251
BC      EQU     0
252
DE      EQU     2
253
HL      EQU     4
254
IX      EQU     4
255
IY      EQU     4
256
;
257
DADC    MACRO   ?R
258
        DB      0EDH,?R*8+4AH ;DADC
259
        ENDM
260
DSBC    MACRO   ?R
261
        DB      0EDH,?R*8+42H ;DSBC
262
        ENDM
263
;
264
;DADX    MACRO   ?R
265
;        DB      0DDH,?R*8+09H ;DADX
266
;        ENDM
267
;DADY    MACRO   ?R
268
;        DB      0FDH,?R*8+09H ;DADY
269
;        ENDM
270
;
271
INXIX   MACRO
272
        DB      0DDH,23H ;INXIX
273
        ENDM
274
INXIY   MACRO
275
        DB      0FDH,23H ;INXIY
276
        ENDM
277
DCXIX   MACRO
278
        DB      0DDH,2BH ;DCXIX
279
        ENDM
280
DCXIY   MACRO
281
        DB      0FDH,2BH ;DCXIY
282
        ENDM
283
 
284
BIT     MACRO   ?N,?R
285
        DB      0CBH,?N*8+?R+40H ;BIT
286
        ENDM
287
SETB    MACRO   ?N,?R
288
        DB      0CBH,?N*8+?R+0C0H ;SETB
289
        ENDM
290
RESB    MACRO   ?N,?R
291
        DB      0CBH,?N*8+?R+80H ;RESB
292
        ENDM
293
 
294
BITH    MACRO   ?N
295
        DB      0CBH,?N*8+46H ;BITH
296
        ENDM
297
BITX    MACRO   ?N,?D
298
        @CHK    ?D
299
        DB      0DDH,0CBH,?D,?N*8+46H ;BITX
300
        ENDM
301
BITY    MACRO   ?N,?D
302
        @CHK    ?D
303
        DB      0FDH,0CBH,?D,?N*8+46H ;BITY
304
        ENDM
305
SETH    MACRO   ?N
306
        DB      0CBH,?N*8+0C6H ;SETH
307
        ENDM
308
SETX    MACRO   ?N,?D
309
        @CHK    ?D
310
        DB      0DDH,0CBH,?D,?N*8+0C6H ;SETX
311
        ENDM
312
SETY    MACRO   ?N,?D
313
        @CHK    ?D
314
        DB      0FDH,0CBH,?D,?N*8+0C6H ;SETY
315
        ENDM
316
RESH    MACRO   ?N
317
        DB      0CBH,?N*8+86H ;RESH
318
        ENDM
319
RESX    MACRO   ?N,?D
320
        @CHK    ?D
321
        DB      0DDH,0CBH,?D,?N*8+86H ;RESX
322
        ENDM
323
RESY    MACRO   ?N,?D
324
        @CHK    ?D
325
        DB      0FDH,0CBH,?D,?N*8+86H ;RESY
326
        ENDM
327
 
328
JR      MACRO   ?N
329
        DB      18H,?N-$-1 ;JR
330
        ENDM
331
JRC     MACRO   ?N
332
        DB      38H,?N-$-1 ;JRC
333
        ENDM
334
JRNC    MACRO   ?N
335
        DB      30H,?N-$-1 ;JRNC
336
        ENDM
337
JRZ     MACRO   ?N
338
        DB      28H,?N-$-1 ;JRZ
339
        ENDM
340
JRNZ    MACRO   ?N
341
        DB      20H,?N-$-1 ;JRNZ
342
        ENDM
343
DJNZ    MACRO   ?N
344
        DB      10H,?N-$-1 ;DJNZ
345
        ENDM
346
;
347
;PCIX    MACRO
348
;        DB      0DDH,0E9H ;PCIX
349
;        ENDM
350
;PCIY    MACRO
351
;        DB      0FDH,0E9H ;PCIY
352
;        ENDM
353
;
354
RETI    MACRO
355
        DB      0EDH,4DH ;RETI
356
        ENDM
357
RETN    MACRO
358
        DB      0EDH,45H ;RETN
359
        ENDM
360
 
361
INP     MACRO   ?R
362
        DB      0EDH,?R*8+40H ;INP
363
        ENDM
364
OUTP    MACRO   ?R
365
        DB      0EDH,?R*8+41H ;OUTP
366
        ENDM
367
INI     MACRO
368
        DB      0EDH,0A2H ;INI
369
        ENDM
370
INIR    MACRO
371
        DB      0EDH,0B2H ;INIR
372
        ENDM
373
IND     MACRO
374
        DB      0EDH,0AAH ;IND
375
        ENDM
376
INDR    MACRO
377
        DB      0EDH,0BAH ;INDR
378
        ENDM
379
OUTI    MACRO
380
        DB      0EDH,0A3H ;OUTI
381
        ENDM
382
OUTIR   MACRO
383
        DB      0EDH,0B3H ;OUTIR
384
        ENDM
385
OUTD    MACRO
386
        DB      0EDH,0ABH ;OUTD
387
        ENDM
388
OUTDR   MACRO
389
        DB      0EDH,0BBH ;OUTDR
390
        ENDM
391
;
392
;RLCR    MACRO   ?R
393
;        DB      0CBH, 00H + ?R ;RLCR
394
;        ENDM
395
;RLCX    MACRO   ?D
396
;        @CHK    ?D
397
;        DB      0DDH, 0CBH, ?D, 06H ;RLCX
398
;        ENDM
399
;RLCY    MACRO   ?D
400
;        @CHK    ?D
401
;        DB      0FDH, 0CBH, ?D, 06H ;RLCY
402
;        ENDM
403
;RALR    MACRO   ?R
404
;        DB      0CBH, 10H+?R ;RALR
405
;        ENDM
406
;RALX    MACRO   ?D
407
;        @CHK    ?D
408
;        DB      0DDH, 0CBH, ?D, 16H ;RALX
409
;        ENDM
410
;RALY    MACRO   ?D
411
;        @CHK    ?D
412
;        DB      0FDH, 0CBH, ?D, 16H ;RALY
413
;        ENDM
414
;RRCR    MACRO   ?R
415
;        DB      0CBH, 08H + ?R ;RRCR
416
;        ENDM
417
;RRCX    MACRO   ?D
418
;        @CHK    ?D
419
;        DB      0DDH, 0CBH, ?D, 0EH ;RRCX
420
;        ENDM
421
;RRCY    MACRO   ?D
422
;        @CHK    ?D
423
;        DB      0FDH, 0CBH, ?D, 0EH ;RRCY
424
;        ENDM
425
;RARR    MACRO   ?R
426
;        DB      0CBH, 18H + ?R ;RARR
427
;        ENDM
428
;RARX    MACRO   ?D
429
;        @CHK    ?D
430
;        DB      0DDH, 0CBH, ?D, 1EH ;RARX
431
;        ENDM
432
;RARY    MACRO   ?D
433
;        @CHK    ?D
434
;        DB      0FDH, 0CBH, ?D, 1EH ;RARY
435
;        ENDM
436
;SLAR    MACRO   ?R
437
;        DB      0CBH, 20H + ?R ;SLAR
438
;        ENDM
439
;SLAX    MACRO   ?D
440
;        @CHK    ?D
441
;        DB      0DDH, 0CBH, ?D, 26H ;SLAX
442
;        ENDM
443
;SLAY    MACRO   ?D
444
;        @CHK    ?D
445
;        DB      0FDH, 0CBH, ?D, 26H ;SLAY
446
;        ENDM
447
;SRAR    MACRO   ?R
448
;        DB      0CBH, 28H+?R ;SRAR
449
;        ENDM
450
;SRAX    MACRO   ?D
451
;        @CHK    ?D
452
;        DB      0DDH, 0CBH, ?D, 2EH ;SRAX
453
;        ENDM
454
;SRAY    MACRO   ?D
455
;        @CHK    ?D
456
;        DB      0FDH, 0CBH, ?D, 2EH ;SRAY
457
;        ENDM
458
;SRLR    MACRO   ?R
459
;        DB      0CBH, 38H + ?R ;SRLR
460
;        ENDM
461
;SRLX    MACRO   ?D
462
;        @CHK    ?D
463
;        DB      0DDH, 0CBH, ?D, 3EH ;SRLX
464
;        ENDM
465
;SRLY    MACRO   ?D
466
;        @CHK    ?D
467
;        DB      0FDH, 0CBH, ?D, 3EH ;SRLY
468
;        ENDM
469
;RLD     MACRO
470
;        DB      0EDH, 6FH ;RLD
471
;        ENDM
472
RRD     MACRO
473
        DB      0EDH, 67H ;RRD
474
        ENDM
475


powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.