1 # Hitachi H8 testcase 'mov.b'
2 # mach(): h8300h h8300s h8sx
3 # as(h8300h): --defsym sim_cpu=1
4 # as(h8300s): --defsym sim_cpu=2
5 # as(h8sx): --defsym sim_cpu=3
6 # ld(h8300h): -m h8300helf
7 # ld(h8300s): -m h8300self
8 # ld(h8sx): -m h8300sxelf
10 .include "testutils.inc"
26 ;; Move byte from immediate source
31 set_grs_a5a5 ; Fill all general regs with a fixed pattern
35 mov.b #0x77:8, r0l ; Immediate 3-bit operand
38 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
44 test_h_gr32 0xa5a5a577 er0
46 test_gr_a5a5 1 ; Make sure other general regs not disturbed
57 set_grs_a5a5 ; Fill all general regs with a fixed pattern
60 ;; mov.b #xx:4, @aa:16
61 mov.b #0xf:4, @byte_dst:16 ; 16-bit address-direct operand
65 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
71 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
72 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
73 test_gr_a5a5 2 ; to examine the destination memory).
80 ;; Now check the result of the move to memory.
85 mov.b #0, @byte_dst ; zero it again for the next use.
88 set_grs_a5a5 ; Fill all general regs with a fixed pattern
91 ;; mov.b #xx:4, @aa:32
92 mov.b #0xf:4, @byte_dst:32 ; 32-bit address-direct operand
96 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
102 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
103 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
104 test_gr_a5a5 2 ; to examine the destination memory).
111 ;; Now check the result of the move to memory.
112 cmp.b #0xf, @byte_dst
116 mov.b #0, @byte_dst ; zero it again for the next use.
118 mov_b_imm8_to_indirect:
119 set_grs_a5a5 ; Fill all general regs with a fixed pattern
124 mov.b #0xa5:8, @er1 ; Register indirect operand
128 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
134 test_gr_a5a5 0 ; Make sure other general regs not disturbed
135 test_h_gr32 byte_dst, er1
143 ;; Now check the result of the move to memory.
144 cmp.b #0xa5, @byte_dst
148 mov.b #0, @byte_dst ; zero it again for the next use.
150 mov_b_imm8_to_postinc: ; post-increment from imm8 to mem
151 set_grs_a5a5 ; Fill all general regs with a fixed pattern
154 ;; mov.b #xx:8, @erd+
156 mov.b #0xa5:8, @er1+ ; Imm8, register post-incr operands.
160 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
166 test_gr_a5a5 0 ; Make sure other general regs not disturbed
167 test_h_gr32 byte_dst+1, er1
175 ;; Now check the result of the move to memory.
176 cmp.b #0xa5, @byte_dst
180 mov.b #0, @byte_dst ; zero it again for the next use.
182 mov_b_imm8_to_postdec: ; post-decrement from imm8 to mem
183 set_grs_a5a5 ; Fill all general regs with a fixed pattern
186 ;; mov.b #xx:8, @erd-
188 mov.b #0xa5:8, @er1- ; Imm8, register post-decr operands.
192 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
198 test_gr_a5a5 0 ; Make sure other general regs not disturbed
199 test_h_gr32 byte_dst-1, er1
207 ;; Now check the result of the move to memory.
208 cmp.b #0xa5, @byte_dst
212 mov.b #0, @byte_dst ; zero it again for the next use.
214 mov_b_imm8_to_preinc: ; pre-increment from register to mem
215 set_grs_a5a5 ; Fill all general regs with a fixed pattern
218 ;; mov.b #xx:8, @+erd
219 mov.l #byte_dst-1, er1
220 mov.b #0xa5:8, @+er1 ; Imm8, register pre-incr operands
224 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
230 test_gr_a5a5 0 ; Make sure other general regs not disturbed
231 test_h_gr32 byte_dst, er1
239 ;; Now check the result of the move to memory.
240 cmp.b #0xa5, @byte_dst
244 mov.b #0, @byte_dst ; zero it again for the next use.
246 mov_b_imm8_to_predec: ; pre-decrement from register to mem
247 set_grs_a5a5 ; Fill all general regs with a fixed pattern
250 ;; mov.b #xx:8, @-erd
251 mov.l #byte_dst+1, er1
252 mov.b #0xa5:8, @-er1 ; Imm8, register pre-decr operands
256 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
262 test_gr_a5a5 0 ; Make sure other general regs not disturbed
263 test_h_gr32 byte_dst, er1
271 ;; Now check the result of the move to memory.
272 cmp.b #0xa5, @byte_dst
276 mov.b #0, @byte_dst ; zero it again for the next use.
279 set_grs_a5a5 ; Fill all general regs with a fixed pattern
282 ;; mov.b #xx:8, @(dd:2, erd)
283 mov.l #byte_dst-3, er1
284 mov.b #0xa5:8, @(3:2, er1) ; Imm8, reg plus 2-bit disp. operand
288 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
294 test_gr_a5a5 0 ; Make sure other general regs not disturbed
295 test_h_gr32 byte_dst-3, er1
303 ;; Now check the result of the move to memory.
304 cmp.b #0xa5, @byte_dst
308 mov.b #0, @byte_dst ; zero it again for the next use.
310 mov_b_imm8_to_disp16:
311 set_grs_a5a5 ; Fill all general regs with a fixed pattern
314 ;; mov.b #xx:8, @(dd:16, erd)
315 mov.l #byte_dst-4, er1
316 mov.b #0xa5:8, @(4:16, er1) ; Register plus 16-bit disp. operand
321 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
327 test_gr_a5a5 0 ; Make sure other general regs not disturbed
328 test_h_gr32 byte_dst-4, er1
336 ;; Now check the result of the move to memory.
337 cmp.b #0xa5, @byte_dst
341 mov.b #0, @byte_dst ; zero it again for the next use.
343 mov_b_imm8_to_disp32:
344 set_grs_a5a5 ; Fill all general regs with a fixed pattern
347 ;; mov.b #xx:8, @(dd:32, erd)
348 mov.l #byte_dst-8, er1
349 mov.b #0xa5:8, @(8:32, er1) ; Register plus 32-bit disp. operand
354 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
360 test_gr_a5a5 0 ; Make sure other general regs not disturbed
361 test_h_gr32 byte_dst-8, er1
369 ;; Now check the result of the move to memory.
370 cmp.b #0xa5, @byte_dst
374 mov.b #0, @byte_dst ; zero it again for the next use.
376 mov_b_imm8_to_indexb16:
377 set_grs_a5a5 ; Fill all general regs with a fixed pattern
378 mov.l #0xffffff01, er1
380 ;; mov.b #xx:8, @(dd:16, rd.b)
381 mov.b #0xa5:8, @(byte_dst-1:16, r1.b) ; byte indexed operand
383 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
389 test_gr_a5a5 0 ; Make sure other general regs not disturbed
390 test_h_gr32 0xffffff01, er1
398 ;; Now check the result of the move to memory.
399 cmp.b #0xa5, @byte_dst
401 mov.b #0, @byte_dst ; zero it again for the next use.
403 mov_b_imm8_to_indexw16:
404 set_grs_a5a5 ; Fill all general regs with a fixed pattern
405 mov.l #0xffff0002, er1
407 ;; mov.b #xx:8, @(dd:16, rd.w)
408 mov.b #0xa5:8, @(byte_dst-2:16, r1.w) ; byte indexed operand
410 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
416 test_gr_a5a5 0 ; Make sure other general regs not disturbed
417 test_h_gr32 0xffff0002, er1
425 ;; Now check the result of the move to memory.
426 cmp.b #0xa5, @byte_dst
428 mov.b #0, @byte_dst ; zero it again for the next use.
430 mov_b_imm8_to_indexl16:
431 set_grs_a5a5 ; Fill all general regs with a fixed pattern
432 mov.l #0x00000003, er1
434 ;; mov.b #xx:8, @(dd:16, erd.l)
435 mov.b #0xa5:8, @(byte_dst-3:16, er1.l) ; byte indexed operand
437 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
443 test_gr_a5a5 0 ; Make sure other general regs not disturbed
444 test_h_gr32 0x00000003, er1
452 ;; Now check the result of the move to memory.
453 cmp.b #0xa5, @byte_dst
455 mov.b #0, @byte_dst ; zero it again for the next use.
457 mov_b_imm8_to_indexb32:
458 set_grs_a5a5 ; Fill all general regs with a fixed pattern
459 mov.l #0xffffff04, er1
461 ;; mov.b #xx:8, @(dd:32, rd.b)
462 mov.b #0xa5:8, @(byte_dst-4:32, r1.b) ; byte indexed operand
464 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
470 test_gr_a5a5 0 ; Make sure other general regs not disturbed
471 test_h_gr32 0xffffff04 er1
479 ;; Now check the result of the move to memory.
480 cmp.b #0xa5, @byte_dst
482 mov.b #0, @byte_dst ; zero it again for the next use.
484 mov_b_imm8_to_indexw32:
485 set_grs_a5a5 ; Fill all general regs with a fixed pattern
486 mov.l #0xffff0005, er1
488 ;; mov.b #xx:8, @(dd:32, rd.w)
489 mov.b #0xa5:8, @(byte_dst-5:32, r1.w) ; byte indexed operand
491 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
497 test_gr_a5a5 0 ; Make sure other general regs not disturbed
498 test_h_gr32 0xffff0005 er1
506 ;; Now check the result of the move to memory.
507 cmp.b #0xa5, @byte_dst
509 mov.b #0, @byte_dst ; zero it again for the next use.
511 mov_b_imm8_to_indexl32:
512 set_grs_a5a5 ; Fill all general regs with a fixed pattern
513 mov.l #0x00000006, er1
515 ;; mov.b #xx:8, @(dd:32, erd.l)
516 mov.b #0xa5:8, @(byte_dst-6:32, er1.l) ; byte indexed operand
518 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
524 test_gr_a5a5 0 ; Make sure other general regs not disturbed
525 test_h_gr32 0x00000006 er1
533 ;; Now check the result of the move to memory.
534 cmp.b #0xa5, @byte_dst
536 mov.b #0, @byte_dst ; zero it again for the next use.
539 set_grs_a5a5 ; Fill all general regs with a fixed pattern
542 ;; mov.b #xx:8, @aa:16
543 mov.b #0xa5:8, @byte_dst:16 ; 16-bit address-direct operand
548 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
554 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
555 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
556 test_gr_a5a5 2 ; to examine the destination memory).
563 ;; Now check the result of the move to memory.
564 cmp.b #0xa5, @byte_dst
568 mov.b #0, @byte_dst ; zero it again for the next use.
571 set_grs_a5a5 ; Fill all general regs with a fixed pattern
574 ;; mov.b #xx:8, @aa:32
575 mov.b #0xa5:8, @byte_dst:32 ; 32-bit address-direct operand
580 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
586 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
587 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
588 test_gr_a5a5 2 ; to examine the destination memory).
595 ;; Now check the result of the move to memory.
596 cmp.b #0xa5, @byte_dst
600 mov.b #0, @byte_dst ; zero it again for the next use.
605 ;; Move byte from register source
609 set_grs_a5a5 ; Fill all general regs with a fixed pattern
614 mov.b r1l, r0l ; Register 8-bit operand
617 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
622 test_h_gr16 0xa512 r0
623 test_h_gr16 0xa512 r1 ; mov src unchanged
625 test_h_gr32 0xa5a5a512 er0
626 test_h_gr32 0xa5a5a512 er1 ; mov src unchanged
628 test_gr_a5a5 2 ; Make sure other general regs not disturbed
636 mov_b_reg8_to_indirect:
637 set_grs_a5a5 ; Fill all general regs with a fixed pattern
642 mov.b r0l, @er1 ; Register indirect operand
645 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
651 test_gr_a5a5 0 ; Make sure other general regs not disturbed
652 test_h_gr32 byte_dst, er1
660 ;; Now check the result of the move to memory.
667 mov.b r0l, @byte_dst ; zero it again for the next use.
669 .if (sim_cpu == h8sx)
670 mov_b_reg8_to_postinc: ; post-increment from register to mem
671 set_grs_a5a5 ; Fill all general regs with a fixed pattern
676 mov.b r0l, @er1+ ; Register post-incr operand
680 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
686 test_gr_a5a5 0 ; Make sure other general regs not disturbed
687 test_h_gr32 byte_dst+1, er1
695 ;; Now check the result of the move to memory.
700 ;; special case same register
710 mov.b #0, @byte_dst ; zero it again for the next use.
712 mov_b_reg8_to_postdec: ; post-decrement from register to mem
713 set_grs_a5a5 ; Fill all general regs with a fixed pattern
718 mov.b r0l, @er1- ; Register post-decr operand
722 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
728 test_gr_a5a5 0 ; Make sure other general regs not disturbed
729 test_h_gr32 byte_dst-1, er1
737 ;; Now check the result of the move to memory.
742 ;; special case same register
752 mov.b #0, @byte_dst ; zero it again for the next use.
754 mov_b_reg8_to_preinc: ; pre-increment from register to mem
755 set_grs_a5a5 ; Fill all general regs with a fixed pattern
759 mov.l #byte_dst-1, er1
760 mov.b r0l, @+er1 ; Register pre-incr operand
764 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
770 test_gr_a5a5 0 ; Make sure other general regs not disturbed
771 test_h_gr32 byte_dst, er1
779 ;; Now check the result of the move to memory.
784 ;; special case same register
785 mov.l #byte_dst-1, er0
794 mov.b #0, @byte_dst ; zero it again for the next use.
797 mov_b_reg8_to_predec: ; pre-decrement from register to mem
798 set_grs_a5a5 ; Fill all general regs with a fixed pattern
802 mov.l #byte_dst+1, er1
803 mov.b r0l, @-er1 ; Register pre-decr operand
806 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
812 test_gr_a5a5 0 ; Make sure other general regs not disturbed
813 test_h_gr32 byte_dst, er1
821 ;; Now check the result of the move to memory.
827 ;; Special case in same register
828 ;; CCR confirmation omitted
829 mov.l #byte_dst+1, er1
839 mov.b r0l, @byte_dst ; zero it again for the next use.
841 .if (sim_cpu == h8sx)
843 set_grs_a5a5 ; Fill all general regs with a fixed pattern
846 ;; mov.b ers, @(dd:2, erd)
847 mov.l #byte_dst-3, er1
848 mov.b r0l, @(3:2, er1) ; Register plus 2-bit disp. operand
852 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
858 test_gr_a5a5 0 ; Make sure other general regs not disturbed
859 test_h_gr32 byte_dst-3, er1
867 ;; Now check the result of the move to memory.
872 mov.b #0, @byte_dst ; zero it again for the next use.
875 mov_b_reg8_to_disp16:
876 set_grs_a5a5 ; Fill all general regs with a fixed pattern
879 ;; mov.b ers, @(dd:16, erd)
880 mov.l #byte_dst-4, er1
881 mov.b r0l, @(4:16, er1) ; Register plus 16-bit disp. operand
885 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
891 test_h_gr32 byte_dst-4, er1
892 test_gr_a5a5 0 ; Make sure other general regs not disturbed
900 ;; Now check the result of the move to memory.
907 mov.b r0l, @byte_dst ; zero it again for the next use.
909 mov_b_reg8_to_disp32:
910 set_grs_a5a5 ; Fill all general regs with a fixed pattern
913 ;; mov.b ers, @(dd:32, erd)
914 mov.l #byte_dst-8, er1
915 mov.b r0l, @(8:32, er1) ; Register plus 32-bit disp. operand
920 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
926 test_h_gr32 byte_dst-8, er1
927 test_gr_a5a5 0 ; Make sure other general regs not disturbed
935 ;; Now check the result of the move to memory.
942 mov.b r0l, @byte_dst ; zero it again for the next use.
944 .if (sim_cpu == h8sx)
945 mov_b_reg8_to_indexb16:
946 set_grs_a5a5 ; Fill all general regs with a fixed pattern
947 mov.l #0xffffff01, er1
949 ;; mov.b ers, @(dd:16, rd.b)
950 mov.b r0l, @(byte_dst-1:16, r1.b) ; byte indexed operand
952 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
958 test_h_gr32 0xffffff01 er1
959 test_gr_a5a5 0 ; Make sure other general regs not disturbed
967 ;; Now check the result of the move to memory.
970 mov.b #0, @byte_dst ; zero it again for the next use.
972 mov_b_reg8_to_indexw16:
973 set_grs_a5a5 ; Fill all general regs with a fixed pattern
974 mov.l #0xffff0002, er1
976 ;; mov.b ers, @(dd:16, rd.w)
977 mov.b r0l, @(byte_dst-2:16, r1.w) ; byte indexed operand
979 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
985 test_h_gr32 0xffff0002 er1
986 test_gr_a5a5 0 ; Make sure other general regs not disturbed
994 ;; Now check the result of the move to memory.
997 mov.b #0, @byte_dst ; zero it again for the next use.
999 mov_b_reg8_to_indexl16:
1000 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1001 mov.l #0x00000003, er1
1003 ;; mov.b ers, @(dd:16, erd.l)
1004 mov.b r0l, @(byte_dst-3:16, er1.l) ; byte indexed operand
1006 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1012 test_h_gr32 0x00000003 er1
1013 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1021 ;; Now check the result of the move to memory.
1022 cmp.b @byte_dst, r0l
1024 mov.b #0, @byte_dst ; zero it again for the next use.
1026 mov_b_reg8_to_indexb32:
1027 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1028 mov.l #0xffffff04 er1
1030 ;; mov.b ers, @(dd:32, rd.b)
1031 mov.b r0l, @(byte_dst-4:32, r1.b) ; byte indexed operand
1033 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1039 test_h_gr32 0xffffff04, er1
1040 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1048 ;; Now check the result of the move to memory.
1049 cmp.b @byte_dst, r0l
1051 mov.b #0, @byte_dst ; zero it again for the next use.
1053 mov_b_reg8_to_indexw32:
1054 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1055 mov.l #0xffff0005 er1
1057 ;; mov.b ers, @(dd:32, rd.w)
1058 mov.b r0l, @(byte_dst-5:32, r1.w) ; byte indexed operand
1060 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1066 test_h_gr32 0xffff0005, er1
1067 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1075 ;; Now check the result of the move to memory.
1076 cmp.b @byte_dst, r0l
1078 mov.b #0, @byte_dst ; zero it again for the next use.
1080 mov_b_reg8_to_indexl32:
1081 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1082 mov.l #0x00000006 er1
1084 ;; mov.b ers, @(dd:32, erd.l)
1085 mov.b r0l, @(byte_dst-6:32, er1.l) ; byte indexed operand
1087 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1093 test_h_gr32 0x00000006, er1
1094 test_gr_a5a5 0 ; Make sure other general regs not disturbed
1102 ;; Now check the result of the move to memory.
1103 cmp.b @byte_dst, r0l
1105 mov.b #0, @byte_dst ; zero it again for the next use.
1108 .if (sim_cpu == h8sx)
1110 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1112 mov.l #byte_dst-20, er0
1116 mov.b r1l, @20:8 ; 8-bit address-direct (sbr-relative) operand
1118 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1124 test_h_gr32 byte_dst-20, er0
1125 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1133 ;; Now check the result of the move to memory.
1134 cmp.b @byte_dst, r1l
1136 mov.b #0, @byte_dst ; zero it again for the next use.
1139 mov_b_reg8_to_abs16:
1140 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1143 ;; mov.b ers, @aa:16
1144 mov.b r0l, @byte_dst:16 ; 16-bit address-direct operand
1148 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1154 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1155 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1156 test_gr_a5a5 2 ; to examine the destination memory).
1163 ;; Now check the result of the move to memory.
1164 mov.b @byte_dst, r0l
1170 mov.b r0l, @byte_dst ; zero it again for the next use.
1172 mov_b_reg8_to_abs32:
1173 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1176 ;; mov.b ers, @aa:32
1177 mov.b r0l, @byte_dst:32 ; 32-bit address-direct operand
1181 ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
1187 test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
1188 test_gr_a5a5 1 ; (first, because on h8/300 we must use one
1189 test_gr_a5a5 2 ; to examine the destination memory).
1196 ;; Now check the result of the move to memory.
1197 mov.b @byte_dst, r0l
1203 mov.b r0l, @byte_dst ; zero it again for the next use.
1206 ;; Move byte to register destination.
1209 mov_b_indirect_to_reg8:
1210 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1214 mov.l #byte_src, er1
1215 mov.b @er1, r0l ; Register indirect operand
1218 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1224 test_h_gr32 0xa5a5a577 er0
1226 test_h_gr32 byte_src, er1
1227 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1234 mov_b_postinc_to_reg8: ; post-increment from mem to register
1235 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1240 mov.l #byte_src, er1
1241 mov.b @er1+, r0l ; Register post-incr operand
1244 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1250 test_h_gr32 0xa5a5a577 er0
1252 test_h_gr32 byte_src+1, er1
1253 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1260 .if (sim_cpu == h8sx)
1261 mov_b_postdec_to_reg8: ; post-decrement from mem to register
1262 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1267 mov.l #byte_src, er1
1268 mov.b @er1-, r0l ; Register post-decr operand
1272 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1278 test_h_gr32 0xa5a5a577 er0
1280 test_h_gr32 byte_src-1, er1
1281 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1288 mov_b_preinc_to_reg8: ; pre-increment from mem to register
1289 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1294 mov.l #byte_src-1, er1
1295 mov.b @+er1, r0l ; Register pre-incr operand
1299 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1305 test_h_gr32 0xa5a5a577 er0
1307 test_h_gr32 byte_src, er1
1308 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1315 mov_b_predec_to_reg8: ; pre-decrement from mem to register
1316 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1321 mov.l #byte_src+1, er1
1322 mov.b @-er1, r0l ; Register pre-decr operand
1326 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1332 test_h_gr32 0xa5a5a577 er0
1334 test_h_gr32 byte_src, er1
1335 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1343 mov_b_disp2_to_reg8:
1344 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1347 ;; mov.b @(dd:2, ers), rd
1348 mov.l #byte_src-1, er1
1349 mov.b @(1:2, er1), r0l ; Register plus 2-bit disp. operand
1353 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1359 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1361 test_h_gr32 byte_src-1, er1
1362 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1370 mov_b_disp16_to_reg8:
1371 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1374 ;; mov.b @(dd:16, ers), rd
1375 mov.l #byte_src+0x1234, er1
1376 mov.b @(-0x1234:16, er1), r0l ; Register plus 16-bit disp. operand
1380 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1386 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1388 test_h_gr32 byte_src+0x1234, er1
1389 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1396 mov_b_disp32_to_reg8:
1397 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1400 ;; mov.b @(dd:32, ers), rd
1401 mov.l #byte_src+65536, er1
1402 mov.b @(-65536:32, er1), r0l ; Register plus 32-bit disp. operand
1407 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1413 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1415 test_h_gr32 byte_src+65536, er1
1416 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1423 .if (sim_cpu == h8sx)
1424 mov_b_indexb16_to_reg8:
1425 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1426 mov.l #0xffffff01, er1
1428 ;; mov.b @(dd:16, rs.b), rd
1429 mov.b @(byte_src-1:16, r1.b), r0l ; indexed byte operand
1431 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1437 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
1439 test_h_gr32 0xffffff01, er1
1440 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1447 mov_b_indexw16_to_reg8:
1448 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1449 mov.l #0xffff0002, er1
1451 ;; mov.b @(dd:16, rs.w), rd
1452 mov.b @(byte_src-2:16, r1.w), r0l ; indexed byte operand
1454 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1460 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
1462 test_h_gr32 0xffff0002, er1
1463 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1470 mov_b_indexl16_to_reg8:
1471 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1472 mov.l #0x00000003, er1
1474 ;; mov.b @(dd:16, ers.l), rd
1475 mov.b @(byte_src-3:16, er1.l), r0l ; indexed byte operand
1477 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1483 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
1485 test_h_gr32 0x00000003, er1
1486 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1493 mov_b_indexb32_to_reg8:
1494 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1495 mov.l #0xffffff04, er1
1497 ;; mov.b @(dd:32, rs.b), rd
1498 mov.b @(byte_src-4:32, r1.b), r0l ; indexed byte operand
1500 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1506 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1508 test_h_gr32 0xffffff04 er1
1509 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1516 mov_b_indexw32_to_reg8:
1517 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1518 mov.l #0xffff0005, er1
1520 ;; mov.b @(dd:32, rs.w), rd
1521 mov.b @(byte_src-5:32, r1.w), r0l ; indexed byte operand
1523 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1529 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1531 test_h_gr32 0xffff0005 er1
1532 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1539 mov_b_indexl32_to_reg8:
1540 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1541 mov.l #0x00000006, er1
1543 ;; mov.b @(dd:32, ers.l), rd
1544 mov.b @(byte_src-6:32, er1.l), r0l ; indexed byte operand
1546 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1552 test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
1554 test_h_gr32 0x00000006 er1
1555 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1564 .if (sim_cpu == h8sx)
1566 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1567 mov.l #byte_src-255, er1
1571 mov.b @0xff:8, r0l ; 8-bit (sbr relative) address-direct operand
1573 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1579 test_h_gr32 0xa5a5a577 er0
1581 test_h_gr32 byte_src-255, er1
1582 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1590 mov_b_abs16_to_reg8:
1591 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1595 mov.b @byte_src:16, r0l ; 16-bit address-direct operand
1599 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1605 test_h_gr32 0xa5a5a577 er0
1607 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1615 mov_b_abs32_to_reg8:
1616 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1620 mov.b @byte_src:32, r0l ; 32-bit address-direct operand
1624 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1630 test_h_gr32 0xa5a5a577 er0
1632 test_gr_a5a5 1 ; Make sure other general regs not disturbed
1640 .if (sim_cpu == h8sx)
1643 ;; Move byte from memory to memory
1646 mov_b_indirect_to_indirect: ; reg indirect, memory to memory
1647 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1652 mov.l #byte_src, er1
1653 mov.l #byte_dst, er0
1658 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1664 ;; Verify the affected registers.
1666 test_h_gr32 byte_dst er0
1667 test_h_gr32 byte_src er1
1668 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1675 ;; Now check the result of the move to memory.
1676 cmp.b @byte_src, @byte_dst
1680 ;; Now clear the destination location, and verify that.
1682 cmp.b @byte_src, @byte_dst
1685 .Lnext57: ; OK, pass on.
1687 mov_b_postinc_to_postinc: ; reg post-increment, memory to memory
1688 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1691 ;; mov.b @ers+, @erd+
1693 mov.l #byte_src, er1
1694 mov.l #byte_dst, er0
1699 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1705 ;; Verify the affected registers.
1707 test_h_gr32 byte_dst+1 er0
1708 test_h_gr32 byte_src+1 er1
1709 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1716 ;; Now check the result of the move to memory.
1717 cmp.b @byte_src, @byte_dst
1721 ;; Now clear the destination location, and verify that.
1723 cmp.b @byte_src, @byte_dst
1726 .Lnext66: ; OK, pass on.
1727 ;; special case same register
1728 mov.l #byte_src, er0
1729 mov.b @er0+, @er0+ ; copying byte_src to byte_dst
1730 test_h_gr32 byte_src+2 er0
1731 cmp.b @byte_src, @byte_dst
1735 ;; Now clear the destination location, and verify that.
1737 cmp.b @byte_src, @byte_dst
1742 mov_b_postdec_to_postdec: ; reg post-decrement, memory to memory
1743 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1746 ;; mov.b @ers-, @erd-
1748 mov.l #byte_src, er1
1749 mov.l #byte_dst, er0
1754 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1760 ;; Verify the affected registers.
1762 test_h_gr32 byte_dst-1 er0
1763 test_h_gr32 byte_src-1 er1
1764 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1771 ;; Now check the result of the move to memory.
1772 cmp.b @byte_src, @byte_dst
1776 ;; Now clear the destination location, and verify that.
1778 cmp.b @byte_src, @byte_dst
1781 .Lnext76: ; OK, pass on.
1782 ;; special case same register
1783 mov.l #byte_src, er0
1784 mov.b @er0-, @er0- ; copying byte_src to byte_dst_dec
1785 test_h_gr32 byte_src-2 er0
1786 cmp.b @byte_src, @byte_dst_dec
1790 ;; Now clear the destination location, and verify that.
1791 mov.b #0, @byte_dst_dec
1792 cmp.b @byte_src, @byte_dst_dec
1797 mov_b_preinc_to_preinc: ; reg pre-increment, memory to memory
1798 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1801 ;; mov.b @+ers, @+erd
1803 mov.l #byte_src-1, er1
1804 mov.l #byte_dst-1, er0
1809 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1815 ;; Verify the affected registers.
1817 test_h_gr32 byte_dst er0
1818 test_h_gr32 byte_src er1
1819 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1826 ;; Now check the result of the move to memory.
1827 cmp.b @byte_src, @byte_dst
1831 ;; Now clear the destination location, and verify that.
1833 cmp.b @byte_src, @byte_dst
1836 .Lnext86: ; OK, pass on.
1837 ;; special case same register
1838 mov.l #byte_src-1, er0
1839 mov.b @+er0, @+er0 ; copying byte_src to byte_dst
1840 test_h_gr32 byte_src+1 er0
1841 cmp.b @byte_src, @byte_dst
1845 ;; Now clear the destination location, and verify that.
1847 cmp.b @byte_src, @byte_dst
1852 mov_b_predec_to_predec: ; reg pre-decrement, memory to memory
1853 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1856 ;; mov.b @-ers, @-erd
1858 mov.l #byte_src+1, er1
1859 mov.l #byte_dst+1, er0
1864 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1870 ;; Verify the affected registers.
1872 test_h_gr32 byte_dst er0
1873 test_h_gr32 byte_src er1
1874 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1881 ;; Now check the result of the move to memory.
1882 cmp.b @byte_src, @byte_dst
1886 ;; Now clear the destination location, and verify that.
1888 cmp.b @byte_src, @byte_dst
1891 .Lnext96: ; OK, pass on.
1892 ;; special case same register
1893 mov.l #byte_src+1, er0
1894 mov.b @-er0, @-er0 ; copying byte_src to byte_dst_dec
1895 test_h_gr32 byte_src-1 er0
1896 cmp.b @byte_src, @byte_dst_dec
1900 ;; Now clear the destination location, and verify that.
1901 mov.b #0, @byte_dst_dec
1902 cmp.b @byte_src, @byte_dst_dec
1907 mov_b_disp2_to_disp2: ; reg 2-bit disp, memory to memory
1908 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1911 ;; mov.b @(dd:2, ers), @(dd:2, erd)
1913 mov.l #byte_src-1, er1
1914 mov.l #byte_dst-2, er0
1915 mov.b @(1:2, er1), @(2:2, er0)
1919 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1925 ;; Verify the affected registers.
1927 test_h_gr32 byte_dst-2 er0
1928 test_h_gr32 byte_src-1 er1
1929 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1936 ;; Now check the result of the move to memory.
1937 cmp.b @byte_src, @byte_dst
1941 ;; Now clear the destination location, and verify that.
1943 cmp.b @byte_src, @byte_dst
1946 .Lnext106: ; OK, pass on.
1948 mov_b_disp16_to_disp16: ; reg 16-bit disp, memory to memory
1949 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1952 ;; mov.b @(dd:16, ers), @(dd:16, erd)
1954 mov.l #byte_src-1, er1
1955 mov.l #byte_dst-2, er0
1956 mov.b @(1:16, er1), @(2:16, er0)
1962 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
1968 ;; Verify the affected registers.
1970 test_h_gr32 byte_dst-2 er0
1971 test_h_gr32 byte_src-1 er1
1972 test_gr_a5a5 2 ; Make sure other general regs not disturbed
1979 ;; Now check the result of the move to memory.
1980 cmp.b @byte_src, @byte_dst
1984 ;; Now clear the destination location, and verify that.
1986 cmp.b @byte_src, @byte_dst
1989 .Lnext116: ; OK, pass on.
1991 mov_b_disp32_to_disp32: ; reg 32-bit disp, memory to memory
1992 set_grs_a5a5 ; Fill all general regs with a fixed pattern
1995 ;; mov.b @(dd:32, ers), @(dd:32, erd)
1997 mov.l #byte_src-1, er1
1998 mov.l #byte_dst-2, er0
1999 mov.b @(1:32, er1), @(2:32, er0)
2005 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2011 ;; Verify the affected registers.
2013 test_h_gr32 byte_dst-2 er0
2014 test_h_gr32 byte_src-1 er1
2015 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2022 ;; Now check the result of the move to memory.
2023 cmp.b @byte_src, @byte_dst
2027 ;; Now clear the destination location, and verify that.
2029 cmp.b @byte_src, @byte_dst
2032 .Lnext126: ; OK, pass on.
2034 mov_b_indexb16_to_indexb16: ; reg 16-bit indexed, memory to memory
2035 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2036 mov.l #0xffffff01, er1
2037 mov.l #0xffffff02, er0
2038 ;; mov.b @(dd:16, rs.b), @(dd:16, rd.b)
2040 mov.b @(byte_src-1:16, r1.b), @(byte_dst-2:16, r0.b)
2042 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2048 ;; Verify the affected registers.
2050 test_h_gr32 0xffffff02 er0
2051 test_h_gr32 0xffffff01 er1
2052 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2059 ;; Now check the result of the move to memory.
2060 cmp.b @byte_src, @byte_dst
2062 ;; Now clear the destination location, and verify that.
2064 cmp.b @byte_src, @byte_dst
2067 mov_b_indexw16_to_indewb16: ; reg 16-bit indexed, memory to memory
2068 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2069 mov.l #0xffff0003, er1
2070 mov.l #0xffff0004, er0
2071 ;; mov.b @(dd:16, rs.w), @(dd:16, rd.w)
2073 mov.b @(byte_src-3:16, r1.w), @(byte_dst-4:16, r0.w)
2075 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2081 ;; Verify the affected registers.
2083 test_h_gr32 0xffff0004 er0
2084 test_h_gr32 0xffff0003 er1
2085 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2092 ;; Now check the result of the move to memory.
2093 cmp.b @byte_src, @byte_dst
2095 ;; Now clear the destination location, and verify that.
2097 cmp.b @byte_src, @byte_dst
2100 mov_b_indexl16_to_indexl16: ; reg 16-bit indexed, memory to memory
2101 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2102 mov.l #0x00000005, er1
2103 mov.l #0x00000006, er0
2104 ;; mov.b @(dd:16, ers.l), @(dd:16, erd.l)
2106 mov.b @(byte_src-5:16, er1.l), @(byte_dst-6:16, er0.l)
2108 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2114 ;; Verify the affected registers.
2116 test_h_gr32 0x00000006 er0
2117 test_h_gr32 0x00000005 er1
2118 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2125 ;; Now check the result of the move to memory.
2126 cmp.b @byte_src, @byte_dst
2128 ;; Now clear the destination location, and verify that.
2130 cmp.b @byte_src, @byte_dst
2133 mov_b_indexb32_to_indexb32: ; reg 32-bit indexed, memory to memory
2134 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2135 mov.l #0xffffff01, er1
2136 mov.l #0xffffff02, er0
2138 ;; mov.b @(dd:32, rs.b), @(dd:32, rd.b)
2139 mov.b @(byte_src-1:32, r1.b), @(byte_dst-2:32, r0.b)
2141 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2147 ;; Verify the affected registers.
2149 test_h_gr32 0xffffff02 er0
2150 test_h_gr32 0xffffff01 er1
2151 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2158 ;; Now check the result of the move to memory.
2159 cmp.b @byte_src, @byte_dst
2161 ;; Now clear the destination location, and verify that.
2163 cmp.b @byte_src, @byte_dst
2166 mov_b_indexw32_to_indexw32: ; reg 32-bit indexed, memory to memory
2167 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2168 mov.l #0xffff0003, er1
2169 mov.l #0xffff0004, er0
2171 ;; mov.b @(dd:32, rs.w), @(dd:32, rd.w)
2172 mov.b @(byte_src-3:32, r1.w), @(byte_dst-4:32, r0.w)
2174 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2180 ;; Verify the affected registers.
2182 test_h_gr32 0xffff0004 er0
2183 test_h_gr32 0xffff0003 er1
2184 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2191 ;; Now check the result of the move to memory.
2192 cmp.b @byte_src, @byte_dst
2194 ;; Now clear the destination location, and verify that.
2196 cmp.b @byte_src, @byte_dst
2199 mov_b_indexl32_to_indexl32: ; reg 32-bit indexed, memory to memory
2200 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2201 mov.l #0x00000005, er1
2202 mov.l #0x00000006, er0
2204 ;; mov.b @(dd:32, rs.w), @(dd:32, rd.w)
2205 mov.b @(byte_src-5:32, er1.l), @(byte_dst-6:32, er0.l)
2207 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2213 ;; Verify the affected registers.
2215 test_h_gr32 0x00000006 er0
2216 test_h_gr32 0x00000005 er1
2217 test_gr_a5a5 2 ; Make sure other general regs not disturbed
2224 ;; Now check the result of the move to memory.
2225 cmp.b @byte_src, @byte_dst
2227 ;; Now clear the destination location, and verify that.
2229 cmp.b @byte_src, @byte_dst
2232 mov_b_abs16_to_abs16: ; 16-bit absolute addr, memory to memory
2233 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2236 ;; mov.b @aa:16, @aa:16
2238 mov.b @byte_src:16, @byte_dst:16
2244 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2251 test_gr_a5a5 0 ; Make sure *NO* general registers are changed
2260 ;; Now check the result of the move to memory.
2261 cmp.b @byte_src, @byte_dst
2265 ;; Now clear the destination location, and verify that.
2267 cmp.b @byte_src, @byte_dst
2270 .Lnext136: ; OK, pass on.
2272 mov_b_abs32_to_abs32: ; 32-bit absolute addr, memory to memory
2273 set_grs_a5a5 ; Fill all general regs with a fixed pattern
2276 ;; mov.b @aa:32, @aa:32
2278 mov.b @byte_src:32, @byte_dst:32
2284 ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
2290 test_gr_a5a5 0 ; Make sure *NO* general registers are changed
2299 ;; Now check the result of the move to memory.
2300 cmp.b @byte_src, @byte_dst
2304 ;; Now clear the destination location, and verify that.
2306 cmp.b @byte_src, @byte_dst
2309 .Lnext146: ; OK, pass on.