1 # Hitachi H8 testcase 'biand', 'bior', 'bixor', 'bild', 'bist', 'bistz'
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 biand
#6, r0l ; this should NOT set the carry flag.
25 biand
#7, r0l ; this should NOT set the carry flag.
28 orc #1, ccr ; set the carry flag
29 biand
#6, r0l ; this should NOT clear the carry flag
34 biand
#7, r0l ; this should clear the carry flag
37 test_grs_a5a5 ; general registers should
not be changed.
41 .if (sim_cpu == h8300)
45 biand
#6, @r1 ; this should NOT set the carry flag.
47 biand
#7, @r1 ; this should NOT set the carry flag.
50 orc #1, ccr ; set the carry flag
51 biand
#6, @r1 ; this should NOT clear the carry flag
56 biand
#7, @r1 ; this should clear the carry flag
58 ;;; test_h_gr16 byte_src
r1 ;FIXME
63 biand
#6, @er1 ; this should NOT set the carry flag.
65 biand
#7, @er1 ; this should NOT set the carry flag.
68 orc #1, ccr ; set the carry flag
69 biand
#6, @er1 ; this should NOT clear the carry flag
74 biand
#7, @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 biand
#6, @0x20:8 ; this should NOT set the carry flag.
93 biand
#7, @0x20:8 ; this should NOT set the carry flag.
96 orc #1, ccr ; set the carry flag
97 biand
#6, @0x20:8 ; this should NOT clear the carry flag
102 biand
#7, @0x20:8 ; this should clear the carry flag
105 test_grs_a5a5 ; general registers should
not be changed.
107 .if (sim_cpu > h8300h)
112 biand
#6, @byte_src:16 ; this should NOT set the carry flag.
114 biand
#7, @byte_src:16 ; this should NOT set the carry flag.
117 orc #1, ccr ; set the carry flag
118 biand
#6, @byte_src:16 ; this should NOT clear the carry flag
123 biand
#7, @byte_src:16 ; this should clear the carry flag
126 test_grs_a5a5 ; general registers should
not be changed.
132 biand
#6, @byte_src:32 ; this should NOT set the carry flag.
134 biand
#7, @byte_src:32 ; this should NOT set the carry flag.
137 orc #1, ccr ; set the carry flag
138 biand
#6, @byte_src:32 ; this should NOT clear the carry flag
143 biand
#7, @byte_src:32 ; this should clear the carry flag
146 test_grs_a5a5 ; general registers should
not be changed.
153 bior
#7, r0l ; this should NOT set the carry flag.
156 bior
#6, r0l ; this should set the carry flag.
162 orc #1, ccr ; set the carry flag
163 bior
#6, r0l ; this should NOT clear the carry flag
168 bior
#7, r0l ; this should NOT clear the carry flag
174 test_grs_a5a5 ; general registers should
not be changed.
181 bior
#7, @0x20:8 ; this should NOT set the carry flag.
183 bior
#6, @0x20:8 ; this should set the carry flag.
189 orc #1, ccr ; set the carry flag
190 bior
#6, @0x20:8 ; this should NOT clear the carry flag
195 bior
#7, @0x20:8 ; this should NOT clear the carry flag
201 test_grs_a5a5 ; general registers should
not be changed.
207 bixor
#7, r0l ; this should NOT set the carry flag.
210 bixor
#6, r0l ; this should set the carry flag.
216 orc #1, ccr ; set the carry flag
217 bixor
#7, r0l ; this should NOT clear the carry flag
223 bixor
#6, r0l ; this should clear the carry flag
226 test_grs_a5a5 ; general registers should
not be changed.
233 bixor
#7, @0x20:8 ; this should NOT set the carry flag.
235 bixor
#6, @0x20:8 ; this should set the carry flag.
241 orc #1, ccr ; set the carry flag
242 bixor
#7, @0x20:8 ; this should NOT clear the carry flag
248 bixor
#6, @0x20:8 ; this should clear the carry flag
251 test_grs_a5a5 ; general registers should
not be changed.
257 bild
#7, r0l ; this should NOT set the carry flag.
259 bild
#6, r0l ; this should set the carry flag.
265 test_grs_a5a5 ; general registers should
not be changed.
269 .if (sim_cpu == h8300)
273 bild
#7, @r1 ; this should NOT set the carry flag.
275 bild
#6, @r1 ; this should set the carry flag.
280 ;;; test_h_gr16 byte_src
r1 ;FIXME
285 bild
#7, @er1 ; this should NOT set the carry flag.
287 bild
#6, @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 bild
#7, @0x20:8 ; this should NOT set the carry flag.
309 bild
#6, @0x20:8 ; this should set the carry flag.
315 test_grs_a5a5 ; general registers should
not be changed.
317 .if (sim_cpu > h8300h)
322 bild
#7, @byte_src:16 ; this should NOT set the carry flag.
324 bild
#6, @byte_src:16 ; this should set the carry flag.
330 test_grs_a5a5 ; general registers should
not be changed.
336 bild
#7, @byte_src:32 ; this should NOT set the carry flag.
338 bild
#6, @byte_src:32 ; this should set the carry flag.
344 test_grs_a5a5 ; general registers should
not be changed.
351 bist
#6, r0l ; this should set bit 6
353 test_h_gr16
0xa5e5 r0
356 orc #1, ccr ; set the carry flag
357 bist
#7, r0l ; this should clear bit 7
362 test_h_gr16
0xa565 r0
364 test_gr_a5a5
1 ; Rest of general regs should
not be changed.
377 bist
#6, @0x20:8 ; this should set bit 6
380 test_h_gr16
0xa5e5 r0
383 orc #1, ccr ; set the carry flag
384 bist
#7, @0x20:8 ; this should clear bit 7
390 test_h_gr16
0xa565 r0
392 test_gr_a5a5
1 ; general registers should
not be changed.
400 .if (sim_cpu == h8sx)
406 bistz
#6, @0x20:8 ; this should set bit 6
409 test_h_gr16
0xa5e5 r0
412 orc #4, ccr ; set the zero flag
413 bistz
#7, @0x20:8 ; this should clear bit 7
419 test_h_gr16
0xa565 r0
421 test_gr_a5a5
1 ; general registers should
not be changed.
436 test_h_gr16
0xa525 r0
440 test_h_gr16
0xa565 r0
444 test_h_gr16
0xa545 r0
448 test_h_gr16
0xa555 r0
456 test_grs_a5a5 ; general registers should
not be changed.
470 test_h_gr16
0xa555 r0