Home | History | Annotate | Line # | Download | only in h8300
movw.s revision 1.1
      1  1.1  christos # Hitachi H8 testcase 'mov.w'
      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	2
     16  1.1  christos word_dst_dec:
     17  1.1  christos 	.word	0
     18  1.1  christos word_src:
     19  1.1  christos 	.word	0x7777
     20  1.1  christos word_dst:
     21  1.1  christos 	.word	0
     22  1.1  christos 
     23  1.1  christos 	.text
     24  1.1  christos 
     25  1.1  christos 	;;
     26  1.1  christos 	;; Move word from immediate source
     27  1.1  christos 	;;
     28  1.1  christos 
     29  1.1  christos .if (sim_cpu == h8sx)
     30  1.1  christos mov_w_imm3_to_reg16:
     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.w #xx:3, rd
     35  1.1  christos 	mov.w	#0x3:3, r0	; Immediate 3-bit operand
     36  1.1  christos ;;;	.word	0x0f30
     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 0xa5a50003 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 mov_w_imm16_to_reg16:
     56  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     57  1.1  christos 	set_ccr_zero
     58  1.1  christos 
     59  1.1  christos 	;; mov.w #xx:16, rd
     60  1.1  christos 	mov.w	#0x1234, r0	; Immediate 16-bit operand
     61  1.1  christos ;;;	.word	0x7900
     62  1.1  christos ;;;	.word	0x1234
     63  1.1  christos 
     64  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
     65  1.1  christos 	test_neg_clear
     66  1.1  christos 	test_zero_clear
     67  1.1  christos 	test_ovf_clear
     68  1.1  christos 	test_carry_clear
     69  1.1  christos 
     70  1.1  christos 	test_h_gr32 0xa5a51234 er0
     71  1.1  christos 
     72  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     73  1.1  christos 	test_gr_a5a5 2
     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 .if (sim_cpu == h8sx)
     81  1.1  christos mov_w_imm4_to_abs16:
     82  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     83  1.1  christos 	set_ccr_zero
     84  1.1  christos 
     85  1.1  christos 	;; mov.w #xx:4, @aa:16
     86  1.1  christos 	mov.w	#0xf:4, @word_dst:16	; 4-bit imm to 16-bit address-direct
     87  1.1  christos ;;;	.word	0x6bdf
     88  1.1  christos ;;;	.word	@word_dst
     89  1.1  christos 
     90  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
     91  1.1  christos 	test_neg_clear
     92  1.1  christos 	test_zero_clear
     93  1.1  christos 	test_ovf_clear
     94  1.1  christos 	test_carry_clear
     95  1.1  christos 
     96  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
     97  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
     98  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
     99  1.1  christos 	test_gr_a5a5 3
    100  1.1  christos 	test_gr_a5a5 4
    101  1.1  christos 	test_gr_a5a5 5
    102  1.1  christos 	test_gr_a5a5 6
    103  1.1  christos 	test_gr_a5a5 7
    104  1.1  christos 
    105  1.1  christos 	;; Now check the result of the move to memory.
    106  1.1  christos 	cmp.w	#0xf, @word_dst
    107  1.1  christos 	beq	.Lnext21
    108  1.1  christos 	fail
    109  1.1  christos .Lnext21:
    110  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    111  1.1  christos 
    112  1.1  christos mov_w_imm4_to_abs32:
    113  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    114  1.1  christos 	set_ccr_zero
    115  1.1  christos 
    116  1.1  christos 	;; mov.w #xx:4, @aa:32
    117  1.1  christos 	mov.w	#0xf:4, @word_dst:32	; 4-bit imm to 32-bit address-direct
    118  1.1  christos ;;;	.word	0x6bff
    119  1.1  christos ;;;	.long	@word_dst
    120  1.1  christos 
    121  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    122  1.1  christos 	test_neg_clear
    123  1.1  christos 	test_zero_clear
    124  1.1  christos 	test_ovf_clear
    125  1.1  christos 	test_carry_clear
    126  1.1  christos 
    127  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
    128  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
    129  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
    130  1.1  christos 	test_gr_a5a5 3
    131  1.1  christos 	test_gr_a5a5 4
    132  1.1  christos 	test_gr_a5a5 5
    133  1.1  christos 	test_gr_a5a5 6
    134  1.1  christos 	test_gr_a5a5 7
    135  1.1  christos 
    136  1.1  christos 	;; Now check the result of the move to memory.
    137  1.1  christos 	cmp.w	#0xf, @word_dst
    138  1.1  christos 	beq	.Lnext22
    139  1.1  christos 	fail
    140  1.1  christos .Lnext22:
    141  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    142  1.1  christos 
    143  1.1  christos mov_w_imm8_to_indirect:
    144  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    145  1.1  christos 	set_ccr_zero
    146  1.1  christos 
    147  1.1  christos 	;; mov.w #xx:8, @erd
    148  1.1  christos 	mov.l	#word_dst, er1
    149  1.1  christos 	mov.w	#0xa5:8, @er1	; Register indirect operand
    150  1.1  christos ;;;	.word	0x015d
    151  1.1  christos ;;;	.word	0x01a5
    152  1.1  christos 
    153  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    154  1.1  christos 	test_neg_clear
    155  1.1  christos 	test_zero_clear
    156  1.1  christos 	test_ovf_clear
    157  1.1  christos 	test_carry_clear
    158  1.1  christos 
    159  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    160  1.1  christos 	test_h_gr32	word_dst, er1
    161  1.1  christos 	test_gr_a5a5 2
    162  1.1  christos 	test_gr_a5a5 3
    163  1.1  christos 	test_gr_a5a5 4
    164  1.1  christos 	test_gr_a5a5 5
    165  1.1  christos 	test_gr_a5a5 6
    166  1.1  christos 	test_gr_a5a5 7
    167  1.1  christos 
    168  1.1  christos 	;; Now check the result of the move to memory.
    169  1.1  christos 	cmp.w	#0xa5, @word_dst
    170  1.1  christos 	beq	.Lnext1
    171  1.1  christos 	fail
    172  1.1  christos .Lnext1:
    173  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    174  1.1  christos 
    175  1.1  christos mov_w_imm8_to_postinc:		; post-increment from imm8 to mem
    176  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    177  1.1  christos 	set_ccr_zero
    178  1.1  christos 
    179  1.1  christos 	;; mov.w #xx:8, @erd+
    180  1.1  christos 	mov.l	#word_dst, er1
    181  1.1  christos 	mov.w	#0xa5:8, @er1+	; Imm8, register post-incr operands.
    182  1.1  christos ;;;	.word	0x015d
    183  1.1  christos ;;;	.word	0x81a5
    184  1.1  christos 
    185  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    186  1.1  christos 	test_neg_clear
    187  1.1  christos 	test_zero_clear
    188  1.1  christos 	test_ovf_clear
    189  1.1  christos 	test_carry_clear
    190  1.1  christos 
    191  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    192  1.1  christos 	test_h_gr32	word_dst+2, er1
    193  1.1  christos 	test_gr_a5a5 2
    194  1.1  christos 	test_gr_a5a5 3
    195  1.1  christos 	test_gr_a5a5 4
    196  1.1  christos 	test_gr_a5a5 5
    197  1.1  christos 	test_gr_a5a5 6
    198  1.1  christos 	test_gr_a5a5 7
    199  1.1  christos 
    200  1.1  christos 	;; Now check the result of the move to memory.
    201  1.1  christos 	cmp.w	#0xa5, @word_dst
    202  1.1  christos 	beq	.Lnext2
    203  1.1  christos 	fail
    204  1.1  christos .Lnext2:
    205  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    206  1.1  christos 
    207  1.1  christos mov_w_imm8_to_postdec:		; post-decrement from imm8 to mem
    208  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    209  1.1  christos 	set_ccr_zero
    210  1.1  christos 
    211  1.1  christos 	;; mov.w #xx:8, @erd-
    212  1.1  christos 	mov.l	#word_dst, er1
    213  1.1  christos 	mov.w	#0xa5:8, @er1-	; Imm8, register post-decr operands.
    214  1.1  christos ;;;	.word	0x015d
    215  1.1  christos ;;;	.word	0xa1a5
    216  1.1  christos 
    217  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    218  1.1  christos 	test_neg_clear
    219  1.1  christos 	test_zero_clear
    220  1.1  christos 	test_ovf_clear
    221  1.1  christos 	test_carry_clear
    222  1.1  christos 
    223  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    224  1.1  christos 	test_h_gr32	word_dst-2, er1
    225  1.1  christos 	test_gr_a5a5 2
    226  1.1  christos 	test_gr_a5a5 3
    227  1.1  christos 	test_gr_a5a5 4
    228  1.1  christos 	test_gr_a5a5 5
    229  1.1  christos 	test_gr_a5a5 6
    230  1.1  christos 	test_gr_a5a5 7
    231  1.1  christos 
    232  1.1  christos 	;; Now check the result of the move to memory.
    233  1.1  christos 	cmp.w	#0xa5, @word_dst
    234  1.1  christos 	beq	.Lnext3
    235  1.1  christos 	fail
    236  1.1  christos .Lnext3:
    237  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    238  1.1  christos 
    239  1.1  christos mov_w_imm8_to_preinc:		; pre-increment from register to mem
    240  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    241  1.1  christos 	set_ccr_zero
    242  1.1  christos 
    243  1.1  christos 	;; mov.w #xx:8, @+erd
    244  1.1  christos 	mov.l	#word_dst-2, er1
    245  1.1  christos 	mov.w	#0xa5:8, @+er1	; Imm8, register pre-incr operands
    246  1.1  christos ;;;	.word	0x015d
    247  1.1  christos ;;;	.word	0x91a5
    248  1.1  christos 
    249  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    250  1.1  christos 	test_neg_clear
    251  1.1  christos 	test_zero_clear
    252  1.1  christos 	test_ovf_clear
    253  1.1  christos 	test_carry_clear
    254  1.1  christos 
    255  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    256  1.1  christos 	test_h_gr32	word_dst, er1
    257  1.1  christos 	test_gr_a5a5 2
    258  1.1  christos 	test_gr_a5a5 3
    259  1.1  christos 	test_gr_a5a5 4
    260  1.1  christos 	test_gr_a5a5 5
    261  1.1  christos 	test_gr_a5a5 6
    262  1.1  christos 	test_gr_a5a5 7
    263  1.1  christos 
    264  1.1  christos 	;; Now check the result of the move to memory.
    265  1.1  christos 	cmp.w	#0xa5, @word_dst
    266  1.1  christos 	beq	.Lnext4
    267  1.1  christos 	fail
    268  1.1  christos .Lnext4:
    269  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    270  1.1  christos 
    271  1.1  christos mov_w_imm8_to_predec:		; pre-decrement from register to mem
    272  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    273  1.1  christos 	set_ccr_zero
    274  1.1  christos 
    275  1.1  christos 	;; mov.w #xx:8, @-erd
    276  1.1  christos 	mov.l	#word_dst+2, er1
    277  1.1  christos 	mov.w	#0xa5:8, @-er1	; Imm8, register pre-decr operands
    278  1.1  christos ;;;	.word	0x015d
    279  1.1  christos ;;;	.word	0xb1a5
    280  1.1  christos 
    281  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    282  1.1  christos 	test_neg_clear
    283  1.1  christos 	test_zero_clear
    284  1.1  christos 	test_ovf_clear
    285  1.1  christos 	test_carry_clear
    286  1.1  christos 
    287  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    288  1.1  christos 	test_h_gr32	word_dst, er1
    289  1.1  christos 	test_gr_a5a5 2
    290  1.1  christos 	test_gr_a5a5 3
    291  1.1  christos 	test_gr_a5a5 4
    292  1.1  christos 	test_gr_a5a5 5
    293  1.1  christos 	test_gr_a5a5 6
    294  1.1  christos 	test_gr_a5a5 7
    295  1.1  christos 
    296  1.1  christos 	;; Now check the result of the move to memory.
    297  1.1  christos 	cmp.w	#0xa5, @word_dst
    298  1.1  christos 	beq	.Lnext5
    299  1.1  christos 	fail
    300  1.1  christos .Lnext5:
    301  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    302  1.1  christos 
    303  1.1  christos mov_w_imm8_to_disp2:
    304  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    305  1.1  christos 	set_ccr_zero
    306  1.1  christos 
    307  1.1  christos 	;; mov.w #xx:8, @(dd:2, erd)
    308  1.1  christos 	mov.l	#word_dst-6, er1
    309  1.1  christos 	mov.w	#0xa5:8, @(6:2, er1)	; Imm8, reg plus 2-bit disp. operand
    310  1.1  christos ;;;	.word	0x015d
    311  1.1  christos ;;;	.word	0x31a5
    312  1.1  christos 
    313  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    314  1.1  christos 	test_neg_clear
    315  1.1  christos 	test_zero_clear
    316  1.1  christos 	test_ovf_clear
    317  1.1  christos 	test_carry_clear
    318  1.1  christos 
    319  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    320  1.1  christos 	test_h_gr32	word_dst-6, er1
    321  1.1  christos 	test_gr_a5a5 2
    322  1.1  christos 	test_gr_a5a5 3
    323  1.1  christos 	test_gr_a5a5 4
    324  1.1  christos 	test_gr_a5a5 5
    325  1.1  christos 	test_gr_a5a5 6
    326  1.1  christos 	test_gr_a5a5 7
    327  1.1  christos 
    328  1.1  christos 	;; Now check the result of the move to memory.
    329  1.1  christos 	cmp.w	#0xa5, @word_dst
    330  1.1  christos 	beq	.Lnext6
    331  1.1  christos 	fail
    332  1.1  christos .Lnext6:
    333  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    334  1.1  christos 
    335  1.1  christos mov_w_imm8_to_disp16:
    336  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    337  1.1  christos 	set_ccr_zero
    338  1.1  christos 
    339  1.1  christos 	;; mov.w #xx:8, @(dd:16, erd)
    340  1.1  christos 	mov.l	#word_dst-4, er1
    341  1.1  christos 	mov.w	#0xa5:8, @(4:16, er1)	; Register plus 16-bit disp. operand
    342  1.1  christos ;;;	.word	0x015d
    343  1.1  christos ;;;	.word	0x6f90
    344  1.1  christos ;;;	.word	0x0004
    345  1.1  christos 
    346  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    347  1.1  christos 	test_neg_clear
    348  1.1  christos 	test_zero_clear
    349  1.1  christos 	test_ovf_clear
    350  1.1  christos 	test_carry_clear
    351  1.1  christos 
    352  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    353  1.1  christos 	test_h_gr32	word_dst-4, er1
    354  1.1  christos 	test_gr_a5a5 2
    355  1.1  christos 	test_gr_a5a5 3
    356  1.1  christos 	test_gr_a5a5 4
    357  1.1  christos 	test_gr_a5a5 5
    358  1.1  christos 	test_gr_a5a5 6
    359  1.1  christos 	test_gr_a5a5 7
    360  1.1  christos 
    361  1.1  christos 	;; Now check the result of the move to memory.
    362  1.1  christos 	cmp.w	#0xa5, @word_dst
    363  1.1  christos 	beq	.Lnext7
    364  1.1  christos 	fail
    365  1.1  christos .Lnext7:
    366  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    367  1.1  christos 
    368  1.1  christos mov_w_imm8_to_disp32:
    369  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    370  1.1  christos 	set_ccr_zero
    371  1.1  christos 
    372  1.1  christos 	;; mov.w #xx:8, @(dd:32, erd)
    373  1.1  christos 	mov.l	#word_dst-8, er1
    374  1.1  christos 	mov.w	#0xa5:8, @(8:32, er1)	; Register plus 32-bit disp. operand
    375  1.1  christos ;;;	.word	0x015d
    376  1.1  christos ;;;	.word	0xc9a5
    377  1.1  christos ;;;	.long	8
    378  1.1  christos 
    379  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    380  1.1  christos 	test_neg_clear
    381  1.1  christos 	test_zero_clear
    382  1.1  christos 	test_ovf_clear
    383  1.1  christos 	test_carry_clear
    384  1.1  christos 
    385  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    386  1.1  christos 	test_h_gr32	word_dst-8, er1
    387  1.1  christos 	test_gr_a5a5 2
    388  1.1  christos 	test_gr_a5a5 3
    389  1.1  christos 	test_gr_a5a5 4
    390  1.1  christos 	test_gr_a5a5 5
    391  1.1  christos 	test_gr_a5a5 6
    392  1.1  christos 	test_gr_a5a5 7
    393  1.1  christos 
    394  1.1  christos 	;; Now check the result of the move to memory.
    395  1.1  christos 	cmp.w	#0xa5, @word_dst
    396  1.1  christos 	beq	.Lnext8
    397  1.1  christos 	fail
    398  1.1  christos .Lnext8:
    399  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    400  1.1  christos 
    401  1.1  christos mov_w_imm8_to_abs16:
    402  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    403  1.1  christos 	set_ccr_zero
    404  1.1  christos 
    405  1.1  christos 	;; mov.w #xx:8, @aa:16
    406  1.1  christos 	mov.w	#0xa5:8, @word_dst:16	; 16-bit address-direct operand
    407  1.1  christos ;;;	.word	0x015d
    408  1.1  christos ;;;	.word	0x40a5
    409  1.1  christos ;;;	.word	@word_dst
    410  1.1  christos 
    411  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    412  1.1  christos 	test_neg_clear
    413  1.1  christos 	test_zero_clear
    414  1.1  christos 	test_ovf_clear
    415  1.1  christos 	test_carry_clear
    416  1.1  christos 
    417  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
    418  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
    419  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
    420  1.1  christos 	test_gr_a5a5 3
    421  1.1  christos 	test_gr_a5a5 4
    422  1.1  christos 	test_gr_a5a5 5
    423  1.1  christos 	test_gr_a5a5 6
    424  1.1  christos 	test_gr_a5a5 7
    425  1.1  christos 
    426  1.1  christos 	;; Now check the result of the move to memory.
    427  1.1  christos 	cmp.w	#0xa5, @word_dst
    428  1.1  christos 	beq	.Lnext9
    429  1.1  christos 	fail
    430  1.1  christos .Lnext9:
    431  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    432  1.1  christos 
    433  1.1  christos mov_w_imm8_to_abs32:
    434  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    435  1.1  christos 	set_ccr_zero
    436  1.1  christos 
    437  1.1  christos 	;; mov.w #xx:8, @aa:32
    438  1.1  christos 	mov.w	#0xa5:8, @word_dst:32	; 32-bit address-direct operand
    439  1.1  christos ;;;	.word	0x015d
    440  1.1  christos ;;;	.word	0x48a5
    441  1.1  christos ;;;	.long	@word_dst
    442  1.1  christos 
    443  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    444  1.1  christos 	test_neg_clear
    445  1.1  christos 	test_zero_clear
    446  1.1  christos 	test_ovf_clear
    447  1.1  christos 	test_carry_clear
    448  1.1  christos 
    449  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
    450  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
    451  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
    452  1.1  christos 	test_gr_a5a5 3
    453  1.1  christos 	test_gr_a5a5 4
    454  1.1  christos 	test_gr_a5a5 5
    455  1.1  christos 	test_gr_a5a5 6
    456  1.1  christos 	test_gr_a5a5 7
    457  1.1  christos 
    458  1.1  christos 	;; Now check the result of the move to memory.
    459  1.1  christos 	cmp.w	#0xa5, @word_dst
    460  1.1  christos 	beq	.Lnext10
    461  1.1  christos 	fail
    462  1.1  christos .Lnext10:
    463  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    464  1.1  christos 
    465  1.1  christos mov_w_imm16_to_indirect:
    466  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    467  1.1  christos 	set_ccr_zero
    468  1.1  christos 
    469  1.1  christos 	;; mov.w #xx:16, @erd
    470  1.1  christos 	mov.l	#word_dst, er1
    471  1.1  christos 	mov.w	#0xdead:16, @er1	; Register indirect operand
    472  1.1  christos ;;;	.word	0x7974
    473  1.1  christos ;;;	.word	0xdead
    474  1.1  christos ;;;	.word	0x0100
    475  1.1  christos 
    476  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    477  1.1  christos 	test_neg_set
    478  1.1  christos 	test_zero_clear
    479  1.1  christos 	test_ovf_clear
    480  1.1  christos 	test_carry_clear
    481  1.1  christos 
    482  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    483  1.1  christos 	test_h_gr32	word_dst, er1
    484  1.1  christos 	test_gr_a5a5 2
    485  1.1  christos 	test_gr_a5a5 3
    486  1.1  christos 	test_gr_a5a5 4
    487  1.1  christos 	test_gr_a5a5 5
    488  1.1  christos 	test_gr_a5a5 6
    489  1.1  christos 	test_gr_a5a5 7
    490  1.1  christos 
    491  1.1  christos 	;; Now check the result of the move to memory.
    492  1.1  christos 	cmp.w	#0xdead, @word_dst
    493  1.1  christos 	beq	.Lnext11
    494  1.1  christos 	fail
    495  1.1  christos .Lnext11:
    496  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    497  1.1  christos 
    498  1.1  christos mov_w_imm16_to_postinc:		; post-increment from imm16 to mem
    499  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    500  1.1  christos 	set_ccr_zero
    501  1.1  christos 
    502  1.1  christos 	;; mov.w #xx:16, @erd+
    503  1.1  christos 	mov.l	#word_dst, er1
    504  1.1  christos 	mov.w	#0xdead:16, @er1+	; Imm16, register post-incr operands.
    505  1.1  christos ;;;	.word	0x7974
    506  1.1  christos ;;;	.word	0xdead
    507  1.1  christos ;;;	.word	0x8100
    508  1.1  christos 
    509  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    510  1.1  christos 	test_neg_set
    511  1.1  christos 	test_zero_clear
    512  1.1  christos 	test_ovf_clear
    513  1.1  christos 	test_carry_clear
    514  1.1  christos 
    515  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    516  1.1  christos 	test_h_gr32	word_dst+2, er1
    517  1.1  christos 	test_gr_a5a5 2
    518  1.1  christos 	test_gr_a5a5 3
    519  1.1  christos 	test_gr_a5a5 4
    520  1.1  christos 	test_gr_a5a5 5
    521  1.1  christos 	test_gr_a5a5 6
    522  1.1  christos 	test_gr_a5a5 7
    523  1.1  christos 
    524  1.1  christos 	;; Now check the result of the move to memory.
    525  1.1  christos 	cmp.w	#0xdead, @word_dst
    526  1.1  christos 	beq	.Lnext12
    527  1.1  christos 	fail
    528  1.1  christos .Lnext12:
    529  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    530  1.1  christos 
    531  1.1  christos mov_w_imm16_to_postdec:		; post-decrement from imm16 to mem
    532  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    533  1.1  christos 	set_ccr_zero
    534  1.1  christos 
    535  1.1  christos 	;; mov.w #xx:16, @erd-
    536  1.1  christos 	mov.l	#word_dst, er1
    537  1.1  christos 	mov.w	#0xdead:16, @er1-	; Imm16, register post-decr operands.
    538  1.1  christos ;;;	.word	0x7974
    539  1.1  christos ;;;	.word	0xdead
    540  1.1  christos ;;;	.word	0xa100
    541  1.1  christos 
    542  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    543  1.1  christos 	test_neg_set
    544  1.1  christos 	test_zero_clear
    545  1.1  christos 	test_ovf_clear
    546  1.1  christos 	test_carry_clear
    547  1.1  christos 
    548  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    549  1.1  christos 	test_h_gr32	word_dst-2, er1
    550  1.1  christos 	test_gr_a5a5 2
    551  1.1  christos 	test_gr_a5a5 3
    552  1.1  christos 	test_gr_a5a5 4
    553  1.1  christos 	test_gr_a5a5 5
    554  1.1  christos 	test_gr_a5a5 6
    555  1.1  christos 	test_gr_a5a5 7
    556  1.1  christos 
    557  1.1  christos 	;; Now check the result of the move to memory.
    558  1.1  christos 	cmp.w	#0xdead, @word_dst
    559  1.1  christos 	beq	.Lnext13
    560  1.1  christos 	fail
    561  1.1  christos .Lnext13:
    562  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    563  1.1  christos 
    564  1.1  christos mov_w_imm16_to_preinc:		; pre-increment from register to mem
    565  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    566  1.1  christos 	set_ccr_zero
    567  1.1  christos 
    568  1.1  christos 	;; mov.w #xx:16, @+erd
    569  1.1  christos 	mov.l	#word_dst-2, er1
    570  1.1  christos 	mov.w	#0xdead:16, @+er1	; Imm16, register pre-incr operands
    571  1.1  christos ;;;	.word	0x7974
    572  1.1  christos ;;;	.word	0xdead
    573  1.1  christos ;;;	.word	0x9100
    574  1.1  christos 
    575  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    576  1.1  christos 	test_neg_set
    577  1.1  christos 	test_zero_clear
    578  1.1  christos 	test_ovf_clear
    579  1.1  christos 	test_carry_clear
    580  1.1  christos 
    581  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    582  1.1  christos 	test_h_gr32	word_dst, er1
    583  1.1  christos 	test_gr_a5a5 2
    584  1.1  christos 	test_gr_a5a5 3
    585  1.1  christos 	test_gr_a5a5 4
    586  1.1  christos 	test_gr_a5a5 5
    587  1.1  christos 	test_gr_a5a5 6
    588  1.1  christos 	test_gr_a5a5 7
    589  1.1  christos 
    590  1.1  christos 	;; Now check the result of the move to memory.
    591  1.1  christos 	cmp.w	#0xdead, @word_dst
    592  1.1  christos 	beq	.Lnext14
    593  1.1  christos 	fail
    594  1.1  christos .Lnext14:
    595  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    596  1.1  christos 
    597  1.1  christos mov_w_imm16_to_predec:		; pre-decrement from register to mem
    598  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    599  1.1  christos 	set_ccr_zero
    600  1.1  christos 
    601  1.1  christos 	;; mov.w #xx:16, @-erd
    602  1.1  christos 	mov.l	#word_dst+2, er1
    603  1.1  christos 	mov.w	#0xdead:16, @-er1	; Imm16, register pre-decr operands
    604  1.1  christos ;;;	.word	0x7974
    605  1.1  christos ;;;	.word	0xdead
    606  1.1  christos ;;;	.word	0xb100
    607  1.1  christos 
    608  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    609  1.1  christos 	test_neg_set
    610  1.1  christos 	test_zero_clear
    611  1.1  christos 	test_ovf_clear
    612  1.1  christos 	test_carry_clear
    613  1.1  christos 
    614  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    615  1.1  christos 	test_h_gr32	word_dst, er1
    616  1.1  christos 	test_gr_a5a5 2
    617  1.1  christos 	test_gr_a5a5 3
    618  1.1  christos 	test_gr_a5a5 4
    619  1.1  christos 	test_gr_a5a5 5
    620  1.1  christos 	test_gr_a5a5 6
    621  1.1  christos 	test_gr_a5a5 7
    622  1.1  christos 
    623  1.1  christos 	;; Now check the result of the move to memory.
    624  1.1  christos 	cmp.w	#0xdead, @word_dst
    625  1.1  christos 	beq	.Lnext15
    626  1.1  christos 	fail
    627  1.1  christos .Lnext15:
    628  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    629  1.1  christos 
    630  1.1  christos mov_w_imm16_to_disp2:
    631  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    632  1.1  christos 	set_ccr_zero
    633  1.1  christos 
    634  1.1  christos 	;; mov.w #xx:16, @(dd:2, erd)
    635  1.1  christos 	mov.l	#word_dst-6, er1
    636  1.1  christos 	mov.w	#0xdead:16, @(6:2, er1)	; Imm16, reg plus 2-bit disp. operand
    637  1.1  christos ;;;	.word	0x7974
    638  1.1  christos ;;;	.word	0xdead
    639  1.1  christos ;;;	.word	0x3100
    640  1.1  christos 
    641  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    642  1.1  christos 	test_neg_set
    643  1.1  christos 	test_zero_clear
    644  1.1  christos 	test_ovf_clear
    645  1.1  christos 	test_carry_clear
    646  1.1  christos 
    647  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    648  1.1  christos 	test_h_gr32	word_dst-6, er1
    649  1.1  christos 	test_gr_a5a5 2
    650  1.1  christos 	test_gr_a5a5 3
    651  1.1  christos 	test_gr_a5a5 4
    652  1.1  christos 	test_gr_a5a5 5
    653  1.1  christos 	test_gr_a5a5 6
    654  1.1  christos 	test_gr_a5a5 7
    655  1.1  christos 
    656  1.1  christos 	;; Now check the result of the move to memory.
    657  1.1  christos 	cmp.w	#0xdead, @word_dst
    658  1.1  christos 	beq	.Lnext16
    659  1.1  christos 	fail
    660  1.1  christos .Lnext16:
    661  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    662  1.1  christos 
    663  1.1  christos mov_w_imm16_to_disp16:
    664  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    665  1.1  christos 	set_ccr_zero
    666  1.1  christos 
    667  1.1  christos 	;; mov.w #xx:16, @(dd:16, erd)
    668  1.1  christos 	mov.l	#word_dst-4, er1
    669  1.1  christos 	mov.w	#0xdead:16, @(4:16, er1)	; Register plus 16-bit disp. operand
    670  1.1  christos ;;;	.word	0x7974
    671  1.1  christos ;;;	.word	0xdead
    672  1.1  christos ;;;	.word	0xc100
    673  1.1  christos ;;;	.word	0x0004
    674  1.1  christos 
    675  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    676  1.1  christos 	test_neg_set
    677  1.1  christos 	test_zero_clear
    678  1.1  christos 	test_ovf_clear
    679  1.1  christos 	test_carry_clear
    680  1.1  christos 
    681  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    682  1.1  christos 	test_h_gr32	word_dst-4, er1
    683  1.1  christos 	test_gr_a5a5 2
    684  1.1  christos 	test_gr_a5a5 3
    685  1.1  christos 	test_gr_a5a5 4
    686  1.1  christos 	test_gr_a5a5 5
    687  1.1  christos 	test_gr_a5a5 6
    688  1.1  christos 	test_gr_a5a5 7
    689  1.1  christos 
    690  1.1  christos 	;; Now check the result of the move to memory.
    691  1.1  christos 	cmp.w	#0xdead, @word_dst
    692  1.1  christos 	beq	.Lnext17
    693  1.1  christos 	fail
    694  1.1  christos .Lnext17:
    695  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    696  1.1  christos 
    697  1.1  christos mov_w_imm16_to_disp32:
    698  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    699  1.1  christos 	set_ccr_zero
    700  1.1  christos 
    701  1.1  christos 	;; mov.w #xx:16, @(dd:32, erd)
    702  1.1  christos 	mov.l	#word_dst-8, er1
    703  1.1  christos 	mov.w	#0xdead:16, @(8:32, er1)   ; Register plus 32-bit disp. operand
    704  1.1  christos ;;;	.word	0x7974
    705  1.1  christos ;;;	.word	0xdead
    706  1.1  christos ;;;	.word	0xc900
    707  1.1  christos ;;;	.long	8
    708  1.1  christos 
    709  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    710  1.1  christos 	test_neg_set
    711  1.1  christos 	test_zero_clear
    712  1.1  christos 	test_ovf_clear
    713  1.1  christos 	test_carry_clear
    714  1.1  christos 
    715  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    716  1.1  christos 	test_h_gr32	word_dst-8, er1
    717  1.1  christos 	test_gr_a5a5 2
    718  1.1  christos 	test_gr_a5a5 3
    719  1.1  christos 	test_gr_a5a5 4
    720  1.1  christos 	test_gr_a5a5 5
    721  1.1  christos 	test_gr_a5a5 6
    722  1.1  christos 	test_gr_a5a5 7
    723  1.1  christos 
    724  1.1  christos 	;; Now check the result of the move to memory.
    725  1.1  christos 	cmp.w	#0xdead, @word_dst
    726  1.1  christos 	beq	.Lnext18
    727  1.1  christos 	fail
    728  1.1  christos .Lnext18:
    729  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    730  1.1  christos 
    731  1.1  christos mov_w_imm16_to_abs16:
    732  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    733  1.1  christos 	set_ccr_zero
    734  1.1  christos 
    735  1.1  christos 	;; mov.w #xx:16, @aa:16
    736  1.1  christos 	mov.w	#0xdead:16, @word_dst:16	; 16-bit address-direct operand
    737  1.1  christos ;;;	.word	0x7974
    738  1.1  christos ;;;	.word	0xdead
    739  1.1  christos ;;;	.word	0x4000
    740  1.1  christos ;;;	.word	@word_dst
    741  1.1  christos 
    742  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    743  1.1  christos 	test_neg_set
    744  1.1  christos 	test_zero_clear
    745  1.1  christos 	test_ovf_clear
    746  1.1  christos 	test_carry_clear
    747  1.1  christos 
    748  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
    749  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
    750  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
    751  1.1  christos 	test_gr_a5a5 3
    752  1.1  christos 	test_gr_a5a5 4
    753  1.1  christos 	test_gr_a5a5 5
    754  1.1  christos 	test_gr_a5a5 6
    755  1.1  christos 	test_gr_a5a5 7
    756  1.1  christos 
    757  1.1  christos 	;; Now check the result of the move to memory.
    758  1.1  christos 	cmp.w	#0xdead, @word_dst
    759  1.1  christos 	beq	.Lnext19
    760  1.1  christos 	fail
    761  1.1  christos .Lnext19:
    762  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    763  1.1  christos 
    764  1.1  christos mov_w_imm16_to_abs32:
    765  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    766  1.1  christos 	set_ccr_zero
    767  1.1  christos 
    768  1.1  christos 	;; mov.w #xx:16, @aa:32
    769  1.1  christos 	mov.w	#0xdead:16, @word_dst:32	; 32-bit address-direct operand
    770  1.1  christos ;;;	.word	0x7974
    771  1.1  christos ;;;	.word	0xdead
    772  1.1  christos ;;;	.word	0x4800
    773  1.1  christos ;;;	.long	@word_dst
    774  1.1  christos 
    775  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    776  1.1  christos 	test_neg_set
    777  1.1  christos 	test_zero_clear
    778  1.1  christos 	test_ovf_clear
    779  1.1  christos 	test_carry_clear
    780  1.1  christos 
    781  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
    782  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
    783  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
    784  1.1  christos 	test_gr_a5a5 3
    785  1.1  christos 	test_gr_a5a5 4
    786  1.1  christos 	test_gr_a5a5 5
    787  1.1  christos 	test_gr_a5a5 6
    788  1.1  christos 	test_gr_a5a5 7
    789  1.1  christos 
    790  1.1  christos 	;; Now check the result of the move to memory.
    791  1.1  christos 	cmp.w	#0xdead, @word_dst
    792  1.1  christos 	beq	.Lnext20
    793  1.1  christos 	fail
    794  1.1  christos .Lnext20:
    795  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    796  1.1  christos .endif
    797  1.1  christos 
    798  1.1  christos 	;;
    799  1.1  christos 	;; Move word from register source
    800  1.1  christos 	;;
    801  1.1  christos 
    802  1.1  christos mov_w_reg16_to_reg16:
    803  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    804  1.1  christos 	set_ccr_zero
    805  1.1  christos 
    806  1.1  christos 	;; mov.w ers, erd
    807  1.1  christos 	mov.w	#0x1234, r1
    808  1.1  christos 	mov.w	r1, r0		; Register 16-bit operand
    809  1.1  christos ;;;	.word	0x0d10
    810  1.1  christos 
    811  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
    812  1.1  christos 	test_neg_clear
    813  1.1  christos 	test_zero_clear
    814  1.1  christos 	test_ovf_clear
    815  1.1  christos 	test_carry_clear
    816  1.1  christos 	test_h_gr16 0x1234 r0
    817  1.1  christos 	test_h_gr16 0x1234 r1	; mov src unchanged
    818  1.1  christos .if (sim_cpu)
    819  1.1  christos 	test_h_gr32 0xa5a51234 er0
    820  1.1  christos 	test_h_gr32 0xa5a51234 er1	; mov src unchanged
    821  1.1  christos .endif
    822  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
    823  1.1  christos 	test_gr_a5a5 3
    824  1.1  christos 	test_gr_a5a5 4
    825  1.1  christos 	test_gr_a5a5 5
    826  1.1  christos 	test_gr_a5a5 6
    827  1.1  christos 	test_gr_a5a5 7
    828  1.1  christos 
    829  1.1  christos 
    830  1.1  christos mov_w_reg16_to_indirect:
    831  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    832  1.1  christos 	set_ccr_zero
    833  1.1  christos 
    834  1.1  christos 	;; mov.w ers, @erd
    835  1.1  christos 	mov.l	#word_dst, er1
    836  1.1  christos 	mov.w	r0, @er1	; Register indirect operand
    837  1.1  christos ;;;	.word	0x6990
    838  1.1  christos 
    839  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    840  1.1  christos 	test_neg_set
    841  1.1  christos 	test_zero_clear
    842  1.1  christos 	test_ovf_clear
    843  1.1  christos 	test_carry_clear
    844  1.1  christos 
    845  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    846  1.1  christos 	test_h_gr32	word_dst, er1
    847  1.1  christos 	test_gr_a5a5 2
    848  1.1  christos 	test_gr_a5a5 3
    849  1.1  christos 	test_gr_a5a5 4
    850  1.1  christos 	test_gr_a5a5 5
    851  1.1  christos 	test_gr_a5a5 6
    852  1.1  christos 	test_gr_a5a5 7
    853  1.1  christos 
    854  1.1  christos 	;; Now check the result of the move to memory.
    855  1.1  christos 	mov.w	#0, r0
    856  1.1  christos 	mov.w	@word_dst, r0
    857  1.1  christos 	cmp.w	r2, r0
    858  1.1  christos 	beq	.Lnext44
    859  1.1  christos 	fail
    860  1.1  christos .Lnext44:
    861  1.1  christos 	mov.w	#0, r0
    862  1.1  christos 	mov.w	r0, @word_dst	; zero it again for the next use.
    863  1.1  christos 
    864  1.1  christos .if (sim_cpu == h8sx)
    865  1.1  christos mov_w_reg16_to_postinc:		; post-increment from register to mem
    866  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    867  1.1  christos 	set_ccr_zero
    868  1.1  christos 
    869  1.1  christos 	;; mov.w ers, @erd+
    870  1.1  christos 	mov.l	#word_dst, er1
    871  1.1  christos 	mov.w	r0, @er1+	; Register post-incr operand
    872  1.1  christos ;;;	.word	0x0153
    873  1.1  christos ;;;	.word	0x6d90
    874  1.1  christos 
    875  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    876  1.1  christos 	test_neg_set
    877  1.1  christos 	test_zero_clear
    878  1.1  christos 	test_ovf_clear
    879  1.1  christos 	test_carry_clear
    880  1.1  christos 
    881  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    882  1.1  christos 	test_h_gr32	word_dst+2, er1
    883  1.1  christos 	test_gr_a5a5 2
    884  1.1  christos 	test_gr_a5a5 3
    885  1.1  christos 	test_gr_a5a5 4
    886  1.1  christos 	test_gr_a5a5 5
    887  1.1  christos 	test_gr_a5a5 6
    888  1.1  christos 	test_gr_a5a5 7
    889  1.1  christos 
    890  1.1  christos 	;; Now check the result of the move to memory.
    891  1.1  christos 	cmp.w	r2, @word_dst
    892  1.1  christos 	beq	.Lnext49
    893  1.1  christos 	fail
    894  1.1  christos .Lnext49:
    895  1.1  christos 	;; special case same register
    896  1.1  christos 	mov.l	#word_dst, er0
    897  1.1  christos 	mov.w	r0, r1
    898  1.1  christos 	inc.w	#2,r1
    899  1.1  christos 	mov.w	r0, @er0+
    900  1.1  christos 	mov.w	@word_dst, r0
    901  1.1  christos 	cmp.w	r0, r1
    902  1.1  christos 	beq	.Lnext53
    903  1.1  christos 	fail
    904  1.1  christos .Lnext53:
    905  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    906  1.1  christos 
    907  1.1  christos mov_w_reg16_to_postdec:		; post-decrement from register to mem
    908  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    909  1.1  christos 	set_ccr_zero
    910  1.1  christos 
    911  1.1  christos 	;; mov.w ers, @erd-
    912  1.1  christos 	mov.l	#word_dst, er1
    913  1.1  christos 	mov.w	r0, @er1-	; Register post-decr operand
    914  1.1  christos ;;;	.word	0x0151
    915  1.1  christos ;;;	.word	0x6d90
    916  1.1  christos 
    917  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    918  1.1  christos 	test_neg_set
    919  1.1  christos 	test_zero_clear
    920  1.1  christos 	test_ovf_clear
    921  1.1  christos 	test_carry_clear
    922  1.1  christos 
    923  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    924  1.1  christos 	test_h_gr32	word_dst-2, er1
    925  1.1  christos 	test_gr_a5a5 2
    926  1.1  christos 	test_gr_a5a5 3
    927  1.1  christos 	test_gr_a5a5 4
    928  1.1  christos 	test_gr_a5a5 5
    929  1.1  christos 	test_gr_a5a5 6
    930  1.1  christos 	test_gr_a5a5 7
    931  1.1  christos 
    932  1.1  christos 	;; Now check the result of the move to memory.
    933  1.1  christos 	cmp.w	r2, @word_dst
    934  1.1  christos 	beq	.Lnext50
    935  1.1  christos 	fail
    936  1.1  christos .Lnext50:
    937  1.1  christos 	;; special case same register
    938  1.1  christos 	mov.l	#word_dst, er0
    939  1.1  christos 	mov.w	r0, r1
    940  1.1  christos 	dec.w	#2, r1
    941  1.1  christos 	mov.w	r0, @er0-
    942  1.1  christos 	mov.w	@word_dst, r0
    943  1.1  christos 	cmp.w	r0, r1
    944  1.1  christos 	beq	.Lnext54
    945  1.1  christos 	fail
    946  1.1  christos .Lnext54:
    947  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    948  1.1  christos 
    949  1.1  christos mov_w_reg16_to_preinc:		; pre-increment from register to mem
    950  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    951  1.1  christos 	set_ccr_zero
    952  1.1  christos 
    953  1.1  christos 	;; mov.w ers, @+erd
    954  1.1  christos 	mov.l	#word_dst-2, er1
    955  1.1  christos 	mov.w	r0, @+er1	; Register pre-incr operand
    956  1.1  christos ;;;	.word	0x0152
    957  1.1  christos ;;;	.word	0x6d90
    958  1.1  christos 
    959  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
    960  1.1  christos 	test_neg_set
    961  1.1  christos 	test_zero_clear
    962  1.1  christos 	test_ovf_clear
    963  1.1  christos 	test_carry_clear
    964  1.1  christos 
    965  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    966  1.1  christos 	test_h_gr32	word_dst, er1
    967  1.1  christos 	test_gr_a5a5 2
    968  1.1  christos 	test_gr_a5a5 3
    969  1.1  christos 	test_gr_a5a5 4
    970  1.1  christos 	test_gr_a5a5 5
    971  1.1  christos 	test_gr_a5a5 6
    972  1.1  christos 	test_gr_a5a5 7
    973  1.1  christos 
    974  1.1  christos 	;; Now check the result of the move to memory.
    975  1.1  christos 	cmp.w	r2, @word_dst
    976  1.1  christos 	beq	.Lnext51
    977  1.1  christos 	fail
    978  1.1  christos .Lnext51:
    979  1.1  christos 	;; special case same register
    980  1.1  christos 	mov.l	#word_dst-2, er0
    981  1.1  christos 	mov.w	r0, r1
    982  1.1  christos 	inc.w	#2, r1
    983  1.1  christos 	mov.w	r0, @+er0
    984  1.1  christos 	mov.w	@word_dst, r0
    985  1.1  christos 	cmp.w	r0, r1
    986  1.1  christos 	beq	.Lnext55
    987  1.1  christos 	fail
    988  1.1  christos .Lnext55:
    989  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
    990  1.1  christos .endif
    991  1.1  christos 
    992  1.1  christos mov_w_reg16_to_predec:		; pre-decrement from register to mem
    993  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    994  1.1  christos 	set_ccr_zero
    995  1.1  christos 
    996  1.1  christos 	;; mov.w ers, @-erd
    997  1.1  christos 	mov.l	#word_dst+2, er1
    998  1.1  christos 	mov.w	r0, @-er1	; Register pre-decr operand
    999  1.1  christos ;;;	.word	0x6d90
   1000  1.1  christos 
   1001  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
   1002  1.1  christos 	test_neg_set
   1003  1.1  christos 	test_zero_clear
   1004  1.1  christos 	test_ovf_clear
   1005  1.1  christos 	test_carry_clear
   1006  1.1  christos 
   1007  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1008  1.1  christos 	test_h_gr32	word_dst, er1
   1009  1.1  christos 	test_gr_a5a5 2
   1010  1.1  christos 	test_gr_a5a5 3
   1011  1.1  christos 	test_gr_a5a5 4
   1012  1.1  christos 	test_gr_a5a5 5
   1013  1.1  christos 	test_gr_a5a5 6
   1014  1.1  christos 	test_gr_a5a5 7
   1015  1.1  christos 
   1016  1.1  christos 	;; Now check the result of the move to memory.
   1017  1.1  christos 	mov.w	#0, r0
   1018  1.1  christos 	mov.w	@word_dst, r0
   1019  1.1  christos 	cmp.w	r2, r0
   1020  1.1  christos 	beq	.Lnext48
   1021  1.1  christos 	fail
   1022  1.1  christos .Lnext48:
   1023  1.1  christos 	;; Special case in same register
   1024  1.1  christos 	;; CCR confirmation omitted
   1025  1.1  christos 	mov.l	#word_dst+2, er1
   1026  1.1  christos 	mov.l	er1, er0
   1027  1.1  christos 	dec.w	#2, r1
   1028  1.1  christos 	mov.w	r0, @-er0
   1029  1.1  christos 	mov.w	@word_dst, r0
   1030  1.1  christos 	cmp.w	r1, r0
   1031  1.1  christos 	beq	.Lnext47
   1032  1.1  christos 	fail
   1033  1.1  christos .Lnext47:
   1034  1.1  christos 	mov.w	#0, r0
   1035  1.1  christos 	mov.w	r0, @word_dst	; zero it again for the next use.
   1036  1.1  christos 
   1037  1.1  christos .if (sim_cpu == h8sx)
   1038  1.1  christos mov_w_reg16_to_disp2:
   1039  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1040  1.1  christos 	set_ccr_zero
   1041  1.1  christos 
   1042  1.1  christos 	;; mov.w ers, @(dd:2, erd)
   1043  1.1  christos 	mov.l	#word_dst-6, er1
   1044  1.1  christos 	mov.w	r0, @(6:2, er1)	; Register plus 2-bit disp. operand
   1045  1.1  christos ;;;	.word	0x0153
   1046  1.1  christos ;;;	.word	0x6990
   1047  1.1  christos 
   1048  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
   1049  1.1  christos 	test_neg_set
   1050  1.1  christos 	test_zero_clear
   1051  1.1  christos 	test_ovf_clear
   1052  1.1  christos 	test_carry_clear
   1053  1.1  christos 
   1054  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1055  1.1  christos 	test_h_gr32	word_dst-6, er1
   1056  1.1  christos 	test_gr_a5a5 2
   1057  1.1  christos 	test_gr_a5a5 3
   1058  1.1  christos 	test_gr_a5a5 4
   1059  1.1  christos 	test_gr_a5a5 5
   1060  1.1  christos 	test_gr_a5a5 6
   1061  1.1  christos 	test_gr_a5a5 7
   1062  1.1  christos 
   1063  1.1  christos 	;; Now check the result of the move to memory.
   1064  1.1  christos 	cmp.w	r2, @word_dst
   1065  1.1  christos 	beq	.Lnext52
   1066  1.1  christos 	fail
   1067  1.1  christos .Lnext52:
   1068  1.1  christos 	mov.w	#0, @word_dst	; zero it again for the next use.
   1069  1.1  christos .endif
   1070  1.1  christos 
   1071  1.1  christos mov_w_reg16_to_disp16:
   1072  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1073  1.1  christos 	set_ccr_zero
   1074  1.1  christos 
   1075  1.1  christos 	;; mov.w ers, @(dd:16, erd)
   1076  1.1  christos 	mov.l	#word_dst-4, er1
   1077  1.1  christos 	mov.w	r0, @(4:16, er1)	; Register plus 16-bit disp. operand
   1078  1.1  christos ;;;	.word	0x6f90
   1079  1.1  christos ;;;	.word	0x0004
   1080  1.1  christos 
   1081  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
   1082  1.1  christos 	test_neg_set
   1083  1.1  christos 	test_zero_clear
   1084  1.1  christos 	test_ovf_clear
   1085  1.1  christos 	test_carry_clear
   1086  1.1  christos 
   1087  1.1  christos 	test_h_gr32	word_dst-4, er1
   1088  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1089  1.1  christos 	test_gr_a5a5 2
   1090  1.1  christos 	test_gr_a5a5 3
   1091  1.1  christos 	test_gr_a5a5 4
   1092  1.1  christos 	test_gr_a5a5 5
   1093  1.1  christos 	test_gr_a5a5 6
   1094  1.1  christos 	test_gr_a5a5 7
   1095  1.1  christos 
   1096  1.1  christos 	;; Now check the result of the move to memory.
   1097  1.1  christos 	mov.w	#0, r0
   1098  1.1  christos 	mov.w	@word_dst, r0
   1099  1.1  christos 	cmp.w	r2, r0
   1100  1.1  christos 	beq	.Lnext45
   1101  1.1  christos 	fail
   1102  1.1  christos .Lnext45:
   1103  1.1  christos 	mov.w	#0, r0
   1104  1.1  christos 	mov.w	r0, @word_dst	; zero it again for the next use.
   1105  1.1  christos 
   1106  1.1  christos mov_w_reg16_to_disp32:
   1107  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1108  1.1  christos 	set_ccr_zero
   1109  1.1  christos 
   1110  1.1  christos 	;; mov.w ers, @(dd:32, erd)
   1111  1.1  christos 	mov.l	#word_dst-8, er1
   1112  1.1  christos 	mov.w	r0, @(8:32, er1)	; Register plus 32-bit disp. operand
   1113  1.1  christos ;;;	.word	0x7810
   1114  1.1  christos ;;;	.word	0x6ba0
   1115  1.1  christos ;;;	.long	8
   1116  1.1  christos 
   1117  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
   1118  1.1  christos 	test_neg_set
   1119  1.1  christos 	test_zero_clear
   1120  1.1  christos 	test_ovf_clear
   1121  1.1  christos 	test_carry_clear
   1122  1.1  christos 
   1123  1.1  christos 	test_h_gr32	word_dst-8, er1
   1124  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
   1125  1.1  christos 	test_gr_a5a5 2
   1126  1.1  christos 	test_gr_a5a5 3
   1127  1.1  christos 	test_gr_a5a5 4
   1128  1.1  christos 	test_gr_a5a5 5
   1129  1.1  christos 	test_gr_a5a5 6
   1130  1.1  christos 	test_gr_a5a5 7
   1131  1.1  christos 
   1132  1.1  christos 	;; Now check the result of the move to memory.
   1133  1.1  christos 	mov.w	#0, r0
   1134  1.1  christos 	mov.w	@word_dst, r0
   1135  1.1  christos 	cmp.w	r2, r0
   1136  1.1  christos 	beq	.Lnext46
   1137  1.1  christos 	fail
   1138  1.1  christos .Lnext46:
   1139  1.1  christos 	mov.w	#0, r0
   1140  1.1  christos 	mov.w	r0, @word_dst	; zero it again for the next use.
   1141  1.1  christos 
   1142  1.1  christos mov_w_reg16_to_abs16:
   1143  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1144  1.1  christos 	set_ccr_zero
   1145  1.1  christos 
   1146  1.1  christos 	;; mov.w ers, @aa:16
   1147  1.1  christos 	mov.w	r0, @word_dst:16	; 16-bit address-direct operand
   1148  1.1  christos ;;;	.word	0x6b80
   1149  1.1  christos ;;;	.word	@word_dst
   1150  1.1  christos 
   1151  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
   1152  1.1  christos 	test_neg_set
   1153  1.1  christos 	test_zero_clear
   1154  1.1  christos 	test_ovf_clear
   1155  1.1  christos 	test_carry_clear
   1156  1.1  christos 
   1157  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
   1158  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
   1159  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
   1160  1.1  christos 	test_gr_a5a5 3
   1161  1.1  christos 	test_gr_a5a5 4
   1162  1.1  christos 	test_gr_a5a5 5
   1163  1.1  christos 	test_gr_a5a5 6
   1164  1.1  christos 	test_gr_a5a5 7
   1165  1.1  christos 
   1166  1.1  christos 	;; Now check the result of the move to memory.
   1167  1.1  christos 	mov.w	#0, r0
   1168  1.1  christos 	mov.w	@word_dst, r0
   1169  1.1  christos 	cmp.w	r0, r1
   1170  1.1  christos 	beq	.Lnext41
   1171  1.1  christos 	fail
   1172  1.1  christos .Lnext41:
   1173  1.1  christos 	mov.w	#0, r0
   1174  1.1  christos 	mov.w	r0, @word_dst	; zero it again for the next use.
   1175  1.1  christos 
   1176  1.1  christos mov_w_reg16_to_abs32:
   1177  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1178  1.1  christos 	set_ccr_zero
   1179  1.1  christos 
   1180  1.1  christos 	;; mov.w ers, @aa:32
   1181  1.1  christos 	mov.w	r0, @word_dst:32	; 32-bit address-direct operand
   1182  1.1  christos ;;;	.word	0x6ba0
   1183  1.1  christos ;;;	.long	@word_dst
   1184  1.1  christos 
   1185  1.1  christos 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
   1186  1.1  christos 	test_neg_set
   1187  1.1  christos 	test_zero_clear
   1188  1.1  christos 	test_ovf_clear
   1189  1.1  christos 	test_carry_clear
   1190  1.1  christos 
   1191  1.1  christos 	test_gr_a5a5 0		; Make sure _ALL_ general regs not disturbed
   1192  1.1  christos 	test_gr_a5a5 1		; (first, because on h8/300 we must use one
   1193  1.1  christos 	test_gr_a5a5 2		; to examine the destination memory).
   1194  1.1  christos 	test_gr_a5a5 3
   1195  1.1  christos 	test_gr_a5a5 4
   1196  1.1  christos 	test_gr_a5a5 5
   1197  1.1  christos 	test_gr_a5a5 6
   1198  1.1  christos 	test_gr_a5a5 7
   1199  1.1  christos 
   1200  1.1  christos 	;; Now check the result of the move to memory.
   1201  1.1  christos 	mov.w	#0, r0
   1202  1.1  christos 	mov.w	@word_dst, r0
   1203  1.1  christos 	cmp.w	r0, r1
   1204  1.1  christos 	beq	.Lnext42
   1205  1.1  christos 	fail
   1206  1.1  christos .Lnext42:
   1207  1.1  christos 	mov.w	#0, r0
   1208  1.1  christos 	mov.w	r0, @word_dst	; zero it again for the next use.
   1209  1.1  christos 
   1210  1.1  christos 	;;
   1211  1.1  christos 	;; Move word to register destination.
   1212  1.1  christos 	;;
   1213  1.1  christos 
   1214  1.1  christos mov_w_indirect_to_reg16:
   1215  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1216  1.1  christos 	set_ccr_zero
   1217  1.1  christos 
   1218  1.1  christos 	;; mov.w @ers, rd
   1219  1.1  christos 	mov.l	#word_src, er1
   1220  1.1  christos 	mov.w	@er1, r0	; Register indirect operand
   1221  1.1  christos ;;;	.word	0x6910
   1222  1.1  christos 
   1223  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1224  1.1  christos 	test_neg_clear
   1225  1.1  christos 	test_zero_clear
   1226  1.1  christos 	test_ovf_clear
   1227  1.1  christos 	test_carry_clear
   1228  1.1  christos 
   1229  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1230  1.1  christos 
   1231  1.1  christos 	test_h_gr32	word_src, er1
   1232  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1233  1.1  christos 	test_gr_a5a5 3
   1234  1.1  christos 	test_gr_a5a5 4
   1235  1.1  christos 	test_gr_a5a5 5
   1236  1.1  christos 	test_gr_a5a5 6
   1237  1.1  christos 	test_gr_a5a5 7
   1238  1.1  christos 
   1239  1.1  christos mov_w_postinc_to_reg16:		; post-increment from mem to register
   1240  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1241  1.1  christos 	set_ccr_zero
   1242  1.1  christos 
   1243  1.1  christos 	;; mov.w @ers+, rd
   1244  1.1  christos 
   1245  1.1  christos 	mov.l	#word_src, er1
   1246  1.1  christos 	mov.w	@er1+, r0	; Register post-incr operand
   1247  1.1  christos ;;;	.word	0x6d10
   1248  1.1  christos 
   1249  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1250  1.1  christos 	test_neg_clear
   1251  1.1  christos 	test_zero_clear
   1252  1.1  christos 	test_ovf_clear
   1253  1.1  christos 	test_carry_clear
   1254  1.1  christos 
   1255  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1256  1.1  christos 
   1257  1.1  christos 	test_h_gr32	word_src+2, er1
   1258  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1259  1.1  christos 	test_gr_a5a5 3
   1260  1.1  christos 	test_gr_a5a5 4
   1261  1.1  christos 	test_gr_a5a5 5
   1262  1.1  christos 	test_gr_a5a5 6
   1263  1.1  christos 	test_gr_a5a5 7
   1264  1.1  christos 
   1265  1.1  christos .if (sim_cpu == h8sx)
   1266  1.1  christos mov_w_postdec_to_reg16:		; post-decrement from mem to register
   1267  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1268  1.1  christos 	set_ccr_zero
   1269  1.1  christos 
   1270  1.1  christos 	;; mov.w @ers-, rd
   1271  1.1  christos 
   1272  1.1  christos 	mov.l	#word_src, er1
   1273  1.1  christos 	mov.w	@er1-, r0	; Register post-decr operand
   1274  1.1  christos ;;;	.word	0x0152
   1275  1.1  christos ;;;	.word	0x6d10
   1276  1.1  christos 
   1277  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1278  1.1  christos 	test_neg_clear
   1279  1.1  christos 	test_zero_clear
   1280  1.1  christos 	test_ovf_clear
   1281  1.1  christos 	test_carry_clear
   1282  1.1  christos 
   1283  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1284  1.1  christos 
   1285  1.1  christos 	test_h_gr32	word_src-2, er1
   1286  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1287  1.1  christos 	test_gr_a5a5 3
   1288  1.1  christos 	test_gr_a5a5 4
   1289  1.1  christos 	test_gr_a5a5 5
   1290  1.1  christos 	test_gr_a5a5 6
   1291  1.1  christos 	test_gr_a5a5 7
   1292  1.1  christos 
   1293  1.1  christos mov_w_preinc_to_reg16:		; pre-increment from mem to register
   1294  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1295  1.1  christos 	set_ccr_zero
   1296  1.1  christos 
   1297  1.1  christos 	;; mov.w @+ers, rd
   1298  1.1  christos 
   1299  1.1  christos 	mov.l	#word_src-2, er1
   1300  1.1  christos 	mov.w	@+er1, r0	; Register pre-incr operand
   1301  1.1  christos ;;;	.word	0x0151
   1302  1.1  christos ;;;	.word	0x6d10
   1303  1.1  christos 
   1304  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1305  1.1  christos 	test_neg_clear
   1306  1.1  christos 	test_zero_clear
   1307  1.1  christos 	test_ovf_clear
   1308  1.1  christos 	test_carry_clear
   1309  1.1  christos 
   1310  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1311  1.1  christos 
   1312  1.1  christos 	test_h_gr32	word_src, er1
   1313  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1314  1.1  christos 	test_gr_a5a5 3
   1315  1.1  christos 	test_gr_a5a5 4
   1316  1.1  christos 	test_gr_a5a5 5
   1317  1.1  christos 	test_gr_a5a5 6
   1318  1.1  christos 	test_gr_a5a5 7
   1319  1.1  christos 
   1320  1.1  christos mov_w_predec_to_reg16:		; pre-decrement from mem to register
   1321  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1322  1.1  christos 	set_ccr_zero
   1323  1.1  christos 
   1324  1.1  christos 	;; mov.w @-ers, rd
   1325  1.1  christos 
   1326  1.1  christos 	mov.l	#word_src+2, er1
   1327  1.1  christos 	mov.w	@-er1, r0	; Register pre-decr operand
   1328  1.1  christos ;;;	.word	0x0153
   1329  1.1  christos ;;;	.word	0x6d10
   1330  1.1  christos 
   1331  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1332  1.1  christos 	test_neg_clear
   1333  1.1  christos 	test_zero_clear
   1334  1.1  christos 	test_ovf_clear
   1335  1.1  christos 	test_carry_clear
   1336  1.1  christos 
   1337  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1338  1.1  christos 
   1339  1.1  christos 	test_h_gr32	word_src, er1
   1340  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1341  1.1  christos 	test_gr_a5a5 3
   1342  1.1  christos 	test_gr_a5a5 4
   1343  1.1  christos 	test_gr_a5a5 5
   1344  1.1  christos 	test_gr_a5a5 6
   1345  1.1  christos 	test_gr_a5a5 7
   1346  1.1  christos 
   1347  1.1  christos 
   1348  1.1  christos mov_w_disp2_to_reg16:
   1349  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1350  1.1  christos 	set_ccr_zero
   1351  1.1  christos 
   1352  1.1  christos 	;; mov.w @(dd:2, ers), rd
   1353  1.1  christos 	mov.l	#word_src-2, er1
   1354  1.1  christos 	mov.w	@(2:2, er1), r0	; Register plus 2-bit disp. operand
   1355  1.1  christos ;;; 	.word	0x0151
   1356  1.1  christos ;;; 	.word	0x6910
   1357  1.1  christos 
   1358  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1359  1.1  christos 	test_neg_clear
   1360  1.1  christos 	test_zero_clear
   1361  1.1  christos 	test_ovf_clear
   1362  1.1  christos 	test_carry_clear
   1363  1.1  christos 
   1364  1.1  christos 	test_h_gr32 0xa5a57777 er0	; mov result:	a5a5 | 7777
   1365  1.1  christos 
   1366  1.1  christos 	test_h_gr32	word_src-2, er1
   1367  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1368  1.1  christos 	test_gr_a5a5 3
   1369  1.1  christos 	test_gr_a5a5 4
   1370  1.1  christos 	test_gr_a5a5 5
   1371  1.1  christos 	test_gr_a5a5 6
   1372  1.1  christos 	test_gr_a5a5 7
   1373  1.1  christos .endif
   1374  1.1  christos 
   1375  1.1  christos mov_w_disp16_to_reg16:
   1376  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1377  1.1  christos 	set_ccr_zero
   1378  1.1  christos 
   1379  1.1  christos 	;; mov.w @(dd:16, ers), rd
   1380  1.1  christos 	mov.l	#word_src+0x1234, er1
   1381  1.1  christos 	mov.w	@(-0x1234:16, er1), r0	; Register plus 16-bit disp. operand
   1382  1.1  christos ;;;	.word	0x6f10
   1383  1.1  christos ;;;	.word	-0x1234
   1384  1.1  christos 
   1385  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1386  1.1  christos 	test_neg_clear
   1387  1.1  christos 	test_zero_clear
   1388  1.1  christos 	test_ovf_clear
   1389  1.1  christos 	test_carry_clear
   1390  1.1  christos 
   1391  1.1  christos 	test_h_gr32 0xa5a57777 er0	; mov result:	a5a5 | 7777
   1392  1.1  christos 
   1393  1.1  christos 	test_h_gr32	word_src+0x1234, er1
   1394  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1395  1.1  christos 	test_gr_a5a5 3
   1396  1.1  christos 	test_gr_a5a5 4
   1397  1.1  christos 	test_gr_a5a5 5
   1398  1.1  christos 	test_gr_a5a5 6
   1399  1.1  christos 	test_gr_a5a5 7
   1400  1.1  christos 
   1401  1.1  christos mov_w_disp32_to_reg16:
   1402  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1403  1.1  christos 	set_ccr_zero
   1404  1.1  christos 
   1405  1.1  christos 	;; mov.w @(dd:32, ers), rd
   1406  1.1  christos 	mov.l	#word_src+65536, er1
   1407  1.1  christos 	mov.w	@(-65536:32, er1), r0	; Register plus 32-bit disp. operand
   1408  1.1  christos ;;;	.word	0x7810
   1409  1.1  christos ;;;	.word	0x6b20
   1410  1.1  christos ;;;	.long	-65536
   1411  1.1  christos 
   1412  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1413  1.1  christos 	test_neg_clear
   1414  1.1  christos 	test_zero_clear
   1415  1.1  christos 	test_ovf_clear
   1416  1.1  christos 	test_carry_clear
   1417  1.1  christos 
   1418  1.1  christos 	test_h_gr32 0xa5a57777 er0	; mov result:	a5a5 | 7777
   1419  1.1  christos 
   1420  1.1  christos 	test_h_gr32	word_src+65536, er1
   1421  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1422  1.1  christos 	test_gr_a5a5 3
   1423  1.1  christos 	test_gr_a5a5 4
   1424  1.1  christos 	test_gr_a5a5 5
   1425  1.1  christos 	test_gr_a5a5 6
   1426  1.1  christos 	test_gr_a5a5 7
   1427  1.1  christos 
   1428  1.1  christos mov_w_abs16_to_reg16:
   1429  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1430  1.1  christos 	set_ccr_zero
   1431  1.1  christos 
   1432  1.1  christos 	;; mov.w @aa:16, rd
   1433  1.1  christos 	mov.w	@word_src:16, r0	; 16-bit address-direct operand
   1434  1.1  christos ;;;	.word	0x6b00
   1435  1.1  christos ;;;	.word	@word_src
   1436  1.1  christos 
   1437  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1438  1.1  christos 	test_neg_clear
   1439  1.1  christos 	test_zero_clear
   1440  1.1  christos 	test_ovf_clear
   1441  1.1  christos 	test_carry_clear
   1442  1.1  christos 
   1443  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1444  1.1  christos 
   1445  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
   1446  1.1  christos 	test_gr_a5a5 2
   1447  1.1  christos 	test_gr_a5a5 3
   1448  1.1  christos 	test_gr_a5a5 4
   1449  1.1  christos 	test_gr_a5a5 5
   1450  1.1  christos 	test_gr_a5a5 6
   1451  1.1  christos 	test_gr_a5a5 7
   1452  1.1  christos 
   1453  1.1  christos mov_w_abs32_to_reg16:
   1454  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1455  1.1  christos 	set_ccr_zero
   1456  1.1  christos 
   1457  1.1  christos 	;; mov.w @aa:32, rd
   1458  1.1  christos 	mov.w	@word_src:32, r0	; 32-bit address-direct operand
   1459  1.1  christos ;;;	.word	0x6b20
   1460  1.1  christos ;;;	.long	@word_src
   1461  1.1  christos 
   1462  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1463  1.1  christos 	test_neg_clear
   1464  1.1  christos 	test_zero_clear
   1465  1.1  christos 	test_ovf_clear
   1466  1.1  christos 	test_carry_clear
   1467  1.1  christos 
   1468  1.1  christos 	test_h_gr32 0xa5a57777 er0
   1469  1.1  christos 
   1470  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
   1471  1.1  christos 	test_gr_a5a5 2
   1472  1.1  christos 	test_gr_a5a5 3
   1473  1.1  christos 	test_gr_a5a5 4
   1474  1.1  christos 	test_gr_a5a5 5
   1475  1.1  christos 	test_gr_a5a5 6
   1476  1.1  christos 	test_gr_a5a5 7
   1477  1.1  christos 
   1478  1.1  christos .if (sim_cpu == h8sx)
   1479  1.1  christos 
   1480  1.1  christos 	;;
   1481  1.1  christos 	;; Move word from memory to memory
   1482  1.1  christos 	;;
   1483  1.1  christos 
   1484  1.1  christos mov_w_indirect_to_indirect:	; reg indirect, memory to memory
   1485  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1486  1.1  christos 	set_ccr_zero
   1487  1.1  christos 
   1488  1.1  christos 	;; mov.w @ers, @erd
   1489  1.1  christos 
   1490  1.1  christos 	mov.l	#word_src, er1
   1491  1.1  christos 	mov.l	#word_dst, er0
   1492  1.1  christos 	mov.w	@er1, @er0
   1493  1.1  christos ;;;	.word	0x0158
   1494  1.1  christos ;;;	.word	0x0100
   1495  1.1  christos 
   1496  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1497  1.1  christos 	test_neg_clear
   1498  1.1  christos 	test_zero_clear
   1499  1.1  christos 	test_ovf_clear
   1500  1.1  christos 	test_carry_clear
   1501  1.1  christos 
   1502  1.1  christos 	;; Verify the affected registers.
   1503  1.1  christos 
   1504  1.1  christos 	test_h_gr32  word_dst er0
   1505  1.1  christos 	test_h_gr32  word_src er1
   1506  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1507  1.1  christos 	test_gr_a5a5 3
   1508  1.1  christos 	test_gr_a5a5 4
   1509  1.1  christos 	test_gr_a5a5 5
   1510  1.1  christos 	test_gr_a5a5 6
   1511  1.1  christos 	test_gr_a5a5 7
   1512  1.1  christos 
   1513  1.1  christos 	;; Now check the result of the move to memory.
   1514  1.1  christos 	cmp.w	@word_src, @word_dst
   1515  1.1  christos 	beq	.Lnext56
   1516  1.1  christos 	fail
   1517  1.1  christos .Lnext56:
   1518  1.1  christos 	;; Now clear the destination location, and verify that.
   1519  1.1  christos 	mov.w	#0, @word_dst
   1520  1.1  christos 	cmp.w	@word_src, @word_dst
   1521  1.1  christos 	bne	.Lnext57
   1522  1.1  christos 	fail
   1523  1.1  christos .Lnext57:			; OK, pass on.
   1524  1.1  christos 
   1525  1.1  christos mov_w_postinc_to_postinc:	; reg post-increment, memory to memory
   1526  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1527  1.1  christos 	set_ccr_zero
   1528  1.1  christos 
   1529  1.1  christos 	;; mov.w @ers+, @erd+
   1530  1.1  christos 
   1531  1.1  christos 	mov.l	#word_src, er1
   1532  1.1  christos 	mov.l	#word_dst, er0
   1533  1.1  christos 	mov.w	@er1+, @er0+
   1534  1.1  christos ;;;	.word	0x0158
   1535  1.1  christos ;;;	.word	0x8180
   1536  1.1  christos 
   1537  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1538  1.1  christos 	test_neg_clear
   1539  1.1  christos 	test_zero_clear
   1540  1.1  christos 	test_ovf_clear
   1541  1.1  christos 	test_carry_clear
   1542  1.1  christos 
   1543  1.1  christos 	;; Verify the affected registers.
   1544  1.1  christos 
   1545  1.1  christos 	test_h_gr32  word_dst+2 er0
   1546  1.1  christos 	test_h_gr32  word_src+2 er1
   1547  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1548  1.1  christos 	test_gr_a5a5 3
   1549  1.1  christos 	test_gr_a5a5 4
   1550  1.1  christos 	test_gr_a5a5 5
   1551  1.1  christos 	test_gr_a5a5 6
   1552  1.1  christos 	test_gr_a5a5 7
   1553  1.1  christos 
   1554  1.1  christos 	;; Now check the result of the move to memory.
   1555  1.1  christos 	cmp.w	@word_src, @word_dst
   1556  1.1  christos 	beq	.Lnext65
   1557  1.1  christos 	fail
   1558  1.1  christos .Lnext65:
   1559  1.1  christos 	;; Now clear the destination location, and verify that.
   1560  1.1  christos 	mov.w	#0, @word_dst
   1561  1.1  christos 	cmp.w	@word_src, @word_dst
   1562  1.1  christos 	bne	.Lnext66
   1563  1.1  christos 	fail
   1564  1.1  christos .Lnext66:			; OK, pass on.
   1565  1.1  christos 	;; special case same register
   1566  1.1  christos 	mov.l	#word_src, er0
   1567  1.1  christos 	mov.w	@er0+, @er0+	; copying word_src to word_dst
   1568  1.1  christos 	test_h_gr32  word_src+4 er0
   1569  1.1  christos 	cmp.w	@word_src, @word_dst
   1570  1.1  christos 	beq	.Lnext67
   1571  1.1  christos 	fail
   1572  1.1  christos .Lnext67:
   1573  1.1  christos 	;; Now clear the destination location, and verify that.
   1574  1.1  christos 	mov.w	#0, @word_dst
   1575  1.1  christos 	cmp.b	@word_src, @word_dst
   1576  1.1  christos 	bne	.Lnext68
   1577  1.1  christos 	fail
   1578  1.1  christos .Lnext68:
   1579  1.1  christos 
   1580  1.1  christos mov_w_postdec_to_postdec:	; reg post-decrement, memory to memory
   1581  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1582  1.1  christos 	set_ccr_zero
   1583  1.1  christos 
   1584  1.1  christos 	;; mov.w @ers-, @erd-
   1585  1.1  christos 
   1586  1.1  christos 	mov.l	#word_src, er1
   1587  1.1  christos 	mov.l	#word_dst, er0
   1588  1.1  christos 	mov.w	@er1-, @er0-
   1589  1.1  christos ;;;	.word	0x0158
   1590  1.1  christos ;;;	.word	0xa1a0
   1591  1.1  christos 
   1592  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1593  1.1  christos 	test_neg_clear
   1594  1.1  christos 	test_zero_clear
   1595  1.1  christos 	test_ovf_clear
   1596  1.1  christos 	test_carry_clear
   1597  1.1  christos 
   1598  1.1  christos 	;; Verify the affected registers.
   1599  1.1  christos 
   1600  1.1  christos 	test_h_gr32  word_dst-2 er0
   1601  1.1  christos 	test_h_gr32  word_src-2 er1
   1602  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1603  1.1  christos 	test_gr_a5a5 3
   1604  1.1  christos 	test_gr_a5a5 4
   1605  1.1  christos 	test_gr_a5a5 5
   1606  1.1  christos 	test_gr_a5a5 6
   1607  1.1  christos 	test_gr_a5a5 7
   1608  1.1  christos 
   1609  1.1  christos 	;; Now check the result of the move to memory.
   1610  1.1  christos 	cmp.w	@word_src, @word_dst
   1611  1.1  christos 	beq	.Lnext75
   1612  1.1  christos 	fail
   1613  1.1  christos .Lnext75:
   1614  1.1  christos 	;; Now clear the destination location, and verify that.
   1615  1.1  christos 	mov.w	#0, @word_dst
   1616  1.1  christos 	cmp.w	@word_src, @word_dst
   1617  1.1  christos 	bne	.Lnext76
   1618  1.1  christos 	fail
   1619  1.1  christos .Lnext76:			; OK, pass on.
   1620  1.1  christos 	;; special case same register
   1621  1.1  christos 	mov.l	#word_src, er0
   1622  1.1  christos 	mov.w	@er0-, @er0-	; copying word_src to word_dst_dec
   1623  1.1  christos 	test_h_gr32  word_src-4 er0
   1624  1.1  christos 	cmp.w	@word_src, @word_dst_dec
   1625  1.1  christos 	beq	.Lnext77
   1626  1.1  christos 	fail
   1627  1.1  christos .Lnext77:
   1628  1.1  christos 	;; Now clear the destination location, and verify that.
   1629  1.1  christos 	mov.w	#0, @word_dst_dec
   1630  1.1  christos 	cmp.w	@word_src, @word_dst_dec
   1631  1.1  christos 	bne	.Lnext78
   1632  1.1  christos 	fail
   1633  1.1  christos .Lnext78:
   1634  1.1  christos 
   1635  1.1  christos mov_w_preinc_to_preinc:		; reg pre-increment, memory to memory
   1636  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1637  1.1  christos 	set_ccr_zero
   1638  1.1  christos 
   1639  1.1  christos 	;; mov.w @+ers, @+erd
   1640  1.1  christos 
   1641  1.1  christos 	mov.l	#word_src-2, er1
   1642  1.1  christos 	mov.l	#word_dst-2, er0
   1643  1.1  christos 	mov.w	@+er1, @+er0
   1644  1.1  christos ;;;	.word	0x0158
   1645  1.1  christos ;;;	.word	0x9190
   1646  1.1  christos 
   1647  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1648  1.1  christos 	test_neg_clear
   1649  1.1  christos 	test_zero_clear
   1650  1.1  christos 	test_ovf_clear
   1651  1.1  christos 	test_carry_clear
   1652  1.1  christos 
   1653  1.1  christos 	;; Verify the affected registers.
   1654  1.1  christos 
   1655  1.1  christos 	test_h_gr32  word_dst er0
   1656  1.1  christos 	test_h_gr32  word_src er1
   1657  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1658  1.1  christos 	test_gr_a5a5 3
   1659  1.1  christos 	test_gr_a5a5 4
   1660  1.1  christos 	test_gr_a5a5 5
   1661  1.1  christos 	test_gr_a5a5 6
   1662  1.1  christos 	test_gr_a5a5 7
   1663  1.1  christos 
   1664  1.1  christos 	;; Now check the result of the move to memory.
   1665  1.1  christos 	cmp.w	@word_src, @word_dst
   1666  1.1  christos 	beq	.Lnext85
   1667  1.1  christos 	fail
   1668  1.1  christos .Lnext85:
   1669  1.1  christos 	;; Now clear the destination location, and verify that.
   1670  1.1  christos 	mov.w	#0, @word_dst
   1671  1.1  christos 	cmp.w	@word_src, @word_dst
   1672  1.1  christos 	bne	.Lnext86
   1673  1.1  christos 	fail
   1674  1.1  christos .Lnext86:				; OK, pass on.
   1675  1.1  christos 	;; special case same register
   1676  1.1  christos 	mov.l	#word_src-2, er0
   1677  1.1  christos 	mov.w	@+er0, @+er0	; copying word_src to word_dst
   1678  1.1  christos 	test_h_gr32  word_src+2 er0
   1679  1.1  christos 	cmp.w	@word_src, @word_dst
   1680  1.1  christos 	beq	.Lnext87
   1681  1.1  christos 	fail
   1682  1.1  christos .Lnext87:
   1683  1.1  christos 	;; Now clear the destination location, and verify that.
   1684  1.1  christos 	mov.w	#0, @word_dst
   1685  1.1  christos 	cmp.w	@word_src, @word_dst
   1686  1.1  christos 	bne	.Lnext88
   1687  1.1  christos 	fail
   1688  1.1  christos .Lnext88:
   1689  1.1  christos 
   1690  1.1  christos mov_w_predec_to_predec:		; reg pre-decrement, memory to memory
   1691  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1692  1.1  christos 	set_ccr_zero
   1693  1.1  christos 
   1694  1.1  christos 	;; mov.w @-ers, @-erd
   1695  1.1  christos 
   1696  1.1  christos 	mov.l	#word_src+2, er1
   1697  1.1  christos 	mov.l	#word_dst+2, er0
   1698  1.1  christos 	mov.w	@-er1, @-er0
   1699  1.1  christos ;;;	.word	0x0158
   1700  1.1  christos ;;;	.word	0xb1b0
   1701  1.1  christos 
   1702  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1703  1.1  christos 	test_neg_clear
   1704  1.1  christos 	test_zero_clear
   1705  1.1  christos 	test_ovf_clear
   1706  1.1  christos 	test_carry_clear
   1707  1.1  christos 
   1708  1.1  christos 	;; Verify the affected registers.
   1709  1.1  christos 
   1710  1.1  christos 	test_h_gr32  word_dst er0
   1711  1.1  christos 	test_h_gr32  word_src er1
   1712  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1713  1.1  christos 	test_gr_a5a5 3
   1714  1.1  christos 	test_gr_a5a5 4
   1715  1.1  christos 	test_gr_a5a5 5
   1716  1.1  christos 	test_gr_a5a5 6
   1717  1.1  christos 	test_gr_a5a5 7
   1718  1.1  christos 
   1719  1.1  christos 	;; Now check the result of the move to memory.
   1720  1.1  christos 	cmp.w	@word_src, @word_dst
   1721  1.1  christos 	beq	.Lnext95
   1722  1.1  christos 	fail
   1723  1.1  christos .Lnext95:
   1724  1.1  christos 	;; Now clear the destination location, and verify that.
   1725  1.1  christos 	mov.w	#0, @word_dst
   1726  1.1  christos 	cmp.w	@word_src, @word_dst
   1727  1.1  christos 	bne	.Lnext96
   1728  1.1  christos 	fail
   1729  1.1  christos .Lnext96:			; OK, pass on.
   1730  1.1  christos 	;; special case same register
   1731  1.1  christos 	mov.l	#word_src+2, er0
   1732  1.1  christos 	mov.w	@-er0, @-er0	; copying word_src to word_dst_dec
   1733  1.1  christos 	test_h_gr32  word_src-2 er0
   1734  1.1  christos 	cmp.w	@word_src, @word_dst_dec
   1735  1.1  christos 	beq	.Lnext97
   1736  1.1  christos 	fail
   1737  1.1  christos .Lnext97:
   1738  1.1  christos 	;; Now clear the destination location, and verify that.
   1739  1.1  christos 	mov.w	#0, @word_dst_dec
   1740  1.1  christos 	cmp.w	@word_src, @word_dst_dec
   1741  1.1  christos 	bne	.Lnext98
   1742  1.1  christos 	fail
   1743  1.1  christos .Lnext98:
   1744  1.1  christos 
   1745  1.1  christos mov_w_disp2_to_disp2:		; reg 2-bit disp, memory to memory
   1746  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1747  1.1  christos 	set_ccr_zero
   1748  1.1  christos 
   1749  1.1  christos 	;; mov.w @(dd:2, ers), @(dd:2, erd)
   1750  1.1  christos 
   1751  1.1  christos 	mov.l	#word_src-2, er1
   1752  1.1  christos 	mov.l	#word_dst-4, er0
   1753  1.1  christos 	mov.w	@(2:2, er1), @(4:2, er0)
   1754  1.1  christos ;;; 	.word	0x0158
   1755  1.1  christos ;;; 	.word	0x1120
   1756  1.1  christos 
   1757  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1758  1.1  christos 	test_neg_clear
   1759  1.1  christos 	test_zero_clear
   1760  1.1  christos 	test_ovf_clear
   1761  1.1  christos 	test_carry_clear
   1762  1.1  christos 
   1763  1.1  christos 	;; Verify the affected registers.
   1764  1.1  christos 
   1765  1.1  christos 	test_h_gr32  word_dst-4 er0
   1766  1.1  christos 	test_h_gr32  word_src-2 er1
   1767  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1768  1.1  christos 	test_gr_a5a5 3
   1769  1.1  christos 	test_gr_a5a5 4
   1770  1.1  christos 	test_gr_a5a5 5
   1771  1.1  christos 	test_gr_a5a5 6
   1772  1.1  christos 	test_gr_a5a5 7
   1773  1.1  christos 
   1774  1.1  christos 	;; Now check the result of the move to memory.
   1775  1.1  christos 	cmp.w	@word_src, @word_dst
   1776  1.1  christos 	beq	.Lnext105
   1777  1.1  christos 	fail
   1778  1.1  christos .Lnext105:
   1779  1.1  christos 	;; Now clear the destination location, and verify that.
   1780  1.1  christos 	mov.w	#0, @word_dst
   1781  1.1  christos 	cmp.w	@word_src, @word_dst
   1782  1.1  christos 	bne	.Lnext106
   1783  1.1  christos 	fail
   1784  1.1  christos .Lnext106:			; OK, pass on.
   1785  1.1  christos 
   1786  1.1  christos mov_w_disp16_to_disp16:		; reg 16-bit disp, memory to memory
   1787  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1788  1.1  christos 	set_ccr_zero
   1789  1.1  christos 
   1790  1.1  christos 	;; mov.w @(dd:16, ers), @(dd:16, erd)
   1791  1.1  christos 
   1792  1.1  christos 	mov.l	#word_src-1, er1
   1793  1.1  christos 	mov.l	#word_dst-2, er0
   1794  1.1  christos 	mov.w	@(1:16, er1), @(2:16, er0)
   1795  1.1  christos ;;; 	.word	0x0158
   1796  1.1  christos ;;; 	.word	0xc1c0
   1797  1.1  christos ;;; 	.word	0x0001
   1798  1.1  christos ;;; 	.word	0x0002
   1799  1.1  christos 
   1800  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1801  1.1  christos 	test_neg_clear
   1802  1.1  christos 	test_zero_clear
   1803  1.1  christos 	test_ovf_clear
   1804  1.1  christos 	test_carry_clear
   1805  1.1  christos 
   1806  1.1  christos 	;; Verify the affected registers.
   1807  1.1  christos 
   1808  1.1  christos 	test_h_gr32  word_dst-2 er0
   1809  1.1  christos 	test_h_gr32  word_src-1 er1
   1810  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1811  1.1  christos 	test_gr_a5a5 3
   1812  1.1  christos 	test_gr_a5a5 4
   1813  1.1  christos 	test_gr_a5a5 5
   1814  1.1  christos 	test_gr_a5a5 6
   1815  1.1  christos 	test_gr_a5a5 7
   1816  1.1  christos 
   1817  1.1  christos 	;; Now check the result of the move to memory.
   1818  1.1  christos 	cmp.w	@word_src, @word_dst
   1819  1.1  christos 	beq	.Lnext115
   1820  1.1  christos 	fail
   1821  1.1  christos .Lnext115:
   1822  1.1  christos 	;; Now clear the destination location, and verify that.
   1823  1.1  christos 	mov.w	#0, @word_dst
   1824  1.1  christos 	cmp.w	@word_src, @word_dst
   1825  1.1  christos 	bne	.Lnext116
   1826  1.1  christos 	fail
   1827  1.1  christos .Lnext116:			; OK, pass on.
   1828  1.1  christos 
   1829  1.1  christos mov_w_disp32_to_disp32:		; reg 32-bit disp, memory to memory
   1830  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1831  1.1  christos 	set_ccr_zero
   1832  1.1  christos 
   1833  1.1  christos 	;; mov.w @(dd:32, ers), @(dd:32, erd)
   1834  1.1  christos 
   1835  1.1  christos 	mov.l	#word_src-1, er1
   1836  1.1  christos 	mov.l	#word_dst-2, er0
   1837  1.1  christos 	mov.w	@(1:32, er1), @(2:32, er0)
   1838  1.1  christos ;;; 	.word	0x0158
   1839  1.1  christos ;;; 	.word	0xc9c8
   1840  1.1  christos ;;;	.long	1
   1841  1.1  christos ;;;	.long	2
   1842  1.1  christos 
   1843  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1844  1.1  christos 	test_neg_clear
   1845  1.1  christos 	test_zero_clear
   1846  1.1  christos 	test_ovf_clear
   1847  1.1  christos 	test_carry_clear
   1848  1.1  christos 
   1849  1.1  christos 	;; Verify the affected registers.
   1850  1.1  christos 
   1851  1.1  christos 	test_h_gr32  word_dst-2 er0
   1852  1.1  christos 	test_h_gr32  word_src-1 er1
   1853  1.1  christos 	test_gr_a5a5 2		; Make sure other general regs not disturbed
   1854  1.1  christos 	test_gr_a5a5 3
   1855  1.1  christos 	test_gr_a5a5 4
   1856  1.1  christos 	test_gr_a5a5 5
   1857  1.1  christos 	test_gr_a5a5 6
   1858  1.1  christos 	test_gr_a5a5 7
   1859  1.1  christos 
   1860  1.1  christos 	;; Now check the result of the move to memory.
   1861  1.1  christos 	cmp.w	@word_src, @word_dst
   1862  1.1  christos 	beq	.Lnext125
   1863  1.1  christos 	fail
   1864  1.1  christos .Lnext125:
   1865  1.1  christos 	;; Now clear the destination location, and verify that.
   1866  1.1  christos 	mov.w	#0, @word_dst
   1867  1.1  christos 	cmp.w	@word_src, @word_dst
   1868  1.1  christos 	bne	.Lnext126
   1869  1.1  christos 	fail
   1870  1.1  christos .Lnext126:				; OK, pass on.
   1871  1.1  christos 
   1872  1.1  christos mov_w_abs16_to_abs16:		; 16-bit absolute addr, memory to memory
   1873  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1874  1.1  christos 	set_ccr_zero
   1875  1.1  christos 
   1876  1.1  christos 	;; mov.w @aa:16, @aa:16
   1877  1.1  christos 
   1878  1.1  christos 	mov.w	@word_src:16, @word_dst:16
   1879  1.1  christos ;;; 	.word	0x0158
   1880  1.1  christos ;;; 	.word	0x4040
   1881  1.1  christos ;;;	.word	@word_src
   1882  1.1  christos ;;;	.word	@word_dst
   1883  1.1  christos 
   1884  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1885  1.1  christos 	test_neg_clear
   1886  1.1  christos 	test_zero_clear
   1887  1.1  christos 	test_ovf_clear
   1888  1.1  christos 	test_carry_clear
   1889  1.1  christos 
   1890  1.1  christos 
   1891  1.1  christos 	test_gr_a5a5 0		; Make sure *NO* general registers are changed
   1892  1.1  christos 	test_gr_a5a5 1
   1893  1.1  christos 	test_gr_a5a5 2
   1894  1.1  christos 	test_gr_a5a5 3
   1895  1.1  christos 	test_gr_a5a5 4
   1896  1.1  christos 	test_gr_a5a5 5
   1897  1.1  christos 	test_gr_a5a5 6
   1898  1.1  christos 	test_gr_a5a5 7
   1899  1.1  christos 
   1900  1.1  christos 	;; Now check the result of the move to memory.
   1901  1.1  christos 	cmp.w	@word_src, @word_dst
   1902  1.1  christos 	beq	.Lnext135
   1903  1.1  christos 	fail
   1904  1.1  christos .Lnext135:
   1905  1.1  christos 	;; Now clear the destination location, and verify that.
   1906  1.1  christos 	mov.w	#0, @word_dst
   1907  1.1  christos 	cmp.w	@word_src, @word_dst
   1908  1.1  christos 	bne	.Lnext136
   1909  1.1  christos 	fail
   1910  1.1  christos .Lnext136:				; OK, pass on.
   1911  1.1  christos 
   1912  1.1  christos mov_w_abs32_to_abs32:		; 32-bit absolute addr, memory to memory
   1913  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
   1914  1.1  christos 	set_ccr_zero
   1915  1.1  christos 
   1916  1.1  christos 	;; mov.w @aa:32, @aa:32
   1917  1.1  christos 
   1918  1.1  christos 	mov.w	@word_src:32, @word_dst:32
   1919  1.1  christos ;;; 	.word	0x0158
   1920  1.1  christos ;;; 	.word	0x4848
   1921  1.1  christos ;;;	.long	@word_src
   1922  1.1  christos ;;;	.long	@word_dst
   1923  1.1  christos 
   1924  1.1  christos 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
   1925  1.1  christos 	test_neg_clear
   1926  1.1  christos 	test_zero_clear
   1927  1.1  christos 	test_ovf_clear
   1928  1.1  christos 	test_carry_clear
   1929  1.1  christos 
   1930  1.1  christos 	test_gr_a5a5 0		; Make sure *NO* general registers are changed
   1931  1.1  christos 	test_gr_a5a5 1
   1932  1.1  christos 	test_gr_a5a5 2
   1933  1.1  christos 	test_gr_a5a5 3
   1934  1.1  christos 	test_gr_a5a5 4
   1935  1.1  christos 	test_gr_a5a5 5
   1936  1.1  christos 	test_gr_a5a5 6
   1937  1.1  christos 	test_gr_a5a5 7
   1938  1.1  christos 
   1939  1.1  christos 	;; Now check the result of the move to memory.
   1940  1.1  christos 	cmp.w	@word_src, @word_dst
   1941  1.1  christos 	beq	.Lnext145
   1942  1.1  christos 	fail
   1943  1.1  christos .Lnext145:
   1944  1.1  christos 	;; Now clear the destination location, and verify that.
   1945  1.1  christos 	mov.w	#0, @word_dst
   1946  1.1  christos 	cmp.w	@word_src, @word_dst
   1947  1.1  christos 	bne	.Lnext146
   1948  1.1  christos 	fail
   1949  1.1  christos .Lnext146:				; OK, pass on.
   1950  1.1  christos 
   1951  1.1  christos 
   1952  1.1  christos .endif
   1953  1.1  christos 
   1954  1.1  christos 	pass
   1955  1.1  christos 
   1956  1.1  christos 	exit 0
   1957