1 # Hitachi H8 testcase 'band', 'bor', 'bxor', 'bld', 'bst', 'bstz'
3 # as(h8300): --defsym sim_cpu=0
4 # as(h8300h): --defsym sim_cpu=1
5 # as(h8300s): --defsym sim_cpu=2
6 # as(h8sx): --defsym sim_cpu=3
7 # ld(h8300h): -m h8300helf
8 # ld(h8300s): -m h8300self
9 # ld(h8sx): -m h8300sxelf
11 .include "testutils.inc"
23 band #7, r0l ; this should NOT set the carry flag.
25 band #6, r0l ; this should NOT set the carry flag.
28 orc #1, ccr ; set the carry flag
29 band #7, r0l ; this should NOT clear the carry flag
34 band #6, r0l ; this should clear the carry flag
37 test_grs_a5a5 ; general registers should not be changed.
41 .if (sim_cpu == h8300)
45 band #7, @r1 ; this should NOT set the carry flag.
47 band #6, @r1 ; this should NOT set the carry flag.
50 orc #1, ccr ; set the carry flag
51 band #7, @r1 ; this should NOT clear the carry flag
56 band #6, @r1 ; this should clear the carry flag
58 ;;; test_h_gr16 byte_src r1 ;FIXME
63 band #7, @er1 ; this should NOT set the carry flag.
65 band #6, @er1 ; this should NOT set the carry flag.
68 orc #1, ccr ; set the carry flag
69 band #7, @er1 ; this should NOT clear the carry flag
74 band #6, @er1 ; this should clear the carry flag
76 test_h_gr32 byte_src er1
78 test_gr_a5a5 0 ; general registers should not be changed.
91 band #7, @0x20:8 ; this should NOT set the carry flag.
93 band #6, @0x20:8 ; this should NOT set the carry flag.
96 orc #1, ccr ; set the carry flag
97 band #7, @0x20:8 ; this should NOT clear the carry flag
102 band #6, @0x20:8 ; this should clear the carry flag
105 test_grs_a5a5 ; general registers should not be changed.
107 .if (sim_cpu > h8300h)
112 band #7, @byte_src:16 ; this should NOT set the carry flag.
114 band #6, @byte_src:16 ; this should NOT set the carry flag.
117 orc #1, ccr ; set the carry flag
118 band #7, @byte_src:16 ; this should NOT clear the carry flag
123 band #6, @byte_src:16 ; this should clear the carry flag
126 test_grs_a5a5 ; general registers should not be changed.
132 band #7, @byte_src:32 ; this should NOT set the carry flag.
134 band #6, @byte_src:32 ; this should NOT set the carry flag.
137 orc #1, ccr ; set the carry flag
138 band #7, @byte_src:32 ; this should NOT clear the carry flag
143 band #6, @byte_src:32 ; this should clear the carry flag
146 test_grs_a5a5 ; general registers should not be changed.
153 bor #6, r0l ; this should NOT set the carry flag.
156 bor #7, r0l ; this should set the carry flag.
162 orc #1, ccr ; set the carry flag
163 bor #7, r0l ; this should NOT clear the carry flag
168 bor #6, r0l ; this should NOT clear the carry flag
174 test_grs_a5a5 ; general registers should not be changed.
181 bor #6, @0x20:8 ; this should NOT set the carry flag.
183 bor #7, @0x20:8 ; this should set the carry flag.
189 orc #1, ccr ; set the carry flag
190 bor #7, @0x20:8 ; this should NOT clear the carry flag
195 bor #6, @0x20:8 ; this should NOT clear the carry flag
201 test_grs_a5a5 ; general registers should not be changed.
207 bxor #6, r0l ; this should NOT set the carry flag.
210 bxor #7, r0l ; this should set the carry flag.
216 orc #1, ccr ; set the carry flag
217 bxor #6, r0l ; this should NOT clear the carry flag
223 bxor #7, r0l ; this should clear the carry flag
226 test_grs_a5a5 ; general registers should not be changed.
233 bxor #6, @0x20:8 ; this should NOT set the carry flag.
235 bxor #7, @0x20:8 ; this should set the carry flag.
241 orc #1, ccr ; set the carry flag
242 bxor #6, @0x20:8 ; this should NOT clear the carry flag
248 bxor #7, @0x20:8 ; this should clear the carry flag
251 test_grs_a5a5 ; general registers should not be changed.
257 bld #6, r0l ; this should NOT set the carry flag.
259 bld #7, r0l ; this should set the carry flag.
265 test_grs_a5a5 ; general registers should not be changed.
269 .if (sim_cpu == h8300)
273 bld #6, @r1 ; this should NOT set the carry flag.
275 bld #7, @r1 ; this should set the carry flag.
280 ;;; test_h_gr16 byte_src r1 ;FIXME
285 bld #6, @er1 ; this should NOT set the carry flag.
287 bld #7, @er1 ; this should NOT set the carry flag.
292 test_h_gr32 byte_src er1
294 test_gr_a5a5 0 ; general registers should not be changed.
307 bld #6, @0x20:8 ; this should NOT set the carry flag.
309 bld #7, @0x20:8 ; this should set the carry flag.
315 test_grs_a5a5 ; general registers should not be changed.
317 .if (sim_cpu > h8300h)
322 bld #6, @byte_src:16 ; this should NOT set the carry flag.
324 bld #7, @byte_src:16 ; this should set the carry flag.
330 test_grs_a5a5 ; general registers should not be changed.
336 bld #6, @byte_src:32 ; this should NOT set the carry flag.
338 bld #7, @byte_src:32 ; this should set the carry flag.
344 test_grs_a5a5 ; general registers should not be changed.
351 bst #7, r0l ; this should clear bit 7
353 test_h_gr16 0xa525 r0
356 orc #1, ccr ; set the carry flag
357 bst #6, r0l ; this should set bit 6
362 test_h_gr16 0xa565 r0
364 test_gr_a5a5 1 ; Rest of general regs should not be changed.
377 bst #7, @0x20:8 ; this should clear bit 7
380 test_h_gr16 0xa525 r0
383 orc #1, ccr ; set the carry flag
384 bst #6, @0x20:8 ; this should set bit 6
390 test_h_gr16 0xa565 r0
392 test_gr_a5a5 1 ; general registers should not be changed.
400 .if (sim_cpu == h8sx)
406 bstz #7, @0x20:8 ; this should clear bit 7
409 test_h_gr16 0xa525 r0
412 orc #4, ccr ; set the zero flag
413 bstz #6, @0x20:8 ; this should set bit 6
419 test_h_gr16 0xa565 r0
421 test_gr_a5a5 1 ; general registers should not be changed.
434 btst #7, r0l ; this should NOT set the zero flag.
436 btst #6, r0l ; this should set the zero flag.
442 test_grs_a5a5 ; general registers should not be changed.
446 .if (sim_cpu == h8300)
450 btst #7, @r1 ; this should NOT set the zero flag.
452 btst #6, @r1 ; this should set the zero flag.
457 ;;; test_h_gr16 byte_src r1 ;FIXME
462 btst #7, @er1 ; this should NOT set the zero flag.
464 btst #6, @er1 ; this should NOT set the zero flag.
469 test_h_gr32 byte_src er1
471 test_gr_a5a5 0 ; general registers should not be changed.
484 btst #7, @0x20:8 ; this should NOT set the zero flag.
486 btst #6, @0x20:8 ; this should set the zero flag.
492 test_grs_a5a5 ; general registers should not be changed.
494 .if (sim_cpu > h8300h)
499 btst #7, @byte_src:16 ; this should NOT set the zero flag.
501 btst #6, @byte_src:16 ; this should set the zero flag.
507 test_grs_a5a5 ; general registers should not be changed.
513 btst #7, @byte_src:32 ; this should NOT set the zero flag.
515 btst #6, @byte_src:32 ; this should set the zero flag.
521 test_grs_a5a5 ; general registers should not be changed.