1 # Hitachi H8 testcase 'add.l'
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"
12 # Instructions tested:
21 # add.l xx:16, @(dd:2, erd)
22 # add.l xx:16, @(dd:16, erd)
23 # add.l xx:16, @(dd:32, erd)
30 # add.l xx:32, @(dd:2, erd)
31 # add.l xx:32, @(dd:16, erd)
32 # add.l xx:32, @(dd:32, erd)
41 # add.l ers, @(dd:2, erd)
42 # add.l ers, @(dd:16, erd)
43 # add.l ers, @(dd:32, erd)
52 # add.l @(dd:2, ers), erd
53 # add.l @(dd:16, ers), erd
54 # add.l @(dd:32, ers), erd
62 # add.l @(dd:2, ers), @(dd:2, erd)
63 # add.l @(dd:16, ers), @(dd:16, erd)
64 # add.l @(dd:32, ers), @(dd:32, erd)
65 # add.l @aa:16, @aa:16
66 # add.l @aa:32, @aa:32
80 ;;
Add long from immediate source
85 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
89 add.l #0x3:3, er0 ; Immediate 16-bit operand
92 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
98 test_h_gr32
0xa5a5a5a8 er0
100 test_gr_a5a5
1 ; Make sure other general regs
not disturbed
108 add_l_imm16_to_reg32
:
109 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
113 add.l #0x1234, er0 ; Immediate 16-bit operand
117 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
123 test_h_gr32
0xa5a5b7d9 er0
125 test_gr_a5a5
1 ; Make sure other general regs
not disturbed
134 add_l_imm32_to_reg32
:
135 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
139 add.l #0x12345678, er0 ; Immediate 32-bit operand
143 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
149 test_h_gr32
0xb7d9fc1d er0
151 test_gr_a5a5
1 ; Make sure other general regs
not disturbed
159 .if (sim_cpu == h8sx)
160 add_l_imm16_to_indirect
:
161 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
164 ;;
add.l #xx:16, @erd
166 add.l #0xdead:16, @er1 ; Register indirect operand
171 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
177 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
178 test_h_gr32 long_dst
, er1
186 ;; Now check the result of the move to memory.
187 cmp.
l #0x876621ce, @long_dst
191 mov.
l #0x87654321, @long_dst ; Initialize it again for the next use.
193 add_l_imm16_to_postinc
: ; post-increment from imm16 to mem
194 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
197 ;;
add.l #xx:16, @erd+
199 add.l #0xdead:16, @er1+ ; Imm16, register post-incr operands.
204 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
210 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
211 test_h_gr32 long_dst+
4, er1
219 ;; Now check the result of the move to memory.
220 cmp.
l #0x876621ce, @long_dst
224 mov.
l #0x87654321, @long_dst ; initialize it again for the next use.
226 add_l_imm16_to_postdec
: ; post-decrement from imm16 to mem
227 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
230 ;;
add.l #xx:16, @erd-
232 add.l #0xdead:16, @er1- ; Imm16, register post-decr operands.
237 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
243 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
244 test_h_gr32 long_dst-
4, er1
252 ;; Now check the result of the move to memory.
253 cmp.
l #0x876621ce, @long_dst
257 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
259 add_l_imm16_to_preinc
: ; pre-increment from register to mem
260 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
263 ;;
add.l #xx:16, @+erd
264 mov.
l #long_dst-4, er1
265 add.l #0xdead:16, @+er1 ; Imm16, register pre-incr operands
270 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
276 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
277 test_h_gr32 long_dst
, er1
285 ;; Now check the result of the move to memory.
286 cmp.
l #0x876621ce, @long_dst
290 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
292 add_l_imm16_to_predec
: ; pre-decrement from register to mem
293 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
296 ;;
add.l #xx:16, @-erd
297 mov.
l #long_dst+4, er1
298 add.l #0xdead:16, @-er1 ; Imm16, register pre-decr operands
303 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
309 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
310 test_h_gr32 long_dst
, er1
318 ;; Now check the result of the move to memory.
319 cmp.
l #0x876621ce, @long_dst
323 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
325 add_l_imm16_to_disp2
:
326 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
329 ;;
add.l #xx:16, @(dd:2, erd)
330 mov.
l #long_dst-12, er1
331 add.l #0xdead:16, @(12:2, er1) ; Imm16, reg plus 2-bit disp. operand
336 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
342 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
343 test_h_gr32 long_dst-
12, er1
351 ;; Now check the result of the move to memory.
352 cmp.
l #0x876621ce, @long_dst
356 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
358 add_l_imm16_to_disp16
:
359 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
362 ;;
add.l #xx:16, @(dd:16, erd)
363 mov.
l #long_dst-4, er1
364 add.l #0xdead:16, @(4:16, er1) ; Register plus 16-bit disp. operand
370 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
376 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
377 test_h_gr32 long_dst-
4, er1
385 ;; Now check the result of the move to memory.
386 cmp.
l #0x876621ce, @long_dst
390 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
392 add_l_imm16_to_disp32
:
393 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
396 ;;
add.l #xx:16, @(dd:32, erd)
397 mov.
l #long_dst-8, er1
398 add.l #0xdead:16, @(8:32, er1) ; Register plus 32-bit disp. operand
404 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
410 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
411 test_h_gr32 long_dst-
8, er1
419 ;; Now check the result of the move to memory.
420 cmp.
l #0x876621ce, @long_dst
424 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
426 add_l_imm16_to_abs16
:
427 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
430 ;;
add.l #xx:16, @aa:16
431 add.l #0xdead:16, @long_dst:16 ; 16-bit address-direct operand
437 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
443 test_gr_a5a5
0 ; Make sure _ALL_ general regs
not disturbed
444 test_gr_a5a5
1 ;
(first
, because on h8
/300 we must use one
445 test_gr_a5a5
2 ; to examine the destination memory
).
452 ;; Now check the result of the move to memory.
453 cmp.
l #0x876621ce, @long_dst
457 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
459 add_l_imm16_to_abs32
:
460 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
463 ;;
add.l #xx:16, @aa:32
464 add.l #0xdead:16, @long_dst:32 ; 32-bit address-direct operand
470 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
476 test_gr_a5a5
0 ; Make sure _ALL_ general regs
not disturbed
477 test_gr_a5a5
1 ;
(first
, because on h8
/300 we must use one
478 test_gr_a5a5
2 ; to examine the destination memory
).
485 ;; Now check the result of the move to memory.
486 cmp.
l #0x876621ce, @long_dst
490 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
492 add_l_imm32_to_indirect
:
493 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
496 ;;
add.l #xx:32, @erd
498 add.l #0xcafedead:32, @er1 ; Register indirect operand
503 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
509 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
510 test_h_gr32 long_dst
, er1
518 ;; Now check the result of the move to memory.
519 cmp.
l #0x526421ce, @long_dst
523 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
525 add_l_imm32_to_postinc
: ; post-increment from imm32 to mem
526 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
529 ;;
add.l #xx:32, @erd+
531 add.l #0xcafedead:32, @er1+ ; Imm32, register post-incr operands.
536 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
542 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
543 test_h_gr32 long_dst+
4, er1
551 ;; Now check the result of the move to memory.
552 cmp.
l #0x526421ce, @long_dst
556 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
558 add_l_imm32_to_postdec
: ; post-decrement from imm32 to mem
559 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
562 ;;
add.l #xx:32, @erd-
564 add.l #0xcafedead:32, @er1- ; Imm32, register post-decr operands.
569 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
575 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
576 test_h_gr32 long_dst-
4, er1
584 ;; Now check the result of the move to memory.
585 cmp.
l #0x526421ce, @long_dst
589 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
591 add_l_imm32_to_preinc
: ; pre-increment from register to mem
592 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
595 ;;
add.l #xx:32, @+erd
596 mov.
l #long_dst-4, er1
597 add.l #0xcafedead:32, @+er1 ; Imm32, register pre-incr operands
602 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
608 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
609 test_h_gr32 long_dst
, er1
617 ;; Now check the result of the move to memory.
618 cmp.
l #0x526421ce, @long_dst
622 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
624 add_l_imm32_to_predec
: ; pre-decrement from register to mem
625 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
628 ;;
add.l #xx:32, @-erd
629 mov.
l #long_dst+4, er1
630 add.l #0xcafedead:32, @-er1 ; Imm32, register pre-decr operands
635 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
641 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
642 test_h_gr32 long_dst
, er1
650 ;; Now check the result of the move to memory.
651 cmp.
l #0x526421ce, @long_dst
655 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
657 add_l_imm32_to_disp2
:
658 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
661 ;;
add.l #xx:32, @(dd:2, erd)
662 mov.
l #long_dst-12, er1
663 add.l #0xcafedead:32, @(12:2, er1) ; Imm32, reg plus 2-bit disp. operand
668 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
674 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
675 test_h_gr32 long_dst-
12, er1
683 ;; Now check the result of the move to memory.
684 cmp.
l #0x526421ce, @long_dst
688 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
690 add_l_imm32_to_disp16
:
691 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
694 ;;
add.l #xx:32, @(dd:16, erd)
695 mov.
l #long_dst-4, er1
696 add.l #0xcafedead:32, @(4:16, er1) ; Register plus 16-bit disp. operand
702 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
708 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
709 test_h_gr32 long_dst-
4, er1
717 ;; Now check the result of the move to memory.
718 cmp.
l #0x526421ce, @long_dst
722 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
724 add_l_imm32_to_disp32
:
725 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
728 ;;
add.l #xx:32, @(dd:32, erd)
729 mov.
l #long_dst-8, er1
730 add.l #0xcafedead:32, @(8:32, er1) ; Register plus 32-bit disp. operand
736 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
742 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
743 test_h_gr32 long_dst-
8, er1
751 ;; Now check the result of the move to memory.
752 cmp.
l #0x526421ce, @long_dst
756 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
758 add_l_imm32_to_abs16
:
759 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
762 ;;
add.l #xx:32, @aa:16
763 add.l #0xcafedead:32, @long_dst:16 ; 16-bit address-direct operand
769 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
775 test_gr_a5a5
0 ; Make sure _ALL_ general regs
not disturbed
776 test_gr_a5a5
1 ;
(first
, because on h8
/300 we must use one
777 test_gr_a5a5
2 ; to examine the destination memory
).
784 ;; Now check the result of the move to memory.
785 cmp.
l #0x526421ce, @long_dst
789 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
791 add_l_imm32_to_abs32
:
792 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
795 ;;
add.l #xx:32, @aa:32
796 add.l #0xcafedead:32, @long_dst:32 ; 32-bit address-direct operand
802 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
808 test_gr_a5a5
0 ; Make sure _ALL_ general regs
not disturbed
809 test_gr_a5a5
1 ;
(first
, because on h8
/300 we must use one
810 test_gr_a5a5
2 ; to examine the destination memory
).
817 ;; Now check the result of the move to memory.
818 cmp.
l #0x526421ce, @long_dst
822 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
826 ;;
Add long from register source
829 add_l_reg32_to_reg32
:
830 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
834 mov.
l #0x12345678, er1
835 add.l er1
, er0 ; Register
32-bit operand
838 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
844 test_h_gr32
0xb7d9fc1d er0 ;
add result
845 test_h_gr32
0x12345678 er1 ;
add src unchanged
847 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
854 .if (sim_cpu == h8sx)
855 add_l_reg32_to_indirect
:
856 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
861 add.l er0
, @er1 ; Register indirect operand
865 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
871 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
872 test_h_gr32 long_dst
, er1
880 ;; Now check the result of the move to memory.
881 cmp.
l #0x2d0ae8c6, @long_dst
885 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
887 add_l_reg32_to_postinc
: ; post-increment from register to mem
888 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
893 add.l er0
, @er1+ ; Register post-incr operand
897 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
903 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
904 test_h_gr32 long_dst+
4, er1
912 ;; Now check the result of the move to memory.
913 cmp.
l #0x2d0ae8c6, @long_dst
917 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
919 add_l_reg32_to_postdec
: ; post-decrement from register to mem
920 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
925 add.l er0
, @er1- ; Register post-decr operand
929 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
935 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
936 test_h_gr32 long_dst-
4, er1
944 ;; Now check the result of the move to memory.
945 cmp.
l #0x2d0ae8c6, @long_dst
949 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
951 add_l_reg32_to_preinc
: ; pre-increment from register to mem
952 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
956 mov.
l #long_dst-4, er1
957 add.l er0
, @
+er1 ; Register pre-incr operand
961 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
967 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
968 test_h_gr32 long_dst
, er1
976 ;; Now check the result of the move to memory.
977 cmp.
l #0x2d0ae8c6, @long_dst
981 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
983 add_l_reg32_to_predec
: ; pre-decrement from register to mem
984 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
988 mov.
l #long_dst+4, er1
989 add.l er0
, @
-er1 ; Register pre-decr operand
993 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
999 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
1000 test_h_gr32 long_dst
, er1
1008 ;; Now check the result of the move to memory.
1009 cmp.
l #0x2d0ae8c6, @long_dst
1013 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
1015 add_l_reg32_to_disp2
:
1016 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1019 ;;
add.l ers
, @
(dd
:2, erd
)
1020 mov.
l #long_dst-12, er1
1021 add.l er0
, @
(12:2, er1
) ; Register plus
2-bit disp. operand
1025 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
1031 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
1032 test_h_gr32 long_dst-
12, er1
1040 ;; Now check the result of the move to memory.
1041 cmp.
l #0x2d0ae8c6, @long_dst
1045 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
1047 add_l_reg32_to_disp16
:
1048 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1051 ;;
add.l ers
, @
(dd
:16, erd
)
1052 mov.
l #long_dst-4, er1
1053 add.l er0
, @
(4:16, er1
) ; Register plus
16-bit disp. operand
1058 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
1064 test_h_gr32 long_dst-
4, er1
1065 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
1073 ;; Now check the result of the move to memory.
1074 cmp.
l #0x2d0ae8c6, @long_dst
1078 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
1080 add_l_reg32_to_disp32
:
1081 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1084 ;;
add.l ers
, @
(dd
:32, erd
)
1085 mov.
l #long_dst-8, er1
1086 add.l er0
, @
(8:32, er1
) ; Register plus
32-bit disp. operand
1091 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
1097 test_h_gr32 long_dst-
8, er1
1098 test_gr_a5a5
0 ; Make sure other general regs
not disturbed
1106 ;; Now check the result of the move to memory.
1107 cmp.
l #0x2d0ae8c6, @long_dst
1111 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
1113 add_l_reg32_to_abs16
:
1114 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1117 ;;
add.l ers
, @aa
:16
1118 add.l er0
, @long_dst
:16 ;
16-bit address-direct operand
1123 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
1129 test_gr_a5a5
0 ; Make sure _ALL_ general regs
not disturbed
1130 test_gr_a5a5
1 ;
(first
, because on h8
/300 we must use one
1131 test_gr_a5a5
2 ; to examine the destination memory
).
1138 ;; Now check the result of the move to memory.
1139 cmp.
l #0x2d0ae8c6, @long_dst
1143 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
1145 add_l_reg32_to_abs32
:
1146 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1149 ;;
add.l ers
, @aa
:32
1150 add.l er0
, @long_dst
:32 ;
32-bit address-direct operand
1155 ;; test ccr ; H
=0 N
=0 Z
=0 V
=1 C
=1
1161 test_gr_a5a5
0 ; Make sure _ALL_ general regs
not disturbed
1162 test_gr_a5a5
1 ;
(first
, because on h8
/300 we must use one
1163 test_gr_a5a5
2 ; to examine the destination memory
).
1170 ;; Now check the result of the move to memory.
1171 cmp.
l #0x2d0ae8c6, @long_dst
1175 mov.
l #0x87654321, @long_dst ; Re-initialize it for the next use.
1178 ;;
Add long to register destination.
1181 add_l_indirect_to_reg32
:
1182 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1186 mov.
l #long_src, er1
1187 add.l @er1
, er0 ; Register indirect operand
1191 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1197 test_h_gr32
0xb7d9fc1d er0
1199 test_h_gr32 long_src
, er1
1200 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1207 add_l_postinc_to_reg32
: ; post-increment from mem to register
1208 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1212 mov.
l #long_src, er1
1213 add.l @er1+
, er0 ; Register post-incr operand
1217 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1223 test_h_gr32
0xb7d9fc1d er0
1225 test_h_gr32 long_src+
4, er1
1226 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1233 add_l_postdec_to_reg32
: ; post-decrement from mem to register
1234 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1238 mov.
l #long_src, er1
1239 add.l @er1-
, er0 ; Register post-decr operand
1243 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1249 test_h_gr32
0xb7d9fc1d er0
1251 test_h_gr32 long_src-
4, er1
1252 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1259 add_l_preinc_to_reg32
: ; pre-increment from mem to register
1260 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1264 mov.
l #long_src-4, er1
1265 add.l @
+er1
, er0 ; Register pre-incr operand
1269 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1275 test_h_gr32
0xb7d9fc1d er0
1277 test_h_gr32 long_src
, er1
1278 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1285 add_l_predec_to_reg32
: ; pre-decrement from mem to register
1286 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1290 mov.
l #long_src+4, er1
1291 add.l @
-er1
, er0 ; Register pre-decr operand
1295 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1301 test_h_gr32
0xb7d9fc1d er0
1303 test_h_gr32 long_src
, er1
1304 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1312 add_l_disp2_to_reg32
:
1313 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1316 ;;
add.l @
(dd
:2, ers
), erd
1317 mov.
l #long_src-4, er1
1318 add.l @
(4:2, er1
), er0 ; Register plus
2-bit disp. operand
1322 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1328 test_h_gr32
0xb7d9fc1d er0 ; mov result
: a5a5 |
7777
1330 test_h_gr32 long_src-
4, er1
1331 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1338 add_l_disp16_to_reg32
:
1339 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1342 ;;
add.l @
(dd
:16, ers
), erd
1343 mov.
l #long_src+0x1234, er1
1344 add.l @
(-0x1234:16, er1
), er0 ; Register plus
16-bit disp. operand
1349 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1355 test_h_gr32
0xb7d9fc1d er0 ; mov result
: a5a5 |
7777
1357 test_h_gr32 long_src+
0x1234, er1
1358 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1365 add_l_disp32_to_reg32
:
1366 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1369 ;;
add.l @
(dd
:32, ers
), erd
1370 mov.
l #long_src+65536, er1
1371 add.l @
(-65536:32, er1
), er0 ; Register plus
32-bit disp. operand
1376 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1382 test_h_gr32
0xb7d9fc1d er0 ; mov result
: a5a5 |
7777
1384 test_h_gr32 long_src+
65536, er1
1385 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1392 add_l_abs16_to_reg32
:
1393 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1396 ;;
add.l @aa
:16, erd
1397 add.l @long_src
:16, er0 ;
16-bit address-direct operand
1402 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1408 test_h_gr32
0xb7d9fc1d er0
1410 test_gr_a5a5
1 ; Make sure other general regs
not disturbed
1418 add_l_abs32_to_reg32
:
1419 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1422 ;;
add.l @aa
:32, erd
1423 add.l @long_src
:32, er0 ;
32-bit address-direct operand
1428 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1434 test_h_gr32
0xb7d9fc1d er0
1436 test_gr_a5a5
1 ; Make sure other general regs
not disturbed
1446 ;;
Add long from memory to memory
1449 add_l_indirect_to_indirect
: ; reg indirect
, memory to memory
1450 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1454 mov.
l #long_src, er1
1455 mov.
l #long_dst, er0
1461 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1467 ;; Verify the affected registers.
1469 test_h_gr32 long_dst er0
1470 test_h_gr32 long_src er1
1471 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1478 ;; Now check the result of the move to memory.
1479 cmp.
l #0x99999999, @long_dst ; FIXME
1483 ;; Now clear the destination location
, and verify that.
1484 mov.
l #0x87654321, @long_dst
1485 cmp.
l #0x99999999, @long_dst
1488 .Lnext56: ; OK, pass on.
1490 add_l_postinc_to_postinc
: ; reg post-increment
, memory to memory
1491 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1494 ;;
add.l @ers+
, @erd+
1495 mov.
l #long_src, er1
1496 mov.
l #long_dst, er0
1502 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1508 ;; Verify the affected registers.
1510 test_h_gr32 long_dst+
4 er0
1511 test_h_gr32 long_src+
4 er1
1512 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1519 ;; Now check the result of the move to memory.
1520 cmp.
l #0x99999999, @long_dst
1524 ;; Now clear the destination location
, and verify that.
1525 mov.
l #0x87654321, @long_dst
1526 cmp.
l #0x99999999, @long_dst
1529 .Lnext66: ; OK, pass on.
1531 add_l_postdec_to_postdec
: ; reg post-decrement
, memory to memory
1532 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1535 ;;
add.l @ers-
, @erd-
1536 mov.
l #long_src, er1
1537 mov.
l #long_dst, er0
1543 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1549 ;; Verify the affected registers.
1551 test_h_gr32 long_dst-
4 er0
1552 test_h_gr32 long_src-
4 er1
1553 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1560 ;; Now check the result of the move to memory.
1561 cmp.
l #0x99999999, @long_dst
1565 ;; Now clear the destination location
, and verify that.
1566 mov.
l #0x87654321, @long_dst
1567 cmp.
l #0x99999999, @long_dst
1570 .Lnext76: ; OK, pass on.
1572 add_l_preinc_to_preinc
: ; reg pre-increment
, memory to memory
1573 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1576 ;;
add.l @
+ers
, @
+erd
1577 mov.
l #long_src-4, er1
1578 mov.
l #long_dst-4, er0
1584 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1590 ;; Verify the affected registers.
1592 test_h_gr32 long_dst er0
1593 test_h_gr32 long_src er1
1594 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1601 ;; Now check the result of the move to memory.
1602 cmp.
l #0x99999999, @long_dst
1606 ;; Now clear the destination location
, and verify that.
1607 mov.
l #0x87654321, @long_dst
1608 cmp.
l #0x99999999, @long_dst
1611 .Lnext86: ; OK, pass on.
1613 add_l_predec_to_predec
: ; reg pre-decrement
, memory to memory
1614 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1617 ;;
add.l @
-ers
, @
-erd
1618 mov.
l #long_src+4, er1
1619 mov.
l #long_dst+4, er0
1625 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1631 ;; Verify the affected registers.
1633 test_h_gr32 long_dst er0
1634 test_h_gr32 long_src er1
1635 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1642 ;; Now check the result of the move to memory.
1643 cmp.
l #0x99999999, @long_dst
1647 ;; Now clear the destination location
, and verify that.
1648 mov.
l #0x87654321, @long_dst
1649 cmp.
l #0x99999999, @long_dst
1652 .Lnext96: ; OK, pass on.
1654 add_l_disp2_to_disp2
: ; reg
2-bit disp
, memory to memory
1655 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1658 ;;
add.l @
(dd
:2, ers
), @
(dd
:2, erd
)
1659 mov.
l #long_src-4, er1
1660 mov.
l #long_dst-8, er0
1661 add.l @
(4:2, er1
), @
(8:2, er0
)
1666 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1672 ;; Verify the affected registers.
1674 test_h_gr32 long_dst-
8 er0
1675 test_h_gr32 long_src-
4 er1
1676 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1683 ;; Now check the result of the move to memory.
1684 cmp.
l #0x99999999, @long_dst
1688 ;; Now clear the destination location
, and verify that.
1689 mov.
l #0x87654321, @long_dst
1690 cmp.
l #0x99999999, @long_dst
1693 .Lnext106: ; OK, pass on.
1695 add_l_disp16_to_disp16
: ; reg
16-bit disp
, memory to memory
1696 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1699 ;;
add.l @
(dd
:16, ers
), @
(dd
:16, erd
)
1700 mov.
l #long_src-1, er1
1701 mov.
l #long_dst-2, er0
1702 add.l @
(1:16, er1
), @
(2:16, er0
)
1709 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1715 ;; Verify the affected registers.
1717 test_h_gr32 long_dst-
2 er0
1718 test_h_gr32 long_src-
1 er1
1719 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1726 ;; Now check the result of the move to memory.
1727 cmp.
l #0x99999999, @long_dst
1731 ;; Now clear the destination location
, and verify that.
1732 mov.
l #0x87654321, @long_dst
1733 cmp.
l #0x99999999, @long_dst
1736 .Lnext116: ; OK, pass on.
1738 add_l_disp32_to_disp32
: ; reg
32-bit disp
, memory to memory
1739 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1742 ;;
add.l @
(dd
:32, ers
), @
(dd
:32, erd
)
1743 mov.
l #long_src-1, er1
1744 mov.
l #long_dst-2, er0
1745 add.l @
(1:32, er1
), @
(2:32, er0
)
1753 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1759 ;; Verify the affected registers.
1761 test_h_gr32 long_dst-
2 er0
1762 test_h_gr32 long_src-
1 er1
1763 test_gr_a5a5
2 ; Make sure other general regs
not disturbed
1770 ;; Now check the result of the move to memory.
1771 cmp.
l #0x99999999, @long_dst
1775 ;; Now clear the destination location
, and verify that.
1776 mov.
l #0x87654321, @long_dst
1777 cmp.
l #0x99999999, @long_dst
1780 .Lnext126: ; OK, pass on.
1782 add_l_abs16_to_abs16
: ;
16-bit absolute addr
, memory to memory
1783 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1786 ;;
add.l @aa
:16, @aa
:16
1787 add.l @long_src
:16, @long_dst
:16
1794 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1801 test_gr_a5a5
0 ; Make sure
*NO
* general registers are changed
1810 ;; Now check the result of the move to memory.
1811 cmp.
l #0x99999999, @long_dst
1815 ;; Now clear the destination location
, and verify that.
1816 mov.
l #0x87654321, @long_dst
1817 cmp.
l #0x99999999, @long_dst
1820 .Lnext136: ; OK, pass on.
1822 add_l_abs32_to_abs32
: ;
32-bit absolute addr
, memory to memory
1823 set_grs_a5a5 ; Fill all general regs with
a fixed pattern
1826 ;;
add.l @aa
:32, @aa
:32
1827 add.l @long_src
:32, @long_dst
:32
1834 ;; test ccr ; H
=0 N
=1 Z
=0 V
=0 C
=0
1840 test_gr_a5a5
0 ; Make sure
*NO
* general registers are changed
1849 ;; Now check the result of the move to memory.
1850 cmp.
l #0x99999999, @long_dst
1854 ;; Now clear the destination location
, and verify that.
1855 mov.
l #0x87654321, @long_dst
1856 cmp.
l #0x99999999, @long_dst
1859 .Lnext146: ; OK, pass on.