movb.s revision 1.1.1.1 1 1.1 christos # Hitachi H8 testcase 'mov.b'
2 1.1 christos # mach(): h8300h h8300s h8sx
3 1.1 christos # as(h8300h): --defsym sim_cpu=1
4 1.1 christos # as(h8300s): --defsym sim_cpu=2
5 1.1 christos # as(h8sx): --defsym sim_cpu=3
6 1.1 christos # ld(h8300h): -m h8300helf
7 1.1 christos # ld(h8300s): -m h8300self
8 1.1 christos # ld(h8sx): -m h8300sxelf
9 1.1 christos
10 1.1 christos .include "testutils.inc"
11 1.1 christos
12 1.1 christos start
13 1.1 christos
14 1.1 christos .data
15 1.1 christos .align 4
16 1.1 christos byte_dst_dec:
17 1.1 christos .byte 0
18 1.1 christos byte_src:
19 1.1 christos .byte 0x77
20 1.1 christos byte_dst:
21 1.1 christos .byte 0
22 1.1 christos
23 1.1 christos .text
24 1.1 christos
25 1.1 christos ;;
26 1.1 christos ;; Move byte from immediate source
27 1.1 christos ;;
28 1.1 christos
29 1.1 christos .if (sim_cpu == h8sx)
30 1.1 christos mov_b_imm8_to_reg8:
31 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
32 1.1 christos set_ccr_zero
33 1.1 christos
34 1.1 christos ;; mov.b #xx:8, rd
35 1.1 christos mov.b #0x77:8, r0l ; Immediate 3-bit operand
36 1.1 christos ;;; .word 0xf877
37 1.1 christos
38 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
39 1.1 christos test_neg_clear
40 1.1 christos test_zero_clear
41 1.1 christos test_ovf_clear
42 1.1 christos test_carry_clear
43 1.1 christos
44 1.1 christos test_h_gr32 0xa5a5a577 er0
45 1.1 christos
46 1.1 christos test_gr_a5a5 1 ; Make sure other general regs not disturbed
47 1.1 christos test_gr_a5a5 2
48 1.1 christos test_gr_a5a5 3
49 1.1 christos test_gr_a5a5 4
50 1.1 christos test_gr_a5a5 5
51 1.1 christos test_gr_a5a5 6
52 1.1 christos test_gr_a5a5 7
53 1.1 christos .endif
54 1.1 christos
55 1.1 christos .if (sim_cpu == h8sx)
56 1.1 christos mov_b_imm4_to_abs16:
57 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
58 1.1 christos set_ccr_zero
59 1.1 christos
60 1.1 christos ;; mov.b #xx:4, @aa:16
61 1.1 christos mov.b #0xf:4, @byte_dst:16 ; 16-bit address-direct operand
62 1.1 christos ;;; .word 0x6adf
63 1.1 christos ;;; .word @byte_dst
64 1.1 christos
65 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
66 1.1 christos test_neg_clear
67 1.1 christos test_zero_clear
68 1.1 christos test_ovf_clear
69 1.1 christos test_carry_clear
70 1.1 christos
71 1.1 christos test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
72 1.1 christos test_gr_a5a5 1 ; (first, because on h8/300 we must use one
73 1.1 christos test_gr_a5a5 2 ; to examine the destination memory).
74 1.1 christos test_gr_a5a5 3
75 1.1 christos test_gr_a5a5 4
76 1.1 christos test_gr_a5a5 5
77 1.1 christos test_gr_a5a5 6
78 1.1 christos test_gr_a5a5 7
79 1.1 christos
80 1.1 christos ;; Now check the result of the move to memory.
81 1.1 christos cmp.b #0xf, @byte_dst
82 1.1 christos beq .Lnext21
83 1.1 christos fail
84 1.1 christos .Lnext21:
85 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
86 1.1 christos
87 1.1 christos mov_b_imm4_to_abs32:
88 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
89 1.1 christos set_ccr_zero
90 1.1 christos
91 1.1 christos ;; mov.b #xx:4, @aa:32
92 1.1 christos mov.b #0xf:4, @byte_dst:32 ; 32-bit address-direct operand
93 1.1 christos ;;; .word 0x6aff
94 1.1 christos ;;; .long @byte_dst
95 1.1 christos
96 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
97 1.1 christos test_neg_clear
98 1.1 christos test_zero_clear
99 1.1 christos test_ovf_clear
100 1.1 christos test_carry_clear
101 1.1 christos
102 1.1 christos test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
103 1.1 christos test_gr_a5a5 1 ; (first, because on h8/300 we must use one
104 1.1 christos test_gr_a5a5 2 ; to examine the destination memory).
105 1.1 christos test_gr_a5a5 3
106 1.1 christos test_gr_a5a5 4
107 1.1 christos test_gr_a5a5 5
108 1.1 christos test_gr_a5a5 6
109 1.1 christos test_gr_a5a5 7
110 1.1 christos
111 1.1 christos ;; Now check the result of the move to memory.
112 1.1 christos cmp.b #0xf, @byte_dst
113 1.1 christos beq .Lnext22
114 1.1 christos fail
115 1.1 christos .Lnext22:
116 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
117 1.1 christos
118 1.1 christos mov_b_imm8_to_indirect:
119 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
120 1.1 christos set_ccr_zero
121 1.1 christos
122 1.1 christos ;; mov.b #xx:8, @erd
123 1.1 christos mov.l #byte_dst, er1
124 1.1 christos mov.b #0xa5:8, @er1 ; Register indirect operand
125 1.1 christos ;;; .word 0x017d
126 1.1 christos ;;; .word 0x01a5
127 1.1 christos
128 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
129 1.1 christos test_neg_set
130 1.1 christos test_zero_clear
131 1.1 christos test_ovf_clear
132 1.1 christos test_carry_clear
133 1.1 christos
134 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
135 1.1 christos test_h_gr32 byte_dst, er1
136 1.1 christos test_gr_a5a5 2
137 1.1 christos test_gr_a5a5 3
138 1.1 christos test_gr_a5a5 4
139 1.1 christos test_gr_a5a5 5
140 1.1 christos test_gr_a5a5 6
141 1.1 christos test_gr_a5a5 7
142 1.1 christos
143 1.1 christos ;; Now check the result of the move to memory.
144 1.1 christos cmp.b #0xa5, @byte_dst
145 1.1 christos beq .Lnext1
146 1.1 christos fail
147 1.1 christos .Lnext1:
148 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
149 1.1 christos
150 1.1 christos mov_b_imm8_to_postinc: ; post-increment from imm8 to mem
151 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
152 1.1 christos set_ccr_zero
153 1.1 christos
154 1.1 christos ;; mov.b #xx:8, @erd+
155 1.1 christos mov.l #byte_dst, er1
156 1.1 christos mov.b #0xa5:8, @er1+ ; Imm8, register post-incr operands.
157 1.1 christos ;;; .word 0x017d
158 1.1 christos ;;; .word 0x81a5
159 1.1 christos
160 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
161 1.1 christos test_neg_set
162 1.1 christos test_zero_clear
163 1.1 christos test_ovf_clear
164 1.1 christos test_carry_clear
165 1.1 christos
166 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
167 1.1 christos test_h_gr32 byte_dst+1, er1
168 1.1 christos test_gr_a5a5 2
169 1.1 christos test_gr_a5a5 3
170 1.1 christos test_gr_a5a5 4
171 1.1 christos test_gr_a5a5 5
172 1.1 christos test_gr_a5a5 6
173 1.1 christos test_gr_a5a5 7
174 1.1 christos
175 1.1 christos ;; Now check the result of the move to memory.
176 1.1 christos cmp.b #0xa5, @byte_dst
177 1.1 christos beq .Lnext2
178 1.1 christos fail
179 1.1 christos .Lnext2:
180 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
181 1.1 christos
182 1.1 christos mov_b_imm8_to_postdec: ; post-decrement from imm8 to mem
183 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
184 1.1 christos set_ccr_zero
185 1.1 christos
186 1.1 christos ;; mov.b #xx:8, @erd-
187 1.1 christos mov.l #byte_dst, er1
188 1.1 christos mov.b #0xa5:8, @er1- ; Imm8, register post-decr operands.
189 1.1 christos ;;; .word 0x017d
190 1.1 christos ;;; .word 0xa1a5
191 1.1 christos
192 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
193 1.1 christos test_neg_set
194 1.1 christos test_zero_clear
195 1.1 christos test_ovf_clear
196 1.1 christos test_carry_clear
197 1.1 christos
198 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
199 1.1 christos test_h_gr32 byte_dst-1, er1
200 1.1 christos test_gr_a5a5 2
201 1.1 christos test_gr_a5a5 3
202 1.1 christos test_gr_a5a5 4
203 1.1 christos test_gr_a5a5 5
204 1.1 christos test_gr_a5a5 6
205 1.1 christos test_gr_a5a5 7
206 1.1 christos
207 1.1 christos ;; Now check the result of the move to memory.
208 1.1 christos cmp.b #0xa5, @byte_dst
209 1.1 christos beq .Lnext3
210 1.1 christos fail
211 1.1 christos .Lnext3:
212 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
213 1.1 christos
214 1.1 christos mov_b_imm8_to_preinc: ; pre-increment from register to mem
215 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
216 1.1 christos set_ccr_zero
217 1.1 christos
218 1.1 christos ;; mov.b #xx:8, @+erd
219 1.1 christos mov.l #byte_dst-1, er1
220 1.1 christos mov.b #0xa5:8, @+er1 ; Imm8, register pre-incr operands
221 1.1 christos ;;; .word 0x017d
222 1.1 christos ;;; .word 0x91a5
223 1.1 christos
224 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
225 1.1 christos test_neg_set
226 1.1 christos test_zero_clear
227 1.1 christos test_ovf_clear
228 1.1 christos test_carry_clear
229 1.1 christos
230 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
231 1.1 christos test_h_gr32 byte_dst, er1
232 1.1 christos test_gr_a5a5 2
233 1.1 christos test_gr_a5a5 3
234 1.1 christos test_gr_a5a5 4
235 1.1 christos test_gr_a5a5 5
236 1.1 christos test_gr_a5a5 6
237 1.1 christos test_gr_a5a5 7
238 1.1 christos
239 1.1 christos ;; Now check the result of the move to memory.
240 1.1 christos cmp.b #0xa5, @byte_dst
241 1.1 christos beq .Lnext4
242 1.1 christos fail
243 1.1 christos .Lnext4:
244 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
245 1.1 christos
246 1.1 christos mov_b_imm8_to_predec: ; pre-decrement from register to mem
247 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
248 1.1 christos set_ccr_zero
249 1.1 christos
250 1.1 christos ;; mov.b #xx:8, @-erd
251 1.1 christos mov.l #byte_dst+1, er1
252 1.1 christos mov.b #0xa5:8, @-er1 ; Imm8, register pre-decr operands
253 1.1 christos ;;; .word 0x017d
254 1.1 christos ;;; .word 0xb1a5
255 1.1 christos
256 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
257 1.1 christos test_neg_set
258 1.1 christos test_zero_clear
259 1.1 christos test_ovf_clear
260 1.1 christos test_carry_clear
261 1.1 christos
262 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
263 1.1 christos test_h_gr32 byte_dst, er1
264 1.1 christos test_gr_a5a5 2
265 1.1 christos test_gr_a5a5 3
266 1.1 christos test_gr_a5a5 4
267 1.1 christos test_gr_a5a5 5
268 1.1 christos test_gr_a5a5 6
269 1.1 christos test_gr_a5a5 7
270 1.1 christos
271 1.1 christos ;; Now check the result of the move to memory.
272 1.1 christos cmp.b #0xa5, @byte_dst
273 1.1 christos beq .Lnext5
274 1.1 christos fail
275 1.1 christos .Lnext5:
276 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
277 1.1 christos
278 1.1 christos mov_b_imm8_to_disp2:
279 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
280 1.1 christos set_ccr_zero
281 1.1 christos
282 1.1 christos ;; mov.b #xx:8, @(dd:2, erd)
283 1.1 christos mov.l #byte_dst-3, er1
284 1.1 christos mov.b #0xa5:8, @(3:2, er1) ; Imm8, reg plus 2-bit disp. operand
285 1.1 christos ;;; .word 0x017d
286 1.1 christos ;;; .word 0x31a5
287 1.1 christos
288 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
289 1.1 christos test_neg_set
290 1.1 christos test_zero_clear
291 1.1 christos test_ovf_clear
292 1.1 christos test_carry_clear
293 1.1 christos
294 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
295 1.1 christos test_h_gr32 byte_dst-3, er1
296 1.1 christos test_gr_a5a5 2
297 1.1 christos test_gr_a5a5 3
298 1.1 christos test_gr_a5a5 4
299 1.1 christos test_gr_a5a5 5
300 1.1 christos test_gr_a5a5 6
301 1.1 christos test_gr_a5a5 7
302 1.1 christos
303 1.1 christos ;; Now check the result of the move to memory.
304 1.1 christos cmp.b #0xa5, @byte_dst
305 1.1 christos beq .Lnext6
306 1.1 christos fail
307 1.1 christos .Lnext6:
308 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
309 1.1 christos
310 1.1 christos mov_b_imm8_to_disp16:
311 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
312 1.1 christos set_ccr_zero
313 1.1 christos
314 1.1 christos ;; mov.b #xx:8, @(dd:16, erd)
315 1.1 christos mov.l #byte_dst-4, er1
316 1.1 christos mov.b #0xa5:8, @(4:16, er1) ; Register plus 16-bit disp. operand
317 1.1 christos ;;; .word 0x017d
318 1.1 christos ;;; .word 0x6f90
319 1.1 christos ;;; .word 0x0004
320 1.1 christos
321 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
322 1.1 christos test_neg_set
323 1.1 christos test_zero_clear
324 1.1 christos test_ovf_clear
325 1.1 christos test_carry_clear
326 1.1 christos
327 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
328 1.1 christos test_h_gr32 byte_dst-4, er1
329 1.1 christos test_gr_a5a5 2
330 1.1 christos test_gr_a5a5 3
331 1.1 christos test_gr_a5a5 4
332 1.1 christos test_gr_a5a5 5
333 1.1 christos test_gr_a5a5 6
334 1.1 christos test_gr_a5a5 7
335 1.1 christos
336 1.1 christos ;; Now check the result of the move to memory.
337 1.1 christos cmp.b #0xa5, @byte_dst
338 1.1 christos beq .Lnext7
339 1.1 christos fail
340 1.1 christos .Lnext7:
341 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
342 1.1 christos
343 1.1 christos mov_b_imm8_to_disp32:
344 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
345 1.1 christos set_ccr_zero
346 1.1 christos
347 1.1 christos ;; mov.b #xx:8, @(dd:32, erd)
348 1.1 christos mov.l #byte_dst-8, er1
349 1.1 christos mov.b #0xa5:8, @(8:32, er1) ; Register plus 32-bit disp. operand
350 1.1 christos ;;; .word 0x017d
351 1.1 christos ;;; .word 0xc9a5
352 1.1 christos ;;; .long 8
353 1.1 christos
354 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
355 1.1 christos test_neg_set
356 1.1 christos test_zero_clear
357 1.1 christos test_ovf_clear
358 1.1 christos test_carry_clear
359 1.1 christos
360 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
361 1.1 christos test_h_gr32 byte_dst-8, er1
362 1.1 christos test_gr_a5a5 2
363 1.1 christos test_gr_a5a5 3
364 1.1 christos test_gr_a5a5 4
365 1.1 christos test_gr_a5a5 5
366 1.1 christos test_gr_a5a5 6
367 1.1 christos test_gr_a5a5 7
368 1.1 christos
369 1.1 christos ;; Now check the result of the move to memory.
370 1.1 christos cmp.b #0xa5, @byte_dst
371 1.1 christos beq .Lnext8
372 1.1 christos fail
373 1.1 christos .Lnext8:
374 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
375 1.1 christos
376 1.1 christos mov_b_imm8_to_indexb16:
377 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
378 1.1 christos mov.l #0xffffff01, er1
379 1.1 christos set_ccr_zero
380 1.1 christos ;; mov.b #xx:8, @(dd:16, rd.b)
381 1.1 christos mov.b #0xa5:8, @(byte_dst-1:16, r1.b) ; byte indexed operand
382 1.1 christos
383 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
384 1.1 christos test_neg_set
385 1.1 christos test_zero_clear
386 1.1 christos test_ovf_clear
387 1.1 christos test_carry_clear
388 1.1 christos
389 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
390 1.1 christos test_h_gr32 0xffffff01, er1
391 1.1 christos test_gr_a5a5 2
392 1.1 christos test_gr_a5a5 3
393 1.1 christos test_gr_a5a5 4
394 1.1 christos test_gr_a5a5 5
395 1.1 christos test_gr_a5a5 6
396 1.1 christos test_gr_a5a5 7
397 1.1 christos
398 1.1 christos ;; Now check the result of the move to memory.
399 1.1 christos cmp.b #0xa5, @byte_dst
400 1.1 christos bne fail1
401 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
402 1.1 christos
403 1.1 christos mov_b_imm8_to_indexw16:
404 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
405 1.1 christos mov.l #0xffff0002, er1
406 1.1 christos set_ccr_zero
407 1.1 christos ;; mov.b #xx:8, @(dd:16, rd.w)
408 1.1 christos mov.b #0xa5:8, @(byte_dst-2:16, r1.w) ; byte indexed operand
409 1.1 christos
410 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
411 1.1 christos test_neg_set
412 1.1 christos test_zero_clear
413 1.1 christos test_ovf_clear
414 1.1 christos test_carry_clear
415 1.1 christos
416 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
417 1.1 christos test_h_gr32 0xffff0002, er1
418 1.1 christos test_gr_a5a5 2
419 1.1 christos test_gr_a5a5 3
420 1.1 christos test_gr_a5a5 4
421 1.1 christos test_gr_a5a5 5
422 1.1 christos test_gr_a5a5 6
423 1.1 christos test_gr_a5a5 7
424 1.1 christos
425 1.1 christos ;; Now check the result of the move to memory.
426 1.1 christos cmp.b #0xa5, @byte_dst
427 1.1 christos bne fail1
428 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
429 1.1 christos
430 1.1 christos mov_b_imm8_to_indexl16:
431 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
432 1.1 christos mov.l #0x00000003, er1
433 1.1 christos set_ccr_zero
434 1.1 christos ;; mov.b #xx:8, @(dd:16, erd.l)
435 1.1 christos mov.b #0xa5:8, @(byte_dst-3:16, er1.l) ; byte indexed operand
436 1.1 christos
437 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
438 1.1 christos test_neg_set
439 1.1 christos test_zero_clear
440 1.1 christos test_ovf_clear
441 1.1 christos test_carry_clear
442 1.1 christos
443 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
444 1.1 christos test_h_gr32 0x00000003, er1
445 1.1 christos test_gr_a5a5 2
446 1.1 christos test_gr_a5a5 3
447 1.1 christos test_gr_a5a5 4
448 1.1 christos test_gr_a5a5 5
449 1.1 christos test_gr_a5a5 6
450 1.1 christos test_gr_a5a5 7
451 1.1 christos
452 1.1 christos ;; Now check the result of the move to memory.
453 1.1 christos cmp.b #0xa5, @byte_dst
454 1.1 christos bne fail1
455 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
456 1.1 christos
457 1.1 christos mov_b_imm8_to_indexb32:
458 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
459 1.1 christos mov.l #0xffffff04, er1
460 1.1 christos set_ccr_zero
461 1.1 christos ;; mov.b #xx:8, @(dd:32, rd.b)
462 1.1 christos mov.b #0xa5:8, @(byte_dst-4:32, r1.b) ; byte indexed operand
463 1.1 christos
464 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
465 1.1 christos test_neg_set
466 1.1 christos test_zero_clear
467 1.1 christos test_ovf_clear
468 1.1 christos test_carry_clear
469 1.1 christos
470 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
471 1.1 christos test_h_gr32 0xffffff04 er1
472 1.1 christos test_gr_a5a5 2
473 1.1 christos test_gr_a5a5 3
474 1.1 christos test_gr_a5a5 4
475 1.1 christos test_gr_a5a5 5
476 1.1 christos test_gr_a5a5 6
477 1.1 christos test_gr_a5a5 7
478 1.1 christos
479 1.1 christos ;; Now check the result of the move to memory.
480 1.1 christos cmp.b #0xa5, @byte_dst
481 1.1 christos bne fail1
482 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
483 1.1 christos
484 1.1 christos mov_b_imm8_to_indexw32:
485 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
486 1.1 christos mov.l #0xffff0005, er1
487 1.1 christos set_ccr_zero
488 1.1 christos ;; mov.b #xx:8, @(dd:32, rd.w)
489 1.1 christos mov.b #0xa5:8, @(byte_dst-5:32, r1.w) ; byte indexed operand
490 1.1 christos
491 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
492 1.1 christos test_neg_set
493 1.1 christos test_zero_clear
494 1.1 christos test_ovf_clear
495 1.1 christos test_carry_clear
496 1.1 christos
497 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
498 1.1 christos test_h_gr32 0xffff0005 er1
499 1.1 christos test_gr_a5a5 2
500 1.1 christos test_gr_a5a5 3
501 1.1 christos test_gr_a5a5 4
502 1.1 christos test_gr_a5a5 5
503 1.1 christos test_gr_a5a5 6
504 1.1 christos test_gr_a5a5 7
505 1.1 christos
506 1.1 christos ;; Now check the result of the move to memory.
507 1.1 christos cmp.b #0xa5, @byte_dst
508 1.1 christos bne fail1
509 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
510 1.1 christos
511 1.1 christos mov_b_imm8_to_indexl32:
512 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
513 1.1 christos mov.l #0x00000006, er1
514 1.1 christos set_ccr_zero
515 1.1 christos ;; mov.b #xx:8, @(dd:32, erd.l)
516 1.1 christos mov.b #0xa5:8, @(byte_dst-6:32, er1.l) ; byte indexed operand
517 1.1 christos
518 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
519 1.1 christos test_neg_set
520 1.1 christos test_zero_clear
521 1.1 christos test_ovf_clear
522 1.1 christos test_carry_clear
523 1.1 christos
524 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
525 1.1 christos test_h_gr32 0x00000006 er1
526 1.1 christos test_gr_a5a5 2
527 1.1 christos test_gr_a5a5 3
528 1.1 christos test_gr_a5a5 4
529 1.1 christos test_gr_a5a5 5
530 1.1 christos test_gr_a5a5 6
531 1.1 christos test_gr_a5a5 7
532 1.1 christos
533 1.1 christos ;; Now check the result of the move to memory.
534 1.1 christos cmp.b #0xa5, @byte_dst
535 1.1 christos bne fail1
536 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
537 1.1 christos
538 1.1 christos mov_b_imm8_to_abs16:
539 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
540 1.1 christos set_ccr_zero
541 1.1 christos
542 1.1 christos ;; mov.b #xx:8, @aa:16
543 1.1 christos mov.b #0xa5:8, @byte_dst:16 ; 16-bit address-direct operand
544 1.1 christos ;;; .word 0x017d
545 1.1 christos ;;; .word 0x40a5
546 1.1 christos ;;; .word @byte_dst
547 1.1 christos
548 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
549 1.1 christos test_neg_set
550 1.1 christos test_zero_clear
551 1.1 christos test_ovf_clear
552 1.1 christos test_carry_clear
553 1.1 christos
554 1.1 christos test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
555 1.1 christos test_gr_a5a5 1 ; (first, because on h8/300 we must use one
556 1.1 christos test_gr_a5a5 2 ; to examine the destination memory).
557 1.1 christos test_gr_a5a5 3
558 1.1 christos test_gr_a5a5 4
559 1.1 christos test_gr_a5a5 5
560 1.1 christos test_gr_a5a5 6
561 1.1 christos test_gr_a5a5 7
562 1.1 christos
563 1.1 christos ;; Now check the result of the move to memory.
564 1.1 christos cmp.b #0xa5, @byte_dst
565 1.1 christos beq .Lnext9
566 1.1 christos fail
567 1.1 christos .Lnext9:
568 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
569 1.1 christos
570 1.1 christos mov_b_imm8_to_abs32:
571 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
572 1.1 christos set_ccr_zero
573 1.1 christos
574 1.1 christos ;; mov.b #xx:8, @aa:32
575 1.1 christos mov.b #0xa5:8, @byte_dst:32 ; 32-bit address-direct operand
576 1.1 christos ;;; .word 0x017d
577 1.1 christos ;;; .word 0x48a5
578 1.1 christos ;;; .long @byte_dst
579 1.1 christos
580 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
581 1.1 christos test_neg_set
582 1.1 christos test_zero_clear
583 1.1 christos test_ovf_clear
584 1.1 christos test_carry_clear
585 1.1 christos
586 1.1 christos test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
587 1.1 christos test_gr_a5a5 1 ; (first, because on h8/300 we must use one
588 1.1 christos test_gr_a5a5 2 ; to examine the destination memory).
589 1.1 christos test_gr_a5a5 3
590 1.1 christos test_gr_a5a5 4
591 1.1 christos test_gr_a5a5 5
592 1.1 christos test_gr_a5a5 6
593 1.1 christos test_gr_a5a5 7
594 1.1 christos
595 1.1 christos ;; Now check the result of the move to memory.
596 1.1 christos cmp.b #0xa5, @byte_dst
597 1.1 christos beq .Lnext10
598 1.1 christos fail
599 1.1 christos .Lnext10:
600 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
601 1.1 christos
602 1.1 christos .endif
603 1.1 christos
604 1.1 christos ;;
605 1.1 christos ;; Move byte from register source
606 1.1 christos ;;
607 1.1 christos
608 1.1 christos mov_b_reg8_to_reg8:
609 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
610 1.1 christos set_ccr_zero
611 1.1 christos
612 1.1 christos ;; mov.b ers, erd
613 1.1 christos mov.b #0x12, r1l
614 1.1 christos mov.b r1l, r0l ; Register 8-bit operand
615 1.1 christos ;;; .word 0x0c98
616 1.1 christos
617 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
618 1.1 christos test_neg_clear
619 1.1 christos test_zero_clear
620 1.1 christos test_ovf_clear
621 1.1 christos test_carry_clear
622 1.1 christos test_h_gr16 0xa512 r0
623 1.1 christos test_h_gr16 0xa512 r1 ; mov src unchanged
624 1.1 christos .if (sim_cpu)
625 1.1 christos test_h_gr32 0xa5a5a512 er0
626 1.1 christos test_h_gr32 0xa5a5a512 er1 ; mov src unchanged
627 1.1 christos .endif
628 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
629 1.1 christos test_gr_a5a5 3
630 1.1 christos test_gr_a5a5 4
631 1.1 christos test_gr_a5a5 5
632 1.1 christos test_gr_a5a5 6
633 1.1 christos test_gr_a5a5 7
634 1.1 christos
635 1.1 christos
636 1.1 christos mov_b_reg8_to_indirect:
637 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
638 1.1 christos set_ccr_zero
639 1.1 christos
640 1.1 christos ;; mov.b ers, @erd
641 1.1 christos mov.l #byte_dst, er1
642 1.1 christos mov.b r0l, @er1 ; Register indirect operand
643 1.1 christos ;;; .word 0x6898
644 1.1 christos
645 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
646 1.1 christos test_neg_set
647 1.1 christos test_zero_clear
648 1.1 christos test_ovf_clear
649 1.1 christos test_carry_clear
650 1.1 christos
651 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
652 1.1 christos test_h_gr32 byte_dst, er1
653 1.1 christos test_gr_a5a5 2
654 1.1 christos test_gr_a5a5 3
655 1.1 christos test_gr_a5a5 4
656 1.1 christos test_gr_a5a5 5
657 1.1 christos test_gr_a5a5 6
658 1.1 christos test_gr_a5a5 7
659 1.1 christos
660 1.1 christos ;; Now check the result of the move to memory.
661 1.1 christos mov.b @byte_dst, r0l
662 1.1 christos cmp.b r2l, r0l
663 1.1 christos beq .Lnext44
664 1.1 christos fail
665 1.1 christos .Lnext44:
666 1.1 christos mov.b #0, r0l
667 1.1 christos mov.b r0l, @byte_dst ; zero it again for the next use.
668 1.1 christos
669 1.1 christos .if (sim_cpu == h8sx)
670 1.1 christos mov_b_reg8_to_postinc: ; post-increment from register to mem
671 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
672 1.1 christos set_ccr_zero
673 1.1 christos
674 1.1 christos ;; mov.b ers, @erd+
675 1.1 christos mov.l #byte_dst, er1
676 1.1 christos mov.b r0l, @er1+ ; Register post-incr operand
677 1.1 christos ;;; .word 0x0173
678 1.1 christos ;;; .word 0x6c98
679 1.1 christos
680 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
681 1.1 christos test_neg_set
682 1.1 christos test_zero_clear
683 1.1 christos test_ovf_clear
684 1.1 christos test_carry_clear
685 1.1 christos
686 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
687 1.1 christos test_h_gr32 byte_dst+1, er1
688 1.1 christos test_gr_a5a5 2
689 1.1 christos test_gr_a5a5 3
690 1.1 christos test_gr_a5a5 4
691 1.1 christos test_gr_a5a5 5
692 1.1 christos test_gr_a5a5 6
693 1.1 christos test_gr_a5a5 7
694 1.1 christos
695 1.1 christos ;; Now check the result of the move to memory.
696 1.1 christos cmp.b r2l, @byte_dst
697 1.1 christos beq .Lnext49
698 1.1 christos fail
699 1.1 christos .Lnext49:
700 1.1 christos ;; special case same register
701 1.1 christos mov.l #byte_dst, er0
702 1.1 christos mov.b r0l, r1l
703 1.1 christos inc.b r1l
704 1.1 christos mov.b r0l, @er0+
705 1.1 christos mov.b @byte_dst, r0l
706 1.1 christos cmp.b r0l, r1l
707 1.1 christos beq .Lnext53
708 1.1 christos fail
709 1.1 christos .Lnext53:
710 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
711 1.1 christos
712 1.1 christos mov_b_reg8_to_postdec: ; post-decrement from register to mem
713 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
714 1.1 christos set_ccr_zero
715 1.1 christos
716 1.1 christos ;; mov.b ers, @erd-
717 1.1 christos mov.l #byte_dst, er1
718 1.1 christos mov.b r0l, @er1- ; Register post-decr operand
719 1.1 christos ;;; .word 0x0171
720 1.1 christos ;;; .word 0x6c98
721 1.1 christos
722 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
723 1.1 christos test_neg_set
724 1.1 christos test_zero_clear
725 1.1 christos test_ovf_clear
726 1.1 christos test_carry_clear
727 1.1 christos
728 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
729 1.1 christos test_h_gr32 byte_dst-1, er1
730 1.1 christos test_gr_a5a5 2
731 1.1 christos test_gr_a5a5 3
732 1.1 christos test_gr_a5a5 4
733 1.1 christos test_gr_a5a5 5
734 1.1 christos test_gr_a5a5 6
735 1.1 christos test_gr_a5a5 7
736 1.1 christos
737 1.1 christos ;; Now check the result of the move to memory.
738 1.1 christos cmp.b r2l, @byte_dst
739 1.1 christos beq .Lnext50
740 1.1 christos fail
741 1.1 christos .Lnext50:
742 1.1 christos ;; special case same register
743 1.1 christos mov.l #byte_dst, er0
744 1.1 christos mov.b r0l, r1l
745 1.1 christos dec.b r1l
746 1.1 christos mov.b r0l, @er0-
747 1.1 christos mov.b @byte_dst, r0l
748 1.1 christos cmp.b r0l, r1l
749 1.1 christos beq .Lnext54
750 1.1 christos fail
751 1.1 christos .Lnext54:
752 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
753 1.1 christos
754 1.1 christos mov_b_reg8_to_preinc: ; pre-increment from register to mem
755 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
756 1.1 christos set_ccr_zero
757 1.1 christos
758 1.1 christos ;; mov.b ers, @+erd
759 1.1 christos mov.l #byte_dst-1, er1
760 1.1 christos mov.b r0l, @+er1 ; Register pre-incr operand
761 1.1 christos ;;; .word 0x0172
762 1.1 christos ;;; .word 0x6c98
763 1.1 christos
764 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
765 1.1 christos test_neg_set
766 1.1 christos test_zero_clear
767 1.1 christos test_ovf_clear
768 1.1 christos test_carry_clear
769 1.1 christos
770 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
771 1.1 christos test_h_gr32 byte_dst, er1
772 1.1 christos test_gr_a5a5 2
773 1.1 christos test_gr_a5a5 3
774 1.1 christos test_gr_a5a5 4
775 1.1 christos test_gr_a5a5 5
776 1.1 christos test_gr_a5a5 6
777 1.1 christos test_gr_a5a5 7
778 1.1 christos
779 1.1 christos ;; Now check the result of the move to memory.
780 1.1 christos cmp.b r2l, @byte_dst
781 1.1 christos beq .Lnext51
782 1.1 christos fail
783 1.1 christos .Lnext51:
784 1.1 christos ;; special case same register
785 1.1 christos mov.l #byte_dst-1, er0
786 1.1 christos mov.b r0l, r1l
787 1.1 christos inc.b r1l
788 1.1 christos mov.b r0l, @+er0
789 1.1 christos mov.b @byte_dst, r0l
790 1.1 christos cmp.b r0l, r1l
791 1.1 christos beq .Lnext55
792 1.1 christos fail
793 1.1 christos .Lnext55:
794 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
795 1.1 christos .endif
796 1.1 christos
797 1.1 christos mov_b_reg8_to_predec: ; pre-decrement from register to mem
798 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
799 1.1 christos set_ccr_zero
800 1.1 christos
801 1.1 christos ;; mov.b ers, @-erd
802 1.1 christos mov.l #byte_dst+1, er1
803 1.1 christos mov.b r0l, @-er1 ; Register pre-decr operand
804 1.1 christos ;;; .word 0x6c98
805 1.1 christos
806 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
807 1.1 christos test_neg_set
808 1.1 christos test_zero_clear
809 1.1 christos test_ovf_clear
810 1.1 christos test_carry_clear
811 1.1 christos
812 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
813 1.1 christos test_h_gr32 byte_dst, er1
814 1.1 christos test_gr_a5a5 2
815 1.1 christos test_gr_a5a5 3
816 1.1 christos test_gr_a5a5 4
817 1.1 christos test_gr_a5a5 5
818 1.1 christos test_gr_a5a5 6
819 1.1 christos test_gr_a5a5 7
820 1.1 christos
821 1.1 christos ;; Now check the result of the move to memory.
822 1.1 christos mov.b @byte_dst, r0l
823 1.1 christos cmp.b r2l, r0l
824 1.1 christos beq .Lnext48
825 1.1 christos fail
826 1.1 christos .Lnext48:
827 1.1 christos ;; Special case in same register
828 1.1 christos ;; CCR confirmation omitted
829 1.1 christos mov.l #byte_dst+1, er1
830 1.1 christos mov.l er1, er0
831 1.1 christos dec.b r1l
832 1.1 christos mov.b r0l, @-er0
833 1.1 christos mov.b @byte_dst, r0l
834 1.1 christos cmp.b r1l, r0l
835 1.1 christos beq .Lnext47
836 1.1 christos fail
837 1.1 christos .Lnext47:
838 1.1 christos mov.b #0, r0l
839 1.1 christos mov.b r0l, @byte_dst ; zero it again for the next use.
840 1.1 christos
841 1.1 christos .if (sim_cpu == h8sx)
842 1.1 christos mov_b_reg8_to_disp2:
843 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
844 1.1 christos set_ccr_zero
845 1.1 christos
846 1.1 christos ;; mov.b ers, @(dd:2, erd)
847 1.1 christos mov.l #byte_dst-3, er1
848 1.1 christos mov.b r0l, @(3:2, er1) ; Register plus 2-bit disp. operand
849 1.1 christos ;;; .word 0x0173
850 1.1 christos ;;; .word 0x6898
851 1.1 christos
852 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
853 1.1 christos test_neg_set
854 1.1 christos test_zero_clear
855 1.1 christos test_ovf_clear
856 1.1 christos test_carry_clear
857 1.1 christos
858 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
859 1.1 christos test_h_gr32 byte_dst-3, er1
860 1.1 christos test_gr_a5a5 2
861 1.1 christos test_gr_a5a5 3
862 1.1 christos test_gr_a5a5 4
863 1.1 christos test_gr_a5a5 5
864 1.1 christos test_gr_a5a5 6
865 1.1 christos test_gr_a5a5 7
866 1.1 christos
867 1.1 christos ;; Now check the result of the move to memory.
868 1.1 christos cmp.b r2l, @byte_dst
869 1.1 christos beq .Lnext52
870 1.1 christos fail
871 1.1 christos .Lnext52:
872 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
873 1.1 christos .endif
874 1.1 christos
875 1.1 christos mov_b_reg8_to_disp16:
876 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
877 1.1 christos set_ccr_zero
878 1.1 christos
879 1.1 christos ;; mov.b ers, @(dd:16, erd)
880 1.1 christos mov.l #byte_dst-4, er1
881 1.1 christos mov.b r0l, @(4:16, er1) ; Register plus 16-bit disp. operand
882 1.1 christos ;;; .word 0x6e98
883 1.1 christos ;;; .word 0x0004
884 1.1 christos
885 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
886 1.1 christos test_neg_set
887 1.1 christos test_zero_clear
888 1.1 christos test_ovf_clear
889 1.1 christos test_carry_clear
890 1.1 christos
891 1.1 christos test_h_gr32 byte_dst-4, er1
892 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
893 1.1 christos test_gr_a5a5 2
894 1.1 christos test_gr_a5a5 3
895 1.1 christos test_gr_a5a5 4
896 1.1 christos test_gr_a5a5 5
897 1.1 christos test_gr_a5a5 6
898 1.1 christos test_gr_a5a5 7
899 1.1 christos
900 1.1 christos ;; Now check the result of the move to memory.
901 1.1 christos mov.b @byte_dst, r0l
902 1.1 christos cmp.b r2l, r0l
903 1.1 christos beq .Lnext45
904 1.1 christos fail
905 1.1 christos .Lnext45:
906 1.1 christos mov.b #0, r0l
907 1.1 christos mov.b r0l, @byte_dst ; zero it again for the next use.
908 1.1 christos
909 1.1 christos mov_b_reg8_to_disp32:
910 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
911 1.1 christos set_ccr_zero
912 1.1 christos
913 1.1 christos ;; mov.b ers, @(dd:32, erd)
914 1.1 christos mov.l #byte_dst-8, er1
915 1.1 christos mov.b r0l, @(8:32, er1) ; Register plus 32-bit disp. operand
916 1.1 christos ;;; .word 0x7810
917 1.1 christos ;;; .word 0x6aa8
918 1.1 christos ;;; .long 8
919 1.1 christos
920 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
921 1.1 christos test_neg_set
922 1.1 christos test_zero_clear
923 1.1 christos test_ovf_clear
924 1.1 christos test_carry_clear
925 1.1 christos
926 1.1 christos test_h_gr32 byte_dst-8, er1
927 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
928 1.1 christos test_gr_a5a5 2
929 1.1 christos test_gr_a5a5 3
930 1.1 christos test_gr_a5a5 4
931 1.1 christos test_gr_a5a5 5
932 1.1 christos test_gr_a5a5 6
933 1.1 christos test_gr_a5a5 7
934 1.1 christos
935 1.1 christos ;; Now check the result of the move to memory.
936 1.1 christos mov.b @byte_dst, r0l
937 1.1 christos cmp.b r2l, r0l
938 1.1 christos beq .Lnext46
939 1.1 christos fail
940 1.1 christos .Lnext46:
941 1.1 christos mov.b #0, r0l
942 1.1 christos mov.b r0l, @byte_dst ; zero it again for the next use.
943 1.1 christos
944 1.1 christos .if (sim_cpu == h8sx)
945 1.1 christos mov_b_reg8_to_indexb16:
946 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
947 1.1 christos mov.l #0xffffff01, er1
948 1.1 christos set_ccr_zero
949 1.1 christos ;; mov.b ers, @(dd:16, rd.b)
950 1.1 christos mov.b r0l, @(byte_dst-1:16, r1.b) ; byte indexed operand
951 1.1 christos
952 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
953 1.1 christos test_neg_set
954 1.1 christos test_zero_clear
955 1.1 christos test_ovf_clear
956 1.1 christos test_carry_clear
957 1.1 christos
958 1.1 christos test_h_gr32 0xffffff01 er1
959 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
960 1.1 christos test_gr_a5a5 2
961 1.1 christos test_gr_a5a5 3
962 1.1 christos test_gr_a5a5 4
963 1.1 christos test_gr_a5a5 5
964 1.1 christos test_gr_a5a5 6
965 1.1 christos test_gr_a5a5 7
966 1.1 christos
967 1.1 christos ;; Now check the result of the move to memory.
968 1.1 christos cmp.b @byte_dst, r0l
969 1.1 christos bne fail1
970 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
971 1.1 christos
972 1.1 christos mov_b_reg8_to_indexw16:
973 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
974 1.1 christos mov.l #0xffff0002, er1
975 1.1 christos set_ccr_zero
976 1.1 christos ;; mov.b ers, @(dd:16, rd.w)
977 1.1 christos mov.b r0l, @(byte_dst-2:16, r1.w) ; byte indexed operand
978 1.1 christos
979 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
980 1.1 christos test_neg_set
981 1.1 christos test_zero_clear
982 1.1 christos test_ovf_clear
983 1.1 christos test_carry_clear
984 1.1 christos
985 1.1 christos test_h_gr32 0xffff0002 er1
986 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
987 1.1 christos test_gr_a5a5 2
988 1.1 christos test_gr_a5a5 3
989 1.1 christos test_gr_a5a5 4
990 1.1 christos test_gr_a5a5 5
991 1.1 christos test_gr_a5a5 6
992 1.1 christos test_gr_a5a5 7
993 1.1 christos
994 1.1 christos ;; Now check the result of the move to memory.
995 1.1 christos cmp.b @byte_dst, r0l
996 1.1 christos bne fail1
997 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
998 1.1 christos
999 1.1 christos mov_b_reg8_to_indexl16:
1000 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1001 1.1 christos mov.l #0x00000003, er1
1002 1.1 christos set_ccr_zero
1003 1.1 christos ;; mov.b ers, @(dd:16, erd.l)
1004 1.1 christos mov.b r0l, @(byte_dst-3:16, er1.l) ; byte indexed operand
1005 1.1 christos
1006 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1007 1.1 christos test_neg_set
1008 1.1 christos test_zero_clear
1009 1.1 christos test_ovf_clear
1010 1.1 christos test_carry_clear
1011 1.1 christos
1012 1.1 christos test_h_gr32 0x00000003 er1
1013 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
1014 1.1 christos test_gr_a5a5 2
1015 1.1 christos test_gr_a5a5 3
1016 1.1 christos test_gr_a5a5 4
1017 1.1 christos test_gr_a5a5 5
1018 1.1 christos test_gr_a5a5 6
1019 1.1 christos test_gr_a5a5 7
1020 1.1 christos
1021 1.1 christos ;; Now check the result of the move to memory.
1022 1.1 christos cmp.b @byte_dst, r0l
1023 1.1 christos bne fail1
1024 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
1025 1.1 christos
1026 1.1 christos mov_b_reg8_to_indexb32:
1027 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1028 1.1 christos mov.l #0xffffff04 er1
1029 1.1 christos set_ccr_zero
1030 1.1 christos ;; mov.b ers, @(dd:32, rd.b)
1031 1.1 christos mov.b r0l, @(byte_dst-4:32, r1.b) ; byte indexed operand
1032 1.1 christos
1033 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1034 1.1 christos test_neg_set
1035 1.1 christos test_zero_clear
1036 1.1 christos test_ovf_clear
1037 1.1 christos test_carry_clear
1038 1.1 christos
1039 1.1 christos test_h_gr32 0xffffff04, er1
1040 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
1041 1.1 christos test_gr_a5a5 2
1042 1.1 christos test_gr_a5a5 3
1043 1.1 christos test_gr_a5a5 4
1044 1.1 christos test_gr_a5a5 5
1045 1.1 christos test_gr_a5a5 6
1046 1.1 christos test_gr_a5a5 7
1047 1.1 christos
1048 1.1 christos ;; Now check the result of the move to memory.
1049 1.1 christos cmp.b @byte_dst, r0l
1050 1.1 christos bne fail1
1051 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
1052 1.1 christos
1053 1.1 christos mov_b_reg8_to_indexw32:
1054 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1055 1.1 christos mov.l #0xffff0005 er1
1056 1.1 christos set_ccr_zero
1057 1.1 christos ;; mov.b ers, @(dd:32, rd.w)
1058 1.1 christos mov.b r0l, @(byte_dst-5:32, r1.w) ; byte indexed operand
1059 1.1 christos
1060 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1061 1.1 christos test_neg_set
1062 1.1 christos test_zero_clear
1063 1.1 christos test_ovf_clear
1064 1.1 christos test_carry_clear
1065 1.1 christos
1066 1.1 christos test_h_gr32 0xffff0005, er1
1067 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
1068 1.1 christos test_gr_a5a5 2
1069 1.1 christos test_gr_a5a5 3
1070 1.1 christos test_gr_a5a5 4
1071 1.1 christos test_gr_a5a5 5
1072 1.1 christos test_gr_a5a5 6
1073 1.1 christos test_gr_a5a5 7
1074 1.1 christos
1075 1.1 christos ;; Now check the result of the move to memory.
1076 1.1 christos cmp.b @byte_dst, r0l
1077 1.1 christos bne fail1
1078 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
1079 1.1 christos
1080 1.1 christos mov_b_reg8_to_indexl32:
1081 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1082 1.1 christos mov.l #0x00000006 er1
1083 1.1 christos set_ccr_zero
1084 1.1 christos ;; mov.b ers, @(dd:32, erd.l)
1085 1.1 christos mov.b r0l, @(byte_dst-6:32, er1.l) ; byte indexed operand
1086 1.1 christos
1087 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1088 1.1 christos test_neg_set
1089 1.1 christos test_zero_clear
1090 1.1 christos test_ovf_clear
1091 1.1 christos test_carry_clear
1092 1.1 christos
1093 1.1 christos test_h_gr32 0x00000006, er1
1094 1.1 christos test_gr_a5a5 0 ; Make sure other general regs not disturbed
1095 1.1 christos test_gr_a5a5 2
1096 1.1 christos test_gr_a5a5 3
1097 1.1 christos test_gr_a5a5 4
1098 1.1 christos test_gr_a5a5 5
1099 1.1 christos test_gr_a5a5 6
1100 1.1 christos test_gr_a5a5 7
1101 1.1 christos
1102 1.1 christos ;; Now check the result of the move to memory.
1103 1.1 christos cmp.b @byte_dst, r0l
1104 1.1 christos bne fail1
1105 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
1106 1.1 christos .endif
1107 1.1 christos
1108 1.1 christos .if (sim_cpu == h8sx)
1109 1.1 christos mov_b_reg8_to_abs8:
1110 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1111 1.1 christos
1112 1.1 christos mov.l #byte_dst-20, er0
1113 1.1 christos ldc er0, sbr
1114 1.1 christos set_ccr_zero
1115 1.1 christos ;; mov.b ers, @aa:8
1116 1.1 christos mov.b r1l, @20:8 ; 8-bit address-direct (sbr-relative) operand
1117 1.1 christos
1118 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1119 1.1 christos test_neg_set
1120 1.1 christos test_zero_clear
1121 1.1 christos test_ovf_clear
1122 1.1 christos test_carry_clear
1123 1.1 christos
1124 1.1 christos test_h_gr32 byte_dst-20, er0
1125 1.1 christos test_gr_a5a5 1 ; Make sure other general regs not disturbed
1126 1.1 christos test_gr_a5a5 2
1127 1.1 christos test_gr_a5a5 3
1128 1.1 christos test_gr_a5a5 4
1129 1.1 christos test_gr_a5a5 5
1130 1.1 christos test_gr_a5a5 6
1131 1.1 christos test_gr_a5a5 7
1132 1.1 christos
1133 1.1 christos ;; Now check the result of the move to memory.
1134 1.1 christos cmp.b @byte_dst, r1l
1135 1.1 christos bne fail1
1136 1.1 christos mov.b #0, @byte_dst ; zero it again for the next use.
1137 1.1 christos .endif
1138 1.1 christos
1139 1.1 christos mov_b_reg8_to_abs16:
1140 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1141 1.1 christos set_ccr_zero
1142 1.1 christos
1143 1.1 christos ;; mov.b ers, @aa:16
1144 1.1 christos mov.b r0l, @byte_dst:16 ; 16-bit address-direct operand
1145 1.1 christos ;;; .word 0x6a88
1146 1.1 christos ;;; .word @byte_dst
1147 1.1 christos
1148 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1149 1.1 christos test_neg_set
1150 1.1 christos test_zero_clear
1151 1.1 christos test_ovf_clear
1152 1.1 christos test_carry_clear
1153 1.1 christos
1154 1.1 christos test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1155 1.1 christos test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1156 1.1 christos test_gr_a5a5 2 ; to examine the destination memory).
1157 1.1 christos test_gr_a5a5 3
1158 1.1 christos test_gr_a5a5 4
1159 1.1 christos test_gr_a5a5 5
1160 1.1 christos test_gr_a5a5 6
1161 1.1 christos test_gr_a5a5 7
1162 1.1 christos
1163 1.1 christos ;; Now check the result of the move to memory.
1164 1.1 christos mov.b @byte_dst, r0l
1165 1.1 christos cmp.b r0l, r1l
1166 1.1 christos beq .Lnext41
1167 1.1 christos fail
1168 1.1 christos .Lnext41:
1169 1.1 christos mov.b #0, r0l
1170 1.1 christos mov.b r0l, @byte_dst ; zero it again for the next use.
1171 1.1 christos
1172 1.1 christos mov_b_reg8_to_abs32:
1173 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1174 1.1 christos set_ccr_zero
1175 1.1 christos
1176 1.1 christos ;; mov.b ers, @aa:32
1177 1.1 christos mov.b r0l, @byte_dst:32 ; 32-bit address-direct operand
1178 1.1 christos ;;; .word 0x6aa8
1179 1.1 christos ;;; .long @byte_dst
1180 1.1 christos
1181 1.1 christos ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1182 1.1 christos test_neg_set
1183 1.1 christos test_zero_clear
1184 1.1 christos test_ovf_clear
1185 1.1 christos test_carry_clear
1186 1.1 christos
1187 1.1 christos test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1188 1.1 christos test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1189 1.1 christos test_gr_a5a5 2 ; to examine the destination memory).
1190 1.1 christos test_gr_a5a5 3
1191 1.1 christos test_gr_a5a5 4
1192 1.1 christos test_gr_a5a5 5
1193 1.1 christos test_gr_a5a5 6
1194 1.1 christos test_gr_a5a5 7
1195 1.1 christos
1196 1.1 christos ;; Now check the result of the move to memory.
1197 1.1 christos mov.b @byte_dst, r0l
1198 1.1 christos cmp.b r0l, r1l
1199 1.1 christos beq .Lnext42
1200 1.1 christos fail
1201 1.1 christos .Lnext42:
1202 1.1 christos mov.b #0, r0l
1203 1.1 christos mov.b r0l, @byte_dst ; zero it again for the next use.
1204 1.1 christos
1205 1.1 christos ;;
1206 1.1 christos ;; Move byte to register destination.
1207 1.1 christos ;;
1208 1.1 christos
1209 1.1 christos mov_b_indirect_to_reg8:
1210 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1211 1.1 christos set_ccr_zero
1212 1.1 christos
1213 1.1 christos ;; mov.b @ers, rd
1214 1.1 christos mov.l #byte_src, er1
1215 1.1 christos mov.b @er1, r0l ; Register indirect operand
1216 1.1 christos ;;; .word 0x6818
1217 1.1 christos
1218 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1219 1.1 christos test_neg_clear
1220 1.1 christos test_zero_clear
1221 1.1 christos test_ovf_clear
1222 1.1 christos test_carry_clear
1223 1.1 christos
1224 1.1 christos test_h_gr32 0xa5a5a577 er0
1225 1.1 christos
1226 1.1 christos test_h_gr32 byte_src, er1
1227 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1228 1.1 christos test_gr_a5a5 3
1229 1.1 christos test_gr_a5a5 4
1230 1.1 christos test_gr_a5a5 5
1231 1.1 christos test_gr_a5a5 6
1232 1.1 christos test_gr_a5a5 7
1233 1.1 christos
1234 1.1 christos mov_b_postinc_to_reg8: ; post-increment from mem to register
1235 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1236 1.1 christos set_ccr_zero
1237 1.1 christos
1238 1.1 christos ;; mov.b @ers+, rd
1239 1.1 christos
1240 1.1 christos mov.l #byte_src, er1
1241 1.1 christos mov.b @er1+, r0l ; Register post-incr operand
1242 1.1 christos ;;; .word 0x6c18
1243 1.1 christos
1244 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1245 1.1 christos test_neg_clear
1246 1.1 christos test_zero_clear
1247 1.1 christos test_ovf_clear
1248 1.1 christos test_carry_clear
1249 1.1 christos
1250 1.1 christos test_h_gr32 0xa5a5a577 er0
1251 1.1 christos
1252 1.1 christos test_h_gr32 byte_src+1, er1
1253 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1254 1.1 christos test_gr_a5a5 3
1255 1.1 christos test_gr_a5a5 4
1256 1.1 christos test_gr_a5a5 5
1257 1.1 christos test_gr_a5a5 6
1258 1.1 christos test_gr_a5a5 7
1259 1.1 christos
1260 1.1 christos .if (sim_cpu == h8sx)
1261 1.1 christos mov_b_postdec_to_reg8: ; post-decrement from mem to register
1262 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1263 1.1 christos set_ccr_zero
1264 1.1 christos
1265 1.1 christos ;; mov.b @ers-, rd
1266 1.1 christos
1267 1.1 christos mov.l #byte_src, er1
1268 1.1 christos mov.b @er1-, r0l ; Register post-decr operand
1269 1.1 christos ;;; .word 0x0172
1270 1.1 christos ;;; .word 0x6c18
1271 1.1 christos
1272 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1273 1.1 christos test_neg_clear
1274 1.1 christos test_zero_clear
1275 1.1 christos test_ovf_clear
1276 1.1 christos test_carry_clear
1277 1.1 christos
1278 1.1 christos test_h_gr32 0xa5a5a577 er0
1279 1.1 christos
1280 1.1 christos test_h_gr32 byte_src-1, er1
1281 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1282 1.1 christos test_gr_a5a5 3
1283 1.1 christos test_gr_a5a5 4
1284 1.1 christos test_gr_a5a5 5
1285 1.1 christos test_gr_a5a5 6
1286 1.1 christos test_gr_a5a5 7
1287 1.1 christos
1288 1.1 christos mov_b_preinc_to_reg8: ; pre-increment from mem to register
1289 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1290 1.1 christos set_ccr_zero
1291 1.1 christos
1292 1.1 christos ;; mov.b @+ers, rd
1293 1.1 christos
1294 1.1 christos mov.l #byte_src-1, er1
1295 1.1 christos mov.b @+er1, r0l ; Register pre-incr operand
1296 1.1 christos ;;; .word 0x0171
1297 1.1 christos ;;; .word 0x6c18
1298 1.1 christos
1299 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1300 1.1 christos test_neg_clear
1301 1.1 christos test_zero_clear
1302 1.1 christos test_ovf_clear
1303 1.1 christos test_carry_clear
1304 1.1 christos
1305 1.1 christos test_h_gr32 0xa5a5a577 er0
1306 1.1 christos
1307 1.1 christos test_h_gr32 byte_src, er1
1308 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1309 1.1 christos test_gr_a5a5 3
1310 1.1 christos test_gr_a5a5 4
1311 1.1 christos test_gr_a5a5 5
1312 1.1 christos test_gr_a5a5 6
1313 1.1 christos test_gr_a5a5 7
1314 1.1 christos
1315 1.1 christos mov_b_predec_to_reg8: ; pre-decrement from mem to register
1316 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1317 1.1 christos set_ccr_zero
1318 1.1 christos
1319 1.1 christos ;; mov.b @-ers, rd
1320 1.1 christos
1321 1.1 christos mov.l #byte_src+1, er1
1322 1.1 christos mov.b @-er1, r0l ; Register pre-decr operand
1323 1.1 christos ;;; .word 0x0173
1324 1.1 christos ;;; .word 0x6c18
1325 1.1 christos
1326 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1327 1.1 christos test_neg_clear
1328 1.1 christos test_zero_clear
1329 1.1 christos test_ovf_clear
1330 1.1 christos test_carry_clear
1331 1.1 christos
1332 1.1 christos test_h_gr32 0xa5a5a577 er0
1333 1.1 christos
1334 1.1 christos test_h_gr32 byte_src, er1
1335 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1336 1.1 christos test_gr_a5a5 3
1337 1.1 christos test_gr_a5a5 4
1338 1.1 christos test_gr_a5a5 5
1339 1.1 christos test_gr_a5a5 6
1340 1.1 christos test_gr_a5a5 7
1341 1.1 christos
1342 1.1 christos
1343 1.1 christos mov_b_disp2_to_reg8:
1344 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1345 1.1 christos set_ccr_zero
1346 1.1 christos
1347 1.1 christos ;; mov.b @(dd:2, ers), rd
1348 1.1 christos mov.l #byte_src-1, er1
1349 1.1 christos mov.b @(1:2, er1), r0l ; Register plus 2-bit disp. operand
1350 1.1 christos ;;; .word 0x0171
1351 1.1 christos ;;; .word 0x6818
1352 1.1 christos
1353 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1354 1.1 christos test_neg_clear
1355 1.1 christos test_zero_clear
1356 1.1 christos test_ovf_clear
1357 1.1 christos test_carry_clear
1358 1.1 christos
1359 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1360 1.1 christos
1361 1.1 christos test_h_gr32 byte_src-1, er1
1362 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1363 1.1 christos test_gr_a5a5 3
1364 1.1 christos test_gr_a5a5 4
1365 1.1 christos test_gr_a5a5 5
1366 1.1 christos test_gr_a5a5 6
1367 1.1 christos test_gr_a5a5 7
1368 1.1 christos .endif
1369 1.1 christos
1370 1.1 christos mov_b_disp16_to_reg8:
1371 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1372 1.1 christos set_ccr_zero
1373 1.1 christos
1374 1.1 christos ;; mov.b @(dd:16, ers), rd
1375 1.1 christos mov.l #byte_src+0x1234, er1
1376 1.1 christos mov.b @(-0x1234:16, er1), r0l ; Register plus 16-bit disp. operand
1377 1.1 christos ;;; .word 0x6e18
1378 1.1 christos ;;; .word -0x1234
1379 1.1 christos
1380 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1381 1.1 christos test_neg_clear
1382 1.1 christos test_zero_clear
1383 1.1 christos test_ovf_clear
1384 1.1 christos test_carry_clear
1385 1.1 christos
1386 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1387 1.1 christos
1388 1.1 christos test_h_gr32 byte_src+0x1234, er1
1389 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1390 1.1 christos test_gr_a5a5 3
1391 1.1 christos test_gr_a5a5 4
1392 1.1 christos test_gr_a5a5 5
1393 1.1 christos test_gr_a5a5 6
1394 1.1 christos test_gr_a5a5 7
1395 1.1 christos
1396 1.1 christos mov_b_disp32_to_reg8:
1397 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1398 1.1 christos set_ccr_zero
1399 1.1 christos
1400 1.1 christos ;; mov.b @(dd:32, ers), rd
1401 1.1 christos mov.l #byte_src+65536, er1
1402 1.1 christos mov.b @(-65536:32, er1), r0l ; Register plus 32-bit disp. operand
1403 1.1 christos ;;; .word 0x7810
1404 1.1 christos ;;; .word 0x6a28
1405 1.1 christos ;;; .long -65536
1406 1.1 christos
1407 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1408 1.1 christos test_neg_clear
1409 1.1 christos test_zero_clear
1410 1.1 christos test_ovf_clear
1411 1.1 christos test_carry_clear
1412 1.1 christos
1413 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1414 1.1 christos
1415 1.1 christos test_h_gr32 byte_src+65536, er1
1416 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1417 1.1 christos test_gr_a5a5 3
1418 1.1 christos test_gr_a5a5 4
1419 1.1 christos test_gr_a5a5 5
1420 1.1 christos test_gr_a5a5 6
1421 1.1 christos test_gr_a5a5 7
1422 1.1 christos
1423 1.1 christos .if (sim_cpu == h8sx)
1424 1.1 christos mov_b_indexb16_to_reg8:
1425 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1426 1.1 christos mov.l #0xffffff01, er1
1427 1.1 christos set_ccr_zero
1428 1.1 christos ;; mov.b @(dd:16, rs.b), rd
1429 1.1 christos mov.b @(byte_src-1:16, r1.b), r0l ; indexed byte operand
1430 1.1 christos
1431 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1432 1.1 christos test_neg_clear
1433 1.1 christos test_zero_clear
1434 1.1 christos test_ovf_clear
1435 1.1 christos test_carry_clear
1436 1.1 christos
1437 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
1438 1.1 christos
1439 1.1 christos test_h_gr32 0xffffff01, er1
1440 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1441 1.1 christos test_gr_a5a5 3
1442 1.1 christos test_gr_a5a5 4
1443 1.1 christos test_gr_a5a5 5
1444 1.1 christos test_gr_a5a5 6
1445 1.1 christos test_gr_a5a5 7
1446 1.1 christos
1447 1.1 christos mov_b_indexw16_to_reg8:
1448 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1449 1.1 christos mov.l #0xffff0002, er1
1450 1.1 christos set_ccr_zero
1451 1.1 christos ;; mov.b @(dd:16, rs.w), rd
1452 1.1 christos mov.b @(byte_src-2:16, r1.w), r0l ; indexed byte operand
1453 1.1 christos
1454 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1455 1.1 christos test_neg_clear
1456 1.1 christos test_zero_clear
1457 1.1 christos test_ovf_clear
1458 1.1 christos test_carry_clear
1459 1.1 christos
1460 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
1461 1.1 christos
1462 1.1 christos test_h_gr32 0xffff0002, er1
1463 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1464 1.1 christos test_gr_a5a5 3
1465 1.1 christos test_gr_a5a5 4
1466 1.1 christos test_gr_a5a5 5
1467 1.1 christos test_gr_a5a5 6
1468 1.1 christos test_gr_a5a5 7
1469 1.1 christos
1470 1.1 christos mov_b_indexl16_to_reg8:
1471 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1472 1.1 christos mov.l #0x00000003, er1
1473 1.1 christos set_ccr_zero
1474 1.1 christos ;; mov.b @(dd:16, ers.l), rd
1475 1.1 christos mov.b @(byte_src-3:16, er1.l), r0l ; indexed byte operand
1476 1.1 christos
1477 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1478 1.1 christos test_neg_clear
1479 1.1 christos test_zero_clear
1480 1.1 christos test_ovf_clear
1481 1.1 christos test_carry_clear
1482 1.1 christos
1483 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
1484 1.1 christos
1485 1.1 christos test_h_gr32 0x00000003, er1
1486 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1487 1.1 christos test_gr_a5a5 3
1488 1.1 christos test_gr_a5a5 4
1489 1.1 christos test_gr_a5a5 5
1490 1.1 christos test_gr_a5a5 6
1491 1.1 christos test_gr_a5a5 7
1492 1.1 christos
1493 1.1 christos mov_b_indexb32_to_reg8:
1494 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1495 1.1 christos mov.l #0xffffff04, er1
1496 1.1 christos set_ccr_zero
1497 1.1 christos ;; mov.b @(dd:32, rs.b), rd
1498 1.1 christos mov.b @(byte_src-4:32, r1.b), r0l ; indexed byte operand
1499 1.1 christos
1500 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1501 1.1 christos test_neg_clear
1502 1.1 christos test_zero_clear
1503 1.1 christos test_ovf_clear
1504 1.1 christos test_carry_clear
1505 1.1 christos
1506 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1507 1.1 christos
1508 1.1 christos test_h_gr32 0xffffff04 er1
1509 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1510 1.1 christos test_gr_a5a5 3
1511 1.1 christos test_gr_a5a5 4
1512 1.1 christos test_gr_a5a5 5
1513 1.1 christos test_gr_a5a5 6
1514 1.1 christos test_gr_a5a5 7
1515 1.1 christos
1516 1.1 christos mov_b_indexw32_to_reg8:
1517 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1518 1.1 christos mov.l #0xffff0005, er1
1519 1.1 christos set_ccr_zero
1520 1.1 christos ;; mov.b @(dd:32, rs.w), rd
1521 1.1 christos mov.b @(byte_src-5:32, r1.w), r0l ; indexed byte operand
1522 1.1 christos
1523 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1524 1.1 christos test_neg_clear
1525 1.1 christos test_zero_clear
1526 1.1 christos test_ovf_clear
1527 1.1 christos test_carry_clear
1528 1.1 christos
1529 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1530 1.1 christos
1531 1.1 christos test_h_gr32 0xffff0005 er1
1532 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1533 1.1 christos test_gr_a5a5 3
1534 1.1 christos test_gr_a5a5 4
1535 1.1 christos test_gr_a5a5 5
1536 1.1 christos test_gr_a5a5 6
1537 1.1 christos test_gr_a5a5 7
1538 1.1 christos
1539 1.1 christos mov_b_indexl32_to_reg8:
1540 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1541 1.1 christos mov.l #0x00000006, er1
1542 1.1 christos set_ccr_zero
1543 1.1 christos ;; mov.b @(dd:32, ers.l), rd
1544 1.1 christos mov.b @(byte_src-6:32, er1.l), r0l ; indexed byte operand
1545 1.1 christos
1546 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1547 1.1 christos test_neg_clear
1548 1.1 christos test_zero_clear
1549 1.1 christos test_ovf_clear
1550 1.1 christos test_carry_clear
1551 1.1 christos
1552 1.1 christos test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1553 1.1 christos
1554 1.1 christos test_h_gr32 0x00000006 er1
1555 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1556 1.1 christos test_gr_a5a5 3
1557 1.1 christos test_gr_a5a5 4
1558 1.1 christos test_gr_a5a5 5
1559 1.1 christos test_gr_a5a5 6
1560 1.1 christos test_gr_a5a5 7
1561 1.1 christos
1562 1.1 christos .endif
1563 1.1 christos
1564 1.1 christos .if (sim_cpu == h8sx)
1565 1.1 christos mov_b_abs8_to_reg8:
1566 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1567 1.1 christos mov.l #byte_src-255, er1
1568 1.1 christos ldc er1, sbr
1569 1.1 christos set_ccr_zero
1570 1.1 christos ;; mov.b @aa:8, rd
1571 1.1 christos mov.b @0xff:8, r0l ; 8-bit (sbr relative) address-direct operand
1572 1.1 christos
1573 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1574 1.1 christos test_neg_clear
1575 1.1 christos test_zero_clear
1576 1.1 christos test_ovf_clear
1577 1.1 christos test_carry_clear
1578 1.1 christos
1579 1.1 christos test_h_gr32 0xa5a5a577 er0
1580 1.1 christos
1581 1.1 christos test_h_gr32 byte_src-255, er1
1582 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1583 1.1 christos test_gr_a5a5 3
1584 1.1 christos test_gr_a5a5 4
1585 1.1 christos test_gr_a5a5 5
1586 1.1 christos test_gr_a5a5 6
1587 1.1 christos test_gr_a5a5 7
1588 1.1 christos .endif
1589 1.1 christos
1590 1.1 christos mov_b_abs16_to_reg8:
1591 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1592 1.1 christos set_ccr_zero
1593 1.1 christos
1594 1.1 christos ;; mov.b @aa:16, rd
1595 1.1 christos mov.b @byte_src:16, r0l ; 16-bit address-direct operand
1596 1.1 christos ;;; .word 0x6a08
1597 1.1 christos ;;; .word @byte_src
1598 1.1 christos
1599 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1600 1.1 christos test_neg_clear
1601 1.1 christos test_zero_clear
1602 1.1 christos test_ovf_clear
1603 1.1 christos test_carry_clear
1604 1.1 christos
1605 1.1 christos test_h_gr32 0xa5a5a577 er0
1606 1.1 christos
1607 1.1 christos test_gr_a5a5 1 ; Make sure other general regs not disturbed
1608 1.1 christos test_gr_a5a5 2
1609 1.1 christos test_gr_a5a5 3
1610 1.1 christos test_gr_a5a5 4
1611 1.1 christos test_gr_a5a5 5
1612 1.1 christos test_gr_a5a5 6
1613 1.1 christos test_gr_a5a5 7
1614 1.1 christos
1615 1.1 christos mov_b_abs32_to_reg8:
1616 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1617 1.1 christos set_ccr_zero
1618 1.1 christos
1619 1.1 christos ;; mov.b @aa:32, rd
1620 1.1 christos mov.b @byte_src:32, r0l ; 32-bit address-direct operand
1621 1.1 christos ;;; .word 0x6a28
1622 1.1 christos ;;; .long @byte_src
1623 1.1 christos
1624 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1625 1.1 christos test_neg_clear
1626 1.1 christos test_zero_clear
1627 1.1 christos test_ovf_clear
1628 1.1 christos test_carry_clear
1629 1.1 christos
1630 1.1 christos test_h_gr32 0xa5a5a577 er0
1631 1.1 christos
1632 1.1 christos test_gr_a5a5 1 ; Make sure other general regs not disturbed
1633 1.1 christos test_gr_a5a5 2
1634 1.1 christos test_gr_a5a5 3
1635 1.1 christos test_gr_a5a5 4
1636 1.1 christos test_gr_a5a5 5
1637 1.1 christos test_gr_a5a5 6
1638 1.1 christos test_gr_a5a5 7
1639 1.1 christos
1640 1.1 christos .if (sim_cpu == h8sx)
1641 1.1 christos
1642 1.1 christos ;;
1643 1.1 christos ;; Move byte from memory to memory
1644 1.1 christos ;;
1645 1.1 christos
1646 1.1 christos mov_b_indirect_to_indirect: ; reg indirect, memory to memory
1647 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1648 1.1 christos set_ccr_zero
1649 1.1 christos
1650 1.1 christos ;; mov.b @ers, @erd
1651 1.1 christos
1652 1.1 christos mov.l #byte_src, er1
1653 1.1 christos mov.l #byte_dst, er0
1654 1.1 christos mov.b @er1, @er0
1655 1.1 christos ;;; .word 0x0178
1656 1.1 christos ;;; .word 0x0100
1657 1.1 christos
1658 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1659 1.1 christos test_neg_clear
1660 1.1 christos test_zero_clear
1661 1.1 christos test_ovf_clear
1662 1.1 christos test_carry_clear
1663 1.1 christos
1664 1.1 christos ;; Verify the affected registers.
1665 1.1 christos
1666 1.1 christos test_h_gr32 byte_dst er0
1667 1.1 christos test_h_gr32 byte_src er1
1668 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1669 1.1 christos test_gr_a5a5 3
1670 1.1 christos test_gr_a5a5 4
1671 1.1 christos test_gr_a5a5 5
1672 1.1 christos test_gr_a5a5 6
1673 1.1 christos test_gr_a5a5 7
1674 1.1 christos
1675 1.1 christos ;; Now check the result of the move to memory.
1676 1.1 christos cmp.b @byte_src, @byte_dst
1677 1.1 christos beq .Lnext56
1678 1.1 christos fail
1679 1.1 christos .Lnext56:
1680 1.1 christos ;; Now clear the destination location, and verify that.
1681 1.1 christos mov.b #0, @byte_dst
1682 1.1 christos cmp.b @byte_src, @byte_dst
1683 1.1 christos bne .Lnext57
1684 1.1 christos fail
1685 1.1 christos .Lnext57: ; OK, pass on.
1686 1.1 christos
1687 1.1 christos mov_b_postinc_to_postinc: ; reg post-increment, memory to memory
1688 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1689 1.1 christos set_ccr_zero
1690 1.1 christos
1691 1.1 christos ;; mov.b @ers+, @erd+
1692 1.1 christos
1693 1.1 christos mov.l #byte_src, er1
1694 1.1 christos mov.l #byte_dst, er0
1695 1.1 christos mov.b @er1+, @er0+
1696 1.1 christos ;;; .word 0x0178
1697 1.1 christos ;;; .word 0x8180
1698 1.1 christos
1699 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1700 1.1 christos test_neg_clear
1701 1.1 christos test_zero_clear
1702 1.1 christos test_ovf_clear
1703 1.1 christos test_carry_clear
1704 1.1 christos
1705 1.1 christos ;; Verify the affected registers.
1706 1.1 christos
1707 1.1 christos test_h_gr32 byte_dst+1 er0
1708 1.1 christos test_h_gr32 byte_src+1 er1
1709 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1710 1.1 christos test_gr_a5a5 3
1711 1.1 christos test_gr_a5a5 4
1712 1.1 christos test_gr_a5a5 5
1713 1.1 christos test_gr_a5a5 6
1714 1.1 christos test_gr_a5a5 7
1715 1.1 christos
1716 1.1 christos ;; Now check the result of the move to memory.
1717 1.1 christos cmp.b @byte_src, @byte_dst
1718 1.1 christos beq .Lnext65
1719 1.1 christos fail
1720 1.1 christos .Lnext65:
1721 1.1 christos ;; Now clear the destination location, and verify that.
1722 1.1 christos mov.b #0, @byte_dst
1723 1.1 christos cmp.b @byte_src, @byte_dst
1724 1.1 christos bne .Lnext66
1725 1.1 christos fail
1726 1.1 christos .Lnext66: ; OK, pass on.
1727 1.1 christos ;; special case same register
1728 1.1 christos mov.l #byte_src, er0
1729 1.1 christos mov.b @er0+, @er0+ ; copying byte_src to byte_dst
1730 1.1 christos test_h_gr32 byte_src+2 er0
1731 1.1 christos cmp.b @byte_src, @byte_dst
1732 1.1 christos beq .Lnext67
1733 1.1 christos fail
1734 1.1 christos .Lnext67:
1735 1.1 christos ;; Now clear the destination location, and verify that.
1736 1.1 christos mov.b #0, @byte_dst
1737 1.1 christos cmp.b @byte_src, @byte_dst
1738 1.1 christos bne .Lnext68
1739 1.1 christos fail
1740 1.1 christos .Lnext68:
1741 1.1 christos
1742 1.1 christos mov_b_postdec_to_postdec: ; reg post-decrement, memory to memory
1743 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1744 1.1 christos set_ccr_zero
1745 1.1 christos
1746 1.1 christos ;; mov.b @ers-, @erd-
1747 1.1 christos
1748 1.1 christos mov.l #byte_src, er1
1749 1.1 christos mov.l #byte_dst, er0
1750 1.1 christos mov.b @er1-, @er0-
1751 1.1 christos ;;; .word 0x0178
1752 1.1 christos ;;; .word 0xa1a0
1753 1.1 christos
1754 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1755 1.1 christos test_neg_clear
1756 1.1 christos test_zero_clear
1757 1.1 christos test_ovf_clear
1758 1.1 christos test_carry_clear
1759 1.1 christos
1760 1.1 christos ;; Verify the affected registers.
1761 1.1 christos
1762 1.1 christos test_h_gr32 byte_dst-1 er0
1763 1.1 christos test_h_gr32 byte_src-1 er1
1764 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1765 1.1 christos test_gr_a5a5 3
1766 1.1 christos test_gr_a5a5 4
1767 1.1 christos test_gr_a5a5 5
1768 1.1 christos test_gr_a5a5 6
1769 1.1 christos test_gr_a5a5 7
1770 1.1 christos
1771 1.1 christos ;; Now check the result of the move to memory.
1772 1.1 christos cmp.b @byte_src, @byte_dst
1773 1.1 christos beq .Lnext75
1774 1.1 christos fail
1775 1.1 christos .Lnext75:
1776 1.1 christos ;; Now clear the destination location, and verify that.
1777 1.1 christos mov.b #0, @byte_dst
1778 1.1 christos cmp.b @byte_src, @byte_dst
1779 1.1 christos bne .Lnext76
1780 1.1 christos fail
1781 1.1 christos .Lnext76: ; OK, pass on.
1782 1.1 christos ;; special case same register
1783 1.1 christos mov.l #byte_src, er0
1784 1.1 christos mov.b @er0-, @er0- ; copying byte_src to byte_dst_dec
1785 1.1 christos test_h_gr32 byte_src-2 er0
1786 1.1 christos cmp.b @byte_src, @byte_dst_dec
1787 1.1 christos beq .Lnext77
1788 1.1 christos fail
1789 1.1 christos .Lnext77:
1790 1.1 christos ;; Now clear the destination location, and verify that.
1791 1.1 christos mov.b #0, @byte_dst_dec
1792 1.1 christos cmp.b @byte_src, @byte_dst_dec
1793 1.1 christos bne .Lnext78
1794 1.1 christos fail
1795 1.1 christos .Lnext78:
1796 1.1 christos
1797 1.1 christos mov_b_preinc_to_preinc: ; reg pre-increment, memory to memory
1798 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1799 1.1 christos set_ccr_zero
1800 1.1 christos
1801 1.1 christos ;; mov.b @+ers, @+erd
1802 1.1 christos
1803 1.1 christos mov.l #byte_src-1, er1
1804 1.1 christos mov.l #byte_dst-1, er0
1805 1.1 christos mov.b @+er1, @+er0
1806 1.1 christos ;;; .word 0x0178
1807 1.1 christos ;;; .word 0x9190
1808 1.1 christos
1809 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1810 1.1 christos test_neg_clear
1811 1.1 christos test_zero_clear
1812 1.1 christos test_ovf_clear
1813 1.1 christos test_carry_clear
1814 1.1 christos
1815 1.1 christos ;; Verify the affected registers.
1816 1.1 christos
1817 1.1 christos test_h_gr32 byte_dst er0
1818 1.1 christos test_h_gr32 byte_src er1
1819 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1820 1.1 christos test_gr_a5a5 3
1821 1.1 christos test_gr_a5a5 4
1822 1.1 christos test_gr_a5a5 5
1823 1.1 christos test_gr_a5a5 6
1824 1.1 christos test_gr_a5a5 7
1825 1.1 christos
1826 1.1 christos ;; Now check the result of the move to memory.
1827 1.1 christos cmp.b @byte_src, @byte_dst
1828 1.1 christos beq .Lnext85
1829 1.1 christos fail
1830 1.1 christos .Lnext85:
1831 1.1 christos ;; Now clear the destination location, and verify that.
1832 1.1 christos mov.b #0, @byte_dst
1833 1.1 christos cmp.b @byte_src, @byte_dst
1834 1.1 christos bne .Lnext86
1835 1.1 christos fail
1836 1.1 christos .Lnext86: ; OK, pass on.
1837 1.1 christos ;; special case same register
1838 1.1 christos mov.l #byte_src-1, er0
1839 1.1 christos mov.b @+er0, @+er0 ; copying byte_src to byte_dst
1840 1.1 christos test_h_gr32 byte_src+1 er0
1841 1.1 christos cmp.b @byte_src, @byte_dst
1842 1.1 christos beq .Lnext87
1843 1.1 christos fail
1844 1.1 christos .Lnext87:
1845 1.1 christos ;; Now clear the destination location, and verify that.
1846 1.1 christos mov.b #0, @byte_dst
1847 1.1 christos cmp.b @byte_src, @byte_dst
1848 1.1 christos bne .Lnext88
1849 1.1 christos fail
1850 1.1 christos .Lnext88:
1851 1.1 christos
1852 1.1 christos mov_b_predec_to_predec: ; reg pre-decrement, memory to memory
1853 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1854 1.1 christos set_ccr_zero
1855 1.1 christos
1856 1.1 christos ;; mov.b @-ers, @-erd
1857 1.1 christos
1858 1.1 christos mov.l #byte_src+1, er1
1859 1.1 christos mov.l #byte_dst+1, er0
1860 1.1 christos mov.b @-er1, @-er0
1861 1.1 christos ;;; .word 0x0178
1862 1.1 christos ;;; .word 0xb1b0
1863 1.1 christos
1864 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1865 1.1 christos test_neg_clear
1866 1.1 christos test_zero_clear
1867 1.1 christos test_ovf_clear
1868 1.1 christos test_carry_clear
1869 1.1 christos
1870 1.1 christos ;; Verify the affected registers.
1871 1.1 christos
1872 1.1 christos test_h_gr32 byte_dst er0
1873 1.1 christos test_h_gr32 byte_src er1
1874 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1875 1.1 christos test_gr_a5a5 3
1876 1.1 christos test_gr_a5a5 4
1877 1.1 christos test_gr_a5a5 5
1878 1.1 christos test_gr_a5a5 6
1879 1.1 christos test_gr_a5a5 7
1880 1.1 christos
1881 1.1 christos ;; Now check the result of the move to memory.
1882 1.1 christos cmp.b @byte_src, @byte_dst
1883 1.1 christos beq .Lnext95
1884 1.1 christos fail
1885 1.1 christos .Lnext95:
1886 1.1 christos ;; Now clear the destination location, and verify that.
1887 1.1 christos mov.b #0, @byte_dst
1888 1.1 christos cmp.b @byte_src, @byte_dst
1889 1.1 christos bne .Lnext96
1890 1.1 christos fail
1891 1.1 christos .Lnext96: ; OK, pass on.
1892 1.1 christos ;; special case same register
1893 1.1 christos mov.l #byte_src+1, er0
1894 1.1 christos mov.b @-er0, @-er0 ; copying byte_src to byte_dst_dec
1895 1.1 christos test_h_gr32 byte_src-1 er0
1896 1.1 christos cmp.b @byte_src, @byte_dst_dec
1897 1.1 christos beq .Lnext97
1898 1.1 christos fail
1899 1.1 christos .Lnext97:
1900 1.1 christos ;; Now clear the destination location, and verify that.
1901 1.1 christos mov.b #0, @byte_dst_dec
1902 1.1 christos cmp.b @byte_src, @byte_dst_dec
1903 1.1 christos bne .Lnext98
1904 1.1 christos fail
1905 1.1 christos .Lnext98:
1906 1.1 christos
1907 1.1 christos mov_b_disp2_to_disp2: ; reg 2-bit disp, memory to memory
1908 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1909 1.1 christos set_ccr_zero
1910 1.1 christos
1911 1.1 christos ;; mov.b @(dd:2, ers), @(dd:2, erd)
1912 1.1 christos
1913 1.1 christos mov.l #byte_src-1, er1
1914 1.1 christos mov.l #byte_dst-2, er0
1915 1.1 christos mov.b @(1:2, er1), @(2:2, er0)
1916 1.1 christos ;;; .word 0x0178
1917 1.1 christos ;;; .word 0x1120
1918 1.1 christos
1919 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1920 1.1 christos test_neg_clear
1921 1.1 christos test_zero_clear
1922 1.1 christos test_ovf_clear
1923 1.1 christos test_carry_clear
1924 1.1 christos
1925 1.1 christos ;; Verify the affected registers.
1926 1.1 christos
1927 1.1 christos test_h_gr32 byte_dst-2 er0
1928 1.1 christos test_h_gr32 byte_src-1 er1
1929 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1930 1.1 christos test_gr_a5a5 3
1931 1.1 christos test_gr_a5a5 4
1932 1.1 christos test_gr_a5a5 5
1933 1.1 christos test_gr_a5a5 6
1934 1.1 christos test_gr_a5a5 7
1935 1.1 christos
1936 1.1 christos ;; Now check the result of the move to memory.
1937 1.1 christos cmp.b @byte_src, @byte_dst
1938 1.1 christos beq .Lnext105
1939 1.1 christos fail
1940 1.1 christos .Lnext105:
1941 1.1 christos ;; Now clear the destination location, and verify that.
1942 1.1 christos mov.b #0, @byte_dst
1943 1.1 christos cmp.b @byte_src, @byte_dst
1944 1.1 christos bne .Lnext106
1945 1.1 christos fail
1946 1.1 christos .Lnext106: ; OK, pass on.
1947 1.1 christos
1948 1.1 christos mov_b_disp16_to_disp16: ; reg 16-bit disp, memory to memory
1949 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1950 1.1 christos set_ccr_zero
1951 1.1 christos
1952 1.1 christos ;; mov.b @(dd:16, ers), @(dd:16, erd)
1953 1.1 christos
1954 1.1 christos mov.l #byte_src-1, er1
1955 1.1 christos mov.l #byte_dst-2, er0
1956 1.1 christos mov.b @(1:16, er1), @(2:16, er0)
1957 1.1 christos ;;; .word 0x0178
1958 1.1 christos ;;; .word 0xc1c0
1959 1.1 christos ;;; .word 0x0001
1960 1.1 christos ;;; .word 0x0002
1961 1.1 christos
1962 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1963 1.1 christos test_neg_clear
1964 1.1 christos test_zero_clear
1965 1.1 christos test_ovf_clear
1966 1.1 christos test_carry_clear
1967 1.1 christos
1968 1.1 christos ;; Verify the affected registers.
1969 1.1 christos
1970 1.1 christos test_h_gr32 byte_dst-2 er0
1971 1.1 christos test_h_gr32 byte_src-1 er1
1972 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
1973 1.1 christos test_gr_a5a5 3
1974 1.1 christos test_gr_a5a5 4
1975 1.1 christos test_gr_a5a5 5
1976 1.1 christos test_gr_a5a5 6
1977 1.1 christos test_gr_a5a5 7
1978 1.1 christos
1979 1.1 christos ;; Now check the result of the move to memory.
1980 1.1 christos cmp.b @byte_src, @byte_dst
1981 1.1 christos beq .Lnext115
1982 1.1 christos fail
1983 1.1 christos .Lnext115:
1984 1.1 christos ;; Now clear the destination location, and verify that.
1985 1.1 christos mov.b #0, @byte_dst
1986 1.1 christos cmp.b @byte_src, @byte_dst
1987 1.1 christos bne .Lnext116
1988 1.1 christos fail
1989 1.1 christos .Lnext116: ; OK, pass on.
1990 1.1 christos
1991 1.1 christos mov_b_disp32_to_disp32: ; reg 32-bit disp, memory to memory
1992 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
1993 1.1 christos set_ccr_zero
1994 1.1 christos
1995 1.1 christos ;; mov.b @(dd:32, ers), @(dd:32, erd)
1996 1.1 christos
1997 1.1 christos mov.l #byte_src-1, er1
1998 1.1 christos mov.l #byte_dst-2, er0
1999 1.1 christos mov.b @(1:32, er1), @(2:32, er0)
2000 1.1 christos ;;; .word 0x0178
2001 1.1 christos ;;; .word 0xc9c8
2002 1.1 christos ;;; .long 1
2003 1.1 christos ;;; .long 2
2004 1.1 christos
2005 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2006 1.1 christos test_neg_clear
2007 1.1 christos test_zero_clear
2008 1.1 christos test_ovf_clear
2009 1.1 christos test_carry_clear
2010 1.1 christos
2011 1.1 christos ;; Verify the affected registers.
2012 1.1 christos
2013 1.1 christos test_h_gr32 byte_dst-2 er0
2014 1.1 christos test_h_gr32 byte_src-1 er1
2015 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2016 1.1 christos test_gr_a5a5 3
2017 1.1 christos test_gr_a5a5 4
2018 1.1 christos test_gr_a5a5 5
2019 1.1 christos test_gr_a5a5 6
2020 1.1 christos test_gr_a5a5 7
2021 1.1 christos
2022 1.1 christos ;; Now check the result of the move to memory.
2023 1.1 christos cmp.b @byte_src, @byte_dst
2024 1.1 christos beq .Lnext125
2025 1.1 christos fail
2026 1.1 christos .Lnext125:
2027 1.1 christos ;; Now clear the destination location, and verify that.
2028 1.1 christos mov.b #0, @byte_dst
2029 1.1 christos cmp.b @byte_src, @byte_dst
2030 1.1 christos bne .Lnext126
2031 1.1 christos fail
2032 1.1 christos .Lnext126: ; OK, pass on.
2033 1.1 christos
2034 1.1 christos mov_b_indexb16_to_indexb16: ; reg 16-bit indexed, memory to memory
2035 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2036 1.1 christos mov.l #0xffffff01, er1
2037 1.1 christos mov.l #0xffffff02, er0
2038 1.1 christos ;; mov.b @(dd:16, rs.b), @(dd:16, rd.b)
2039 1.1 christos set_ccr_zero
2040 1.1 christos mov.b @(byte_src-1:16, r1.b), @(byte_dst-2:16, r0.b)
2041 1.1 christos
2042 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2043 1.1 christos test_neg_clear
2044 1.1 christos test_zero_clear
2045 1.1 christos test_ovf_clear
2046 1.1 christos test_carry_clear
2047 1.1 christos
2048 1.1 christos ;; Verify the affected registers.
2049 1.1 christos
2050 1.1 christos test_h_gr32 0xffffff02 er0
2051 1.1 christos test_h_gr32 0xffffff01 er1
2052 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2053 1.1 christos test_gr_a5a5 3
2054 1.1 christos test_gr_a5a5 4
2055 1.1 christos test_gr_a5a5 5
2056 1.1 christos test_gr_a5a5 6
2057 1.1 christos test_gr_a5a5 7
2058 1.1 christos
2059 1.1 christos ;; Now check the result of the move to memory.
2060 1.1 christos cmp.b @byte_src, @byte_dst
2061 1.1 christos bne fail1
2062 1.1 christos ;; Now clear the destination location, and verify that.
2063 1.1 christos mov.b #0, @byte_dst
2064 1.1 christos cmp.b @byte_src, @byte_dst
2065 1.1 christos beq fail1
2066 1.1 christos
2067 1.1 christos mov_b_indexw16_to_indewb16: ; reg 16-bit indexed, memory to memory
2068 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2069 1.1 christos mov.l #0xffff0003, er1
2070 1.1 christos mov.l #0xffff0004, er0
2071 1.1 christos ;; mov.b @(dd:16, rs.w), @(dd:16, rd.w)
2072 1.1 christos set_ccr_zero
2073 1.1 christos mov.b @(byte_src-3:16, r1.w), @(byte_dst-4:16, r0.w)
2074 1.1 christos
2075 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2076 1.1 christos test_neg_clear
2077 1.1 christos test_zero_clear
2078 1.1 christos test_ovf_clear
2079 1.1 christos test_carry_clear
2080 1.1 christos
2081 1.1 christos ;; Verify the affected registers.
2082 1.1 christos
2083 1.1 christos test_h_gr32 0xffff0004 er0
2084 1.1 christos test_h_gr32 0xffff0003 er1
2085 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2086 1.1 christos test_gr_a5a5 3
2087 1.1 christos test_gr_a5a5 4
2088 1.1 christos test_gr_a5a5 5
2089 1.1 christos test_gr_a5a5 6
2090 1.1 christos test_gr_a5a5 7
2091 1.1 christos
2092 1.1 christos ;; Now check the result of the move to memory.
2093 1.1 christos cmp.b @byte_src, @byte_dst
2094 1.1 christos bne fail1
2095 1.1 christos ;; Now clear the destination location, and verify that.
2096 1.1 christos mov.b #0, @byte_dst
2097 1.1 christos cmp.b @byte_src, @byte_dst
2098 1.1 christos beq fail1
2099 1.1 christos
2100 1.1 christos mov_b_indexl16_to_indexl16: ; reg 16-bit indexed, memory to memory
2101 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2102 1.1 christos mov.l #0x00000005, er1
2103 1.1 christos mov.l #0x00000006, er0
2104 1.1 christos ;; mov.b @(dd:16, ers.l), @(dd:16, erd.l)
2105 1.1 christos set_ccr_zero
2106 1.1 christos mov.b @(byte_src-5:16, er1.l), @(byte_dst-6:16, er0.l)
2107 1.1 christos
2108 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2109 1.1 christos test_neg_clear
2110 1.1 christos test_zero_clear
2111 1.1 christos test_ovf_clear
2112 1.1 christos test_carry_clear
2113 1.1 christos
2114 1.1 christos ;; Verify the affected registers.
2115 1.1 christos
2116 1.1 christos test_h_gr32 0x00000006 er0
2117 1.1 christos test_h_gr32 0x00000005 er1
2118 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2119 1.1 christos test_gr_a5a5 3
2120 1.1 christos test_gr_a5a5 4
2121 1.1 christos test_gr_a5a5 5
2122 1.1 christos test_gr_a5a5 6
2123 1.1 christos test_gr_a5a5 7
2124 1.1 christos
2125 1.1 christos ;; Now check the result of the move to memory.
2126 1.1 christos cmp.b @byte_src, @byte_dst
2127 1.1 christos bne fail1
2128 1.1 christos ;; Now clear the destination location, and verify that.
2129 1.1 christos mov.b #0, @byte_dst
2130 1.1 christos cmp.b @byte_src, @byte_dst
2131 1.1 christos beq fail1
2132 1.1 christos
2133 1.1 christos mov_b_indexb32_to_indexb32: ; reg 32-bit indexed, memory to memory
2134 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2135 1.1 christos mov.l #0xffffff01, er1
2136 1.1 christos mov.l #0xffffff02, er0
2137 1.1 christos set_ccr_zero
2138 1.1 christos ;; mov.b @(dd:32, rs.b), @(dd:32, rd.b)
2139 1.1 christos mov.b @(byte_src-1:32, r1.b), @(byte_dst-2:32, r0.b)
2140 1.1 christos
2141 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2142 1.1 christos test_neg_clear
2143 1.1 christos test_zero_clear
2144 1.1 christos test_ovf_clear
2145 1.1 christos test_carry_clear
2146 1.1 christos
2147 1.1 christos ;; Verify the affected registers.
2148 1.1 christos
2149 1.1 christos test_h_gr32 0xffffff02 er0
2150 1.1 christos test_h_gr32 0xffffff01 er1
2151 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2152 1.1 christos test_gr_a5a5 3
2153 1.1 christos test_gr_a5a5 4
2154 1.1 christos test_gr_a5a5 5
2155 1.1 christos test_gr_a5a5 6
2156 1.1 christos test_gr_a5a5 7
2157 1.1 christos
2158 1.1 christos ;; Now check the result of the move to memory.
2159 1.1 christos cmp.b @byte_src, @byte_dst
2160 1.1 christos bne fail1
2161 1.1 christos ;; Now clear the destination location, and verify that.
2162 1.1 christos mov.b #0, @byte_dst
2163 1.1 christos cmp.b @byte_src, @byte_dst
2164 1.1 christos beq fail1
2165 1.1 christos
2166 1.1 christos mov_b_indexw32_to_indexw32: ; reg 32-bit indexed, memory to memory
2167 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2168 1.1 christos mov.l #0xffff0003, er1
2169 1.1 christos mov.l #0xffff0004, er0
2170 1.1 christos set_ccr_zero
2171 1.1 christos ;; mov.b @(dd:32, rs.w), @(dd:32, rd.w)
2172 1.1 christos mov.b @(byte_src-3:32, r1.w), @(byte_dst-4:32, r0.w)
2173 1.1 christos
2174 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2175 1.1 christos test_neg_clear
2176 1.1 christos test_zero_clear
2177 1.1 christos test_ovf_clear
2178 1.1 christos test_carry_clear
2179 1.1 christos
2180 1.1 christos ;; Verify the affected registers.
2181 1.1 christos
2182 1.1 christos test_h_gr32 0xffff0004 er0
2183 1.1 christos test_h_gr32 0xffff0003 er1
2184 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2185 1.1 christos test_gr_a5a5 3
2186 1.1 christos test_gr_a5a5 4
2187 1.1 christos test_gr_a5a5 5
2188 1.1 christos test_gr_a5a5 6
2189 1.1 christos test_gr_a5a5 7
2190 1.1 christos
2191 1.1 christos ;; Now check the result of the move to memory.
2192 1.1 christos cmp.b @byte_src, @byte_dst
2193 1.1 christos bne fail1
2194 1.1 christos ;; Now clear the destination location, and verify that.
2195 1.1 christos mov.b #0, @byte_dst
2196 1.1 christos cmp.b @byte_src, @byte_dst
2197 1.1 christos beq fail1
2198 1.1 christos
2199 1.1 christos mov_b_indexl32_to_indexl32: ; reg 32-bit indexed, memory to memory
2200 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2201 1.1 christos mov.l #0x00000005, er1
2202 1.1 christos mov.l #0x00000006, er0
2203 1.1 christos set_ccr_zero
2204 1.1 christos ;; mov.b @(dd:32, rs.w), @(dd:32, rd.w)
2205 1.1 christos mov.b @(byte_src-5:32, er1.l), @(byte_dst-6:32, er0.l)
2206 1.1 christos
2207 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2208 1.1 christos test_neg_clear
2209 1.1 christos test_zero_clear
2210 1.1 christos test_ovf_clear
2211 1.1 christos test_carry_clear
2212 1.1 christos
2213 1.1 christos ;; Verify the affected registers.
2214 1.1 christos
2215 1.1 christos test_h_gr32 0x00000006 er0
2216 1.1 christos test_h_gr32 0x00000005 er1
2217 1.1 christos test_gr_a5a5 2 ; Make sure other general regs not disturbed
2218 1.1 christos test_gr_a5a5 3
2219 1.1 christos test_gr_a5a5 4
2220 1.1 christos test_gr_a5a5 5
2221 1.1 christos test_gr_a5a5 6
2222 1.1 christos test_gr_a5a5 7
2223 1.1 christos
2224 1.1 christos ;; Now check the result of the move to memory.
2225 1.1 christos cmp.b @byte_src, @byte_dst
2226 1.1 christos bne fail1
2227 1.1 christos ;; Now clear the destination location, and verify that.
2228 1.1 christos mov.b #0, @byte_dst
2229 1.1 christos cmp.b @byte_src, @byte_dst
2230 1.1 christos beq fail1
2231 1.1 christos
2232 1.1 christos mov_b_abs16_to_abs16: ; 16-bit absolute addr, memory to memory
2233 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2234 1.1 christos set_ccr_zero
2235 1.1 christos
2236 1.1 christos ;; mov.b @aa:16, @aa:16
2237 1.1 christos
2238 1.1 christos mov.b @byte_src:16, @byte_dst:16
2239 1.1 christos ;;; .word 0x0178
2240 1.1 christos ;;; .word 0x4040
2241 1.1 christos ;;; .word @byte_src
2242 1.1 christos ;;; .word @byte_dst
2243 1.1 christos
2244 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2245 1.1 christos test_neg_clear
2246 1.1 christos test_zero_clear
2247 1.1 christos test_ovf_clear
2248 1.1 christos test_carry_clear
2249 1.1 christos
2250 1.1 christos
2251 1.1 christos test_gr_a5a5 0 ; Make sure *NO* general registers are changed
2252 1.1 christos test_gr_a5a5 1
2253 1.1 christos test_gr_a5a5 2
2254 1.1 christos test_gr_a5a5 3
2255 1.1 christos test_gr_a5a5 4
2256 1.1 christos test_gr_a5a5 5
2257 1.1 christos test_gr_a5a5 6
2258 1.1 christos test_gr_a5a5 7
2259 1.1 christos
2260 1.1 christos ;; Now check the result of the move to memory.
2261 1.1 christos cmp.b @byte_src, @byte_dst
2262 1.1 christos beq .Lnext135
2263 1.1 christos fail
2264 1.1 christos .Lnext135:
2265 1.1 christos ;; Now clear the destination location, and verify that.
2266 1.1 christos mov.b #0, @byte_dst
2267 1.1 christos cmp.b @byte_src, @byte_dst
2268 1.1 christos bne .Lnext136
2269 1.1 christos fail
2270 1.1 christos .Lnext136: ; OK, pass on.
2271 1.1 christos
2272 1.1 christos mov_b_abs32_to_abs32: ; 32-bit absolute addr, memory to memory
2273 1.1 christos set_grs_a5a5 ; Fill all general regs with a fixed pattern
2274 1.1 christos set_ccr_zero
2275 1.1 christos
2276 1.1 christos ;; mov.b @aa:32, @aa:32
2277 1.1 christos
2278 1.1 christos mov.b @byte_src:32, @byte_dst:32
2279 1.1 christos ;;; .word 0x0178
2280 1.1 christos ;;; .word 0x4848
2281 1.1 christos ;;; .long @byte_src
2282 1.1 christos ;;; .long @byte_dst
2283 1.1 christos
2284 1.1 christos ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2285 1.1 christos test_neg_clear
2286 1.1 christos test_zero_clear
2287 1.1 christos test_ovf_clear
2288 1.1 christos test_carry_clear
2289 1.1 christos
2290 1.1 christos test_gr_a5a5 0 ; Make sure *NO* general registers are changed
2291 1.1 christos test_gr_a5a5 1
2292 1.1 christos test_gr_a5a5 2
2293 1.1 christos test_gr_a5a5 3
2294 1.1 christos test_gr_a5a5 4
2295 1.1 christos test_gr_a5a5 5
2296 1.1 christos test_gr_a5a5 6
2297 1.1 christos test_gr_a5a5 7
2298 1.1 christos
2299 1.1 christos ;; Now check the result of the move to memory.
2300 1.1 christos cmp.b @byte_src, @byte_dst
2301 1.1 christos beq .Lnext145
2302 1.1 christos fail
2303 1.1 christos .Lnext145:
2304 1.1 christos ;; Now clear the destination location, and verify that.
2305 1.1 christos mov.b #0, @byte_dst
2306 1.1 christos cmp.b @byte_src, @byte_dst
2307 1.1 christos bne .Lnext146
2308 1.1 christos fail
2309 1.1 christos .Lnext146: ; OK, pass on.
2310 1.1 christos
2311 1.1 christos
2312 1.1 christos .endif
2313 1.1 christos
2314 1.1 christos pass
2315 1.1 christos
2316 1.1 christos exit 0
2317 1.1 christos
2318 1.1 christos fail1:
2319 1.1 christos fail
2320