aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t_87c800/t_87c800.asm
blob: c8e1276d0bee0085d6aa6df0984952d33200198a (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
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
	cpu	87c70
	include	stddef87.inc
	page	0

	ei
	di
	swi
	nop
	ret
	reti
	retn

targ:	jrs	t,targ
	jrs	f,targ

	jr	t,targ
	jr	f,targ
	jr	eq,targ
	jr	z,targ
	jr	ne,targ
	jr	nz,targ
	jr	cs,targ
	jr	lt,targ
	jr	cc,targ
	jr	ge,targ
	jr	le,targ
	jr	gt,targ
	jr	targ

	daa	a
	daa	b
	das	a
	das	c
	shlc	a
	shlc	d
	shrc	a
	shrc	e
	rolc	a
	rolc	h
	rorc	a
	rorc	l
	swap	a
	swap	b

	add	a,c
	addc	l,a
	sub	wa,de
	subb	a,(12h)
	and	a,(hl)
	or	a,(de)
	xor	a,(hl+)
	cmp	a,(-hl)
	add	a,(hl+10)
	addc	a,(hl-125)
	sub	a,(hl+c)
	subb	a,(c+hl)
	and	a,(pc+a)
	or	a,(a+pc)
	cmp	(12h),(hl)
	add	(de),(hl)
	addc	(hl+5),(hl)
	sub	(hl+c),(hl)
	subb	(pc+a),(hl)
	and	a,55h
	or	c,55h
	xor	hl,5678h
	cmp     (12h),55h
	add	(hl),55h
	addc	(hl+),55h
	sub	(-hl),55h
	subb	(hl-32),55h
	and	(hl+c),55h
	or	(pc+a),55h

	mcmp	(12h),55h
	mcmp	(de),55h
	mcmp	(hl+),55h
	mcmp	(-hl),55h
	mcmp	(hl+3),55h
	mcmp	(c+hl),55h
	mcmp	(pc+a),55h

	inc	c
	inc	bc
	inc	(12h)
	inc	(hl)
	inc	(de)
	inc	(hl+)
	inc	(-hl)
	inc	(hl+4)
	inc	(hl+c)
	inc	(a+pc)
	dec	e
	dec	hl
	dec	(12h)
	dec	(hl)
	dec	(de)
	dec	(hl+)
	dec	(-hl)
	dec	(hl-7)
	dec	(hl+c)
	dec	(pc+a)

	mul	w,a
	mul	c,b
	mul	d,e
	mul	l,h

	div	wa,c
	div	de,c
	div	hl,c

	rold	a,(12h)
	rold	a,(hl)
	rold	a,(hl+)
	rold	a,(-hl)
	rold	a,(hl+16)
	rold	a,(c+hl)
	rord	a,(12h)
	rord	a,(hl)
	rord	a,(hl+)
	rord	a,(-hl)
	rord	a,(hl-16)
	rord	a,(hl+c)

	xch	a,d
	xch	d,w
	xch	hl,de
	xch	bc,wa
	xch	b,(12h)
	xch	(12h),c
	xch	d,(hl)
	xch	(de),e
	xch	l,(hl+)
	xch	(hl+),h
	xch	a,(-hl)
	xch	(-hl),w
	xch	b,(hl+5)
	xch	(hl-3),c
	xch	d,(hl+c)
	xch	(c+hl),e
	xch	h,(pc+a)
	xch	(a+pc),l

	clr	b
	clr	de
	clr	(12h)
	clr	(hl)
	clr	(de)
	clr	(hl+)
	clr	(-hl)
	clr	(hl+5)

	ldw	hl,1234h
	ldw	(12h),1234h
	ldw	(hl),1234h

	ld	a,l
	ld	d,a
	ld	w,h
	ld	a,(12h)
	ld	c,(12h)
	ld	a,(hl)
	ld	d,(hl)
	ld	c,(de)
	ld	b,(-hl)
	ld	h,(hl+)
	ld	c,(hl-122)
	ld	w,(hl+c)
	ld      d,(a+pc)
	ld	h,20

	ld	hl,bc
	ld	de,(12h)
	ld	bc,(de)
	ld	wa,(hl+1)
	ld	hl,(hl+c)
	ld	de,(pc+a)
	ld	bc,1234

	ld	(12h),a
	ld	(12h),c
	ld	(12h),de
	ld	(12h),(23h)
	ld	(12h),(de)
	ld	(12h),(hl-42)
	ld	(12h),(hl+c)
	ld	(12h),(pc+a)
	ld	(12h),23h

	ld	(hl),a
	ld	(de),d
	ld	(hl+),c
	ld	(-hl),e
	ld      (hl+4),h
	ld	(hl),de
	ld	(hl+5),bc
	ld	(hl),(12h)
	ld	(hl),(de)
	ld	(hl),(hl+1)
	ld	(hl),(hl+c)
	ld	(hl),(pc+a)
	ld	(hl),23h
	ld	(de),23h
	ld	(hl+),23h
	ld	(-hl),23h
	ld	(hl-77),23h

	ld	sp,1234h
	ld	sp,de
	ld	hl,sp
	ld	rbs,7

	jp	2000h
	call	1234h
	call	0ff54h
	jp	hl
	call	de
	jp	(hl)
	jp	(de)
	jp	(12h)
	call	(12h)
	jp	(hl+5)
	call	(hl-100)
	jp	(hl+c)
	call	(a+pc)
	jp	(c+hl)
	call	(pc+a)

	callv	3

	callp	76h
	callp	0ff12h

	push	psw
	push	de
	pop	wa
	pop	psw

	ld	cf,a.5
	ld	cf,(12h).4
	ld	cf,(hl).3
	ld	cf,(hl+).2
	ld	cf,(-hl).1
	ld	cf,(hl+3).0
	ld	cf,(hl+c).7
	ld	cf,(pc+a).3
	ld	cf,(de).c

	ld	a.5,cf
	ld	(12h).4,cf
	ld	(hl).3,cf
	ld	(hl+).2,cf
	ld	(-hl).1,cf
	ld	(hl+3).0,cf
	ld	(hl+c).7,cf
	ld	(pc+a).3,cf
	ld	(de).c,cf

	xor	cf,d.3
	xor	cf,(12h).4
	xor	cf,(de).5
	xor	cf,(hl+).6
	xor	cf,(-hl).7
	xor	cf,(hl+3).0
	xor	cf,(hl+c).1
	xor	cf,(pc+a).2

	clr	cf
	clr	d.3
	clr	(12h).4
	clr	(de).5
	clr	(hl+).6
	clr	(-hl).7
	clr	(hl+3).0
	clr	(hl+c).1
	clr	(pc+a).2
	clr	(de).c

	set	cf
	set	d.3
	set	(12h).4
	set	(de).5
	set	(hl+).6
	set	(-hl).7
	set	(hl+3).0
	set	(hl+c).1
	set	(pc+a).2
	set	(de).c

	cpl	cf
	cpl	d.3
	cpl	(12h).4
	cpl	(de).5
	cpl	(hl+).6
	cpl	(-hl).7
	cpl	(hl+3).0
	cpl	(hl+c).1
	cpl	(pc+a).2
	cpl	(de).c

	test	d.3
	test	(12h).4
	test	(de).5
	test	(hl+).6
	test	(-hl).7
	test	(hl+3).0
	test	(hl+c).1
	test	(pc+a).2
	test	(de).c