aboutsummaryrefslogtreecommitdiffstats
path: root/tests/t_h8_3/t_h8_3.asm
blob: 47c8743f2506eb9e335998294c565cbeade01464 (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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
	cpu	hd6413309
	maxmode	on
	page	0
        relaxed on

        dc.w	1234
        dc.w	$4d2
        dc.w	@2322
        dc.w	%10011010010
        dc.w	4d2h
        dc.w	2322o
        dc.w	10011010010b
        dc.w	0x4d2
	dc.w	02322

	nop
	sleep
	rts
	rte

	eepmov
	eepmov.b
	eepmov.w

	dec	r2h
	dec	#1,r5l
	dec	r4
	dec	#1,e6
	dec	#2,e1
	dec	er1
	dec	#1,er4
	dec	#2,er7
	inc	r2h
	inc	#1,r5l
	inc	r4
	inc	#1,e6
	inc	#2,e1
	inc	er1
	inc	#1,er4
	inc	#2,er7

targ:   bsr	targ
	bsr.s	targ
	bsr.l	targ
	bra	targ
	bra.s	targ
	bra.l	targ
	bt	targ
	bt.s	targ
	bt.l	targ
	brn	targ
	brn.s	targ
	brn.l	targ
	bf	targ
	bf.s	targ
	bf.l	targ
	bhi	targ
	bhi.s	targ
	bhi.l	targ
	bls	targ
	bls.s	targ
	bls.l	targ
	bcc	targ
	bcc.s	targ
	bcc.l	targ
	bhs	targ
	bhs.s	targ
	bhs.l	targ
	bcs	targ
	bcs.s	targ
	bcs.l	targ
	blo	targ
	blo.s	targ
	blo.l	targ
	bne	targ
	bne.s	targ
	bne.l	targ
	beq	targ
	beq.l	targ
	bvc	targ
	bvc.l	targ
	bvs	targ
	bvs.l	targ
	bpl	targ
	bpl.l	targ
	bmi	targ
	bmi.l	targ
	bge	targ
	bge.l	targ
	blt	targ
	blt.l	targ
	bgt	targ
	bgt.l	targ
	ble	targ
	ble.l	targ

	rotl	r4h
	rotl	r2
	rotl	er1
	rotr	r2l
	rotr	r1
	rotr	er5
	rotxl	r2h
	rotxl	e4
	rotxl	er2
	rotxr	r6h
	rotxr	e0
	rotxr	er7
	shal	r3l
	shal	r6
	shal	er0
	shar	r5l
	shar	r2
	shar	er6
	shll	r2h
	shll	e4
	shll	er5
	shlr	r1l
	shlr	r7
	shlr	er4

	not	r7h
	not	r6
	not	er2
	neg	r2l
	neg	e2
	neg	er5

	exts	r5
	extu	e3
	exts	er4
	extu	er6

        and	r5h,r3l
        and	#10,r2h
        and	r7,e1
        and	#%1101,r1
        and	er2,er6
        and	#$12345678,er3
        andc	#$20,ccr
        or	r6h,r4l
        or	#20,r3h
        or	r0,e2
        or	#%11101,r2
        or	er2,er7
        or	#$12345678,er4
        orc	#$30,ccr
        xor	r4h,r2l
        xor     #$08,r1h
        xor	r6,e0
        xor	#%101101,r0
        xor	er1,er5
        xor	#$12345678,er2
        xorc	#$30,ccr

        daa	r1l
        das	r5h

        addx	#10,r5l
        addx	r1h,r1l
        subx	#$55,r7h
        subx	r3h,r0l

        adds	#1,er0
        adds	#2,er4
        adds	#4,er5
        subs	#1,er6
        subs	#2,er3
        subs	#4,er1

        divxs	r4h,e2
        divxs	r4,er5
        divxu	r1l,r3
        divxu	e6,er7
        mulxs	r0l,e6
        mulxs	r5,er2
        mulxu	r7h,r5
        mulxu	e3,er4

	add	r1h,r2l
	add	#$34,r6h
	add	r2,e3
	add	#%10101010101010,e5
	add     er3,er1
	add	#1000000,er4
	sub	r1l,r2h
	sub	r6,e1
	sub	#%10101010101010,r2
	sub     er1,er5
	sub	#1000000,er6
	cmp	r1h,r2l
	cmp	#$34,r6h
	cmp	r2,e3
	cmp	#%10101010101010,e5
	cmp     er3,er1
	cmp	#1000000,er4


	pop	r5
	push	e2
	pop	er1
	push	er6

	mov	r2l,r5h
	mov	r1,e2
	mov	er5,er2

	mov.b	@er4,r6h
	mov.b	r6h,@er4
	mov.w	@er1,e7
	mov.w	e7,@er1
	mov.l	@er5,er2
	mov.l	er2,@er5

	mov.b	@er2+,r5l
	mov.b	r5l,@-er2
	mov.w	@er5+,r4
	mov.w	r4,@-er5
	mov.l	@er6+,er1
	mov.l	er1,@-er6

	mov.b	@(-100,er2),r4l
	mov.b	r4l,@(-100,er2)
	mov.w	@(200,er4),e3
	mov.w	e3,@(200,er4)
	mov.l	@(-300,sp),er5
	mov.l	er5,@(-300,sp)

	mov.b	@(-100000,er4),r3h
	mov.b	r3h,@(-100000,er4)
	mov.w	@(200000,er2),r6
	mov.w	r6,@(200000,er2)
	mov.l	@(-300000,er5),er1
	mov.l	er1,@(-300000,er5)

	mov.b	$ffff20,r1h
	mov.b	r1h,$ffff20
	mov.w	$ffffa4,e6
	mov.w	e6,$ffffa4
	mov.l	$ffffc0,er3
	mov.l	er3,$ffffc0

	mov.b	$1234,r3h
	mov.b	r3h,$1234
	mov.w	$2345,e5
	mov.w	e5,$2345
	mov.l	$3456,er4
	mov.l	er4,$3456

	mov.b	$123456,r3l
	mov.b	r3l,$123456
	mov.w	$234567,r5
	mov.w	r5,$234567
	mov.l	$345678,er7
	mov.l	er7,$345678

	mov.b	#$12,r4l
	mov.w	#$1234,e2
        mov.l   #$12345678,er3

	movfpe	@1234,r4l
	movtpe	r4l,@1234

	band	#4,r2l
	band	#2,@er3
	band	#6,$ffff4e
	biand	#4,r2l
	biand	#2,@er3
	biand	#6,$ffff4e
	bild	#4,r2l
	bild	#2,@er3
	bild	#6,$ffff4e
	bior	#4,r2l
	bior	#2,@er3
	bior	#6,$ffff4e
	bist	#4,r2l
	bist	#2,@er3
	bist	#6,$ffff4e
	bixor	#4,r2l
	bixor	#2,@er3
	bixor	#6,$ffff4e
	bld	#4,r2l
	bld	#2,@er3
	bld	#6,$ffff4e
	bor	#4,r2l
	bor	#2,@er3
	bor	#6,$ffff4e
	bst	#4,r2l
	bst	#2,@er3
	bst	#6,$ffff4e
	bxor	#4,r2l
	bxor	#2,@er3
	bxor	#6,$ffff4e

	bclr	#3,r5h
	bclr	#7,@er6
	bclr	#2,$ffff1a
	bclr	r5l,r6h
	bclr	r1h,@er4
	bclr	r7h,$ffff24
	bnot	#3,r5h
	bnot	#7,@er6
	bnot	#2,$ffff1a
	bnot	r5l,r6h
	bnot	r1h,@er4
	bnot	r7h,$ffff24
	bset	#3,r5h
	bset	#7,@er6
	bset	#2,$ffff1a
	bset	r5l,r6h
	bset	r1h,@er4
	bset	r7h,$ffff24
	btst	#3,r5h
	btst	#7,@er6
	btst	#2,$ffff1a
	btst	r5l,r6h
	btst	r1h,@er4
	btst	r7h,$ffff24

	jmp	@er2
	jmp	$123456
	jmp	@@$35
	jsr	@er2
	jsr	$123456
	jsr	@@$35

	ldc	#23,ccr
	ldc	r5h,ccr
	stc	ccr,r5h
	ldc	@er6,ccr
	stc	ccr,@er6
	ldc	@er3+,ccr
	stc	ccr,@-er3
	ldc	@(100,er1),ccr
	stc	ccr,@(100,er1)
	ldc	@(100000,er5),ccr
	stc	ccr,@(100000,er5)
	ldc	$1234,ccr
	stc	ccr,$1234
	ldc	$123456,ccr
	stc	ccr,$123456

	dc	20

	dc.b	5,"Hallo"
	dc.w	1,2,3,4
	dc.l	1,2,3,4
;	dc.q	1,2,3,4		; omit for the sake of non-64-bit-platforms...
	dc.s	1,2,3,4
	dc.d	1,2,3,4
	dc.x	1,2,3,4
	dc.p	1,2,3,4