summaryrefslogtreecommitdiff
path: root/system/shard-z80-ruc-64180/1.5/src/HD64180.LIB
blob: 5d733e4ff0f1c9f1d323fd0520a8e33a699e6739 (plain)
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

; HD64180-Macro-Library - 14.04.85

	.z80
	.xlist

CNTLA0	equ	00h
CNTLA1	equ	01h
CNTLB0	equ	02h
CNTLB1	equ	03h
STAT0	equ	04h
STAT1	equ	05h
TDR0	equ	06h
TDR1	equ	07h
TSR0	equ	08h
TSR1	equ	09h
CNTR	equ	0ah
TRDR	equ	0bh
TMDROL	equ	0ch
TMDROH	equ	0dh
RLDROL	equ	0eh
RLDROH	equ	0fh
TCR	equ	10h
TMDR1L	equ	14h
TMDR1H	equ	15h
RLDR1L	equ	16h
RLDR1H	equ	17h
SAR0L	equ	20h
SAR0H	equ	21h
SAR0B	equ	22h
DAR0L	equ	23h
DAR0H	equ	24h
DAR0B	equ	25h
BCR0L	equ	26h
BCR0H	equ	27h
MAR1L	equ	28h
MAR1H	equ	29h
MAR1B	equ	2ah
IAR1L	equ	2bh
IAR1H	equ	2ch
BCR1L	equ	2eh
BCR1H	equ	2fh
DSTAT	equ	30h
DMODE	equ	31h
DCNTL	equ	32h
IL	equ	33h
ITC	equ	34h
RCR	equ	36h
CBR	equ	38h
BBR	equ	39h
CBAR	equ	3ah
ICR	equ	3fh

hdword	macro	x
	if	'&X' eq 'BC'  or '&X' eq 'bc'
ww	defl	0	; INIT mit 0, BC=0
	else
	if	'&X' eq 'DE'  or '&X' eq 'de'
ww	defl	1
	else
	if	'&X' eq 'HL'  or '&X' eq 'hl'
ww	defl	2
	else
	if	'&X' eq 'SP'  or '&X' eq 'sp'
ww	defl	3
	else
	.printx 'HD-Word-Error'
	endif
	endif
	endif
	endif
	endm


hdreg	macro	x
	ifidn	<X>,<(hl)>
reg	defl	6
	else
	ifidn	<X>,<(HL)>
reg	defl	6
	else
	if	'&X' eq 'B' or '&X' eq 'b'
reg	defl	0
	else 
	if	'&X' eq 'C' or '&X' eq 'c'
reg	defl	1
	else 
	if	'&X' eq 'D' or '&X' eq 'd'
reg	defl	2
	else 
	if	'&X' eq 'E' or '&X' eq 'e'
reg	defl	3
	else 
	if	'&X' eq 'H' or '&X' eq 'h'
reg	defl	4
	else 
	if	'&X' eq 'L' or '&X' eq 'l'
reg	defl	5
	else 
	if	'&X' eq 'A' or '&X' eq 'a'
reg	defl	7
	else
	.printx	'HD-Reg Error'
	endif
	endif
	endif
	endif
	endif
	endif
	endif
	endif
	endif
	endm

mlt	macro	x
	hdword	x
	db	0edh,4ch+ww*10h
	endm

slp	macro
	db	0edh,076h
	endm

in0	macro	x,y
	hdreg	x
	db	0edh,reg*8,y
	endm

out0	macro	y,x
	hdreg	x
	db	0edh,reg*8+1,y
	endm

tst	macro	x		; Test register
	hdreg	x
	db	0edh,reg*8+4
	endm

otim	macro
	db	0edh,83h
	endm

otimr	macro
	db	0edh,93h
	endm

otdm	macro
	db	0edh,8bh
	endm

otdmr	macro
	db	0edh,9bh
	endm

tstio	macro	x
	db	0edh,074h,x
	endm

; ENDE der HD64180-Macros