Home | History | Annotate | Line # | Download | only in h8300
not.s revision 1.1
      1  1.1  christos # Hitachi H8 testcase 'not.b, not.w, not.l'
      2  1.1  christos # mach(): all
      3  1.1  christos # as(h8300):	--defsym sim_cpu=0
      4  1.1  christos # as(h8300h):	--defsym sim_cpu=1
      5  1.1  christos # as(h8300s):	--defsym sim_cpu=2
      6  1.1  christos # as(h8sx):	--defsym sim_cpu=3
      7  1.1  christos # ld(h8300h):	-m h8300helf
      8  1.1  christos # ld(h8300s):	-m h8300self
      9  1.1  christos # ld(h8sx):	-m h8300sxelf
     10  1.1  christos 
     11  1.1  christos 	.include "testutils.inc"
     12  1.1  christos 
     13  1.1  christos 	# Instructions tested:
     14  1.1  christos 	# not.b rd	;                     1 7 0  rd
     15  1.1  christos 	# not.b @erd	;         7 d rd ???? 1 7 0  ignore
     16  1.1  christos 	# not.b @erd+	; 0 1 7 4 6 c rd 1??? 1 7 0  ignore
     17  1.1  christos 	# not.b @erd-	; 0 1 7 6 6 c rd 1??? 1 7 0  ignore
     18  1.1  christos 	# not.b @+erd	; 0 1 7 5 6 c rd 1??? 1 7 0  ignore
     19  1.1  christos 	# not.b @-erd	; 0 1 7 7 6 c rd 1??? 1 7 0  ignore
     20  1.1  christos 	# not.b @(d:2,  erd)	; 0 1 7 01dd  6 8 rd 8 1 7 0  ignore
     21  1.1  christos 	# not.b @(d:16, erd)	; 0 1 7  4 6 e rd 1??? dd:16 1 7 0  ignore
     22  1.1  christos 	# not.b @(d:32, erd)	; 7 8 rd 4 6 a  2 1??? dd:32 1 7 0  ignore
     23  1.1  christos 	# not.b @aa:16		; 6 a 1 1??? aa:16 1 7 0  ignore
     24  1.1  christos 	# not.b @aa:32		; 6 a 3 1??? aa:32 1 7 0  ignore
     25  1.1  christos 	# word operations
     26  1.1  christos 	# long operations
     27  1.1  christos 	#
     28  1.1  christos 	# Coming soon:
     29  1.1  christos 	# not.b @aa:8		; 7 f aaaaaaaa 1 7 0  ignore
     30  1.1  christos 	#
     31  1.1  christos 
     32  1.1  christos .data
     33  1.1  christos byte_dest:	.byte 0xa5
     34  1.1  christos 	.align 2
     35  1.1  christos word_dest:	.word 0xa5a5
     36  1.1  christos 	.align 4
     37  1.1  christos long_dest:	.long 0xa5a5a5a5
     38  1.1  christos 	start
     39  1.1  christos 
     40  1.1  christos 	#
     41  1.1  christos 	# 8-bit byte operations
     42  1.1  christos 	#
     43  1.1  christos 
     44  1.1  christos not_b_reg8:
     45  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     46  1.1  christos 	;;  fixme set ccr
     47  1.1  christos 
     48  1.1  christos 	;;  not.b Rd
     49  1.1  christos 	not	r0l		; 8-bit register
     50  1.1  christos ;;;	.word	0x1708
     51  1.1  christos 
     52  1.1  christos 	cmp.b	#0x5a, r0l	; result of "not 0xa5"
     53  1.1  christos 	beq	.Lbrd
     54  1.1  christos 	fail
     55  1.1  christos .Lbrd:
     56  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
     57  1.1  christos 	test_h_gr16 0xa55a r0	; r0 changed by 'not'
     58  1.1  christos .if (sim_cpu)			; non-zero means h8300h, s, or sx
     59  1.1  christos 	test_h_gr32 0xa5a5a55a er0	; er0 changed by 'not'
     60  1.1  christos .endif
     61  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     62  1.1  christos 	test_gr_a5a5 2
     63  1.1  christos 	test_gr_a5a5 3
     64  1.1  christos 	test_gr_a5a5 4
     65  1.1  christos 	test_gr_a5a5 5
     66  1.1  christos 	test_gr_a5a5 6
     67  1.1  christos 	test_gr_a5a5 7
     68  1.1  christos 
     69  1.1  christos .if (sim_cpu == h8sx)
     70  1.1  christos not_b_rdind:
     71  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
     72  1.1  christos 	set_ccr_zero
     73  1.1  christos 
     74  1.1  christos 	;;  not.b @eRd
     75  1.1  christos 	mov	#byte_dest, er0
     76  1.1  christos 	not.b	@er0		; register indirect operand
     77  1.1  christos ;;;	.word	0x7d00
     78  1.1  christos ;;;	.word	0x1700
     79  1.1  christos 
     80  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
     81  1.1  christos 	test_ovf_clear
     82  1.1  christos 	test_zero_clear
     83  1.1  christos 	test_neg_clear
     84  1.1  christos 
     85  1.1  christos 	test_h_gr32 byte_dest er0	; er0 still contains address
     86  1.1  christos 	cmp.b	#0x5a:8, @er0	; memory contents changed
     87  1.1  christos 	beq	.Lbind
     88  1.1  christos 	fail
     89  1.1  christos .Lbind:
     90  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
     91  1.1  christos 	test_gr_a5a5 2
     92  1.1  christos 	test_gr_a5a5 3
     93  1.1  christos 	test_gr_a5a5 4
     94  1.1  christos 	test_gr_a5a5 5
     95  1.1  christos 	test_gr_a5a5 6
     96  1.1  christos 	test_gr_a5a5 7
     97  1.1  christos 
     98  1.1  christos not_b_rdpostinc:
     99  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    100  1.1  christos 	set_ccr_zero
    101  1.1  christos 
    102  1.1  christos 	;;  not.b @eRd+
    103  1.1  christos 	mov	#byte_dest, er0	; register post-increment operand
    104  1.1  christos 	not.b	@er0+
    105  1.1  christos ;;;	.word	0x0174
    106  1.1  christos ;;;	.word	0x6c08
    107  1.1  christos ;;;	.word	0x1700
    108  1.1  christos 
    109  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    110  1.1  christos 	test_ovf_clear
    111  1.1  christos 	test_zero_clear
    112  1.1  christos 	test_neg_set
    113  1.1  christos 
    114  1.1  christos 	test_h_gr32 byte_dest+1 er0	; er0 contains address plus one
    115  1.1  christos 	cmp.b	#0xa5:8, @-er0
    116  1.1  christos 	beq	.Lbpostinc
    117  1.1  christos 	fail
    118  1.1  christos .Lbpostinc:
    119  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    120  1.1  christos 	test_gr_a5a5 2
    121  1.1  christos 	test_gr_a5a5 3
    122  1.1  christos 	test_gr_a5a5 4
    123  1.1  christos 	test_gr_a5a5 5
    124  1.1  christos 	test_gr_a5a5 6
    125  1.1  christos 	test_gr_a5a5 7
    126  1.1  christos 
    127  1.1  christos not_b_rdpostdec:
    128  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    129  1.1  christos 	set_ccr_zero
    130  1.1  christos 
    131  1.1  christos 	;;  not.b @eRd-
    132  1.1  christos 	mov	#byte_dest, er0	; register post-decrement operand
    133  1.1  christos 	not.b	@er0-
    134  1.1  christos ;;;	.word	0x0176
    135  1.1  christos ;;;	.word	0x6c08
    136  1.1  christos ;;;	.word	0x1700
    137  1.1  christos 
    138  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    139  1.1  christos 	test_ovf_clear
    140  1.1  christos 	test_zero_clear
    141  1.1  christos 	test_neg_clear
    142  1.1  christos 
    143  1.1  christos 	test_h_gr32 byte_dest-1 er0	; er0 contains address minus one
    144  1.1  christos 	cmp.b	#0x5a:8, @+er0
    145  1.1  christos ;;; 	.word	0x0175
    146  1.1  christos ;;; 	.word	0x6c08
    147  1.1  christos ;;; 	.word	0xa05a
    148  1.1  christos 	beq	.Lbpostdec
    149  1.1  christos 	fail
    150  1.1  christos .Lbpostdec:
    151  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    152  1.1  christos 	test_gr_a5a5 2
    153  1.1  christos 	test_gr_a5a5 3
    154  1.1  christos 	test_gr_a5a5 4
    155  1.1  christos 	test_gr_a5a5 5
    156  1.1  christos 	test_gr_a5a5 6
    157  1.1  christos 	test_gr_a5a5 7
    158  1.1  christos 
    159  1.1  christos not_b_rdpreinc:
    160  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    161  1.1  christos 	set_ccr_zero
    162  1.1  christos 
    163  1.1  christos 	;;  not.b @+eRd
    164  1.1  christos 	mov	#byte_dest-1, er0
    165  1.1  christos 	not.b	@+er0			; reg pre-increment operand
    166  1.1  christos ;;;	.word	0x0175
    167  1.1  christos ;;;	.word	0x6c08
    168  1.1  christos ;;;	.word	0x1700
    169  1.1  christos 
    170  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    171  1.1  christos 	test_ovf_clear
    172  1.1  christos 	test_zero_clear
    173  1.1  christos 	test_neg_set
    174  1.1  christos 
    175  1.1  christos 	cmp.b	#0xa5:8, @er0
    176  1.1  christos 	beq	.Lbpreinc
    177  1.1  christos 	fail
    178  1.1  christos .Lbpreinc:
    179  1.1  christos 	test_h_gr32 byte_dest er0	; er0 contains destination address
    180  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    181  1.1  christos 	test_gr_a5a5 2
    182  1.1  christos 	test_gr_a5a5 3
    183  1.1  christos 	test_gr_a5a5 4
    184  1.1  christos 	test_gr_a5a5 5
    185  1.1  christos 	test_gr_a5a5 6
    186  1.1  christos 	test_gr_a5a5 7
    187  1.1  christos 
    188  1.1  christos not_b_rdpredec:
    189  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    190  1.1  christos 	set_ccr_zero
    191  1.1  christos 
    192  1.1  christos 	;;  not.b @-eRd
    193  1.1  christos 	mov	#byte_dest+1, er0
    194  1.1  christos 	not.b	@-er0		; reg pre-decr operand
    195  1.1  christos ;;;	.word	0x0177
    196  1.1  christos ;;;	.word	0x6c08
    197  1.1  christos ;;;	.word	0x1700
    198  1.1  christos 
    199  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    200  1.1  christos 	test_ovf_clear
    201  1.1  christos 	test_zero_clear
    202  1.1  christos 	test_neg_clear
    203  1.1  christos 
    204  1.1  christos 	cmp.b	#0x5a:8, @er0
    205  1.1  christos 	beq	.Lbpredec
    206  1.1  christos 	fail
    207  1.1  christos .Lbpredec:
    208  1.1  christos 	test_h_gr32 byte_dest er0	; er0 contains destination address
    209  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    210  1.1  christos 	test_gr_a5a5 2
    211  1.1  christos 	test_gr_a5a5 3
    212  1.1  christos 	test_gr_a5a5 4
    213  1.1  christos 	test_gr_a5a5 5
    214  1.1  christos 	test_gr_a5a5 6
    215  1.1  christos 	test_gr_a5a5 7
    216  1.1  christos 
    217  1.1  christos not_b_disp2dst:
    218  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    219  1.1  christos 	set_ccr_zero
    220  1.1  christos 
    221  1.1  christos 	;;  not.b @(dd:2, erd)
    222  1.1  christos 	mov	#byte_dest-1, er0
    223  1.1  christos 	not.b	@(1:2, er0)	; reg plus 2-bit displacement
    224  1.1  christos ;;; 	.word	0x0175
    225  1.1  christos ;;; 	.word	0x6808
    226  1.1  christos ;;; 	.word	0x1700
    227  1.1  christos 
    228  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    229  1.1  christos 	test_ovf_clear
    230  1.1  christos 	test_zero_clear
    231  1.1  christos 	test_neg_set
    232  1.1  christos 
    233  1.1  christos 	cmp.b	#0xa5:8, @+er0
    234  1.1  christos 	beq	.Lbdisp2
    235  1.1  christos 	fail
    236  1.1  christos .Lbdisp2:
    237  1.1  christos 	test_h_gr32 byte_dest er0	; er0 contains destination address
    238  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    239  1.1  christos 	test_gr_a5a5 2
    240  1.1  christos 	test_gr_a5a5 3
    241  1.1  christos 	test_gr_a5a5 4
    242  1.1  christos 	test_gr_a5a5 5
    243  1.1  christos 	test_gr_a5a5 6
    244  1.1  christos 	test_gr_a5a5 7
    245  1.1  christos 
    246  1.1  christos not_b_disp16dst:
    247  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    248  1.1  christos 	set_ccr_zero
    249  1.1  christos 
    250  1.1  christos 	;;  not.b @(dd:16, erd)
    251  1.1  christos 	mov	#byte_dest+100, er0
    252  1.1  christos 	not.b	@(-100:16, er0)	; reg plus 16-bit displacement
    253  1.1  christos ;;;	.word	0x0174
    254  1.1  christos ;;;	.word	0x6e08
    255  1.1  christos ;;;	.word	-100
    256  1.1  christos ;;;	.word	0x1700
    257  1.1  christos 
    258  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    259  1.1  christos 	test_ovf_clear
    260  1.1  christos 	test_zero_clear
    261  1.1  christos 	test_neg_clear
    262  1.1  christos 
    263  1.1  christos 	cmp.b	#0x5a:8, @byte_dest
    264  1.1  christos 	beq	.Lbdisp16
    265  1.1  christos 	fail
    266  1.1  christos .Lbdisp16:
    267  1.1  christos 	test_h_gr32 byte_dest+100 er0	; er0 contains destination address
    268  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    269  1.1  christos 	test_gr_a5a5 2
    270  1.1  christos 	test_gr_a5a5 3
    271  1.1  christos 	test_gr_a5a5 4
    272  1.1  christos 	test_gr_a5a5 5
    273  1.1  christos 	test_gr_a5a5 6
    274  1.1  christos 	test_gr_a5a5 7
    275  1.1  christos 
    276  1.1  christos not_b_disp32dst:
    277  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    278  1.1  christos 	set_ccr_zero
    279  1.1  christos 
    280  1.1  christos 	;;  not.b @(dd:32, erd)
    281  1.1  christos 	mov	#byte_dest-0xfffff, er0
    282  1.1  christos 	not.b	@(0xfffff:32, er0)	; reg plus 32-bit displacement
    283  1.1  christos ;;;	.word	0x7804
    284  1.1  christos ;;;	.word	0x6a28
    285  1.1  christos ;;;	.long	0xfffff
    286  1.1  christos ;;;	.word	0x1700
    287  1.1  christos 
    288  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    289  1.1  christos 	test_ovf_clear
    290  1.1  christos 	test_zero_clear
    291  1.1  christos 	test_neg_set
    292  1.1  christos 
    293  1.1  christos 	cmp.b	#0xa5:8, @byte_dest
    294  1.1  christos 	beq	.Lbdisp32
    295  1.1  christos 	fail
    296  1.1  christos .Lbdisp32:
    297  1.1  christos 	test_h_gr32 byte_dest-0xfffff er0 ; er0 contains destination address
    298  1.1  christos 	test_gr_a5a5 1		; Make sure other general regs not disturbed
    299  1.1  christos 	test_gr_a5a5 2
    300  1.1  christos 	test_gr_a5a5 3
    301  1.1  christos 	test_gr_a5a5 4
    302  1.1  christos 	test_gr_a5a5 5
    303  1.1  christos 	test_gr_a5a5 6
    304  1.1  christos 	test_gr_a5a5 7
    305  1.1  christos 
    306  1.1  christos not_b_abs16dst:
    307  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    308  1.1  christos 	set_ccr_zero
    309  1.1  christos 
    310  1.1  christos 	;;  not.b @aa:16
    311  1.1  christos 	not.b	@byte_dest:16	; 16-bit absolute address
    312  1.1  christos ;;;	.word	0x6a18
    313  1.1  christos ;;;	.word	byte_dest
    314  1.1  christos ;;;	.word	0x1700
    315  1.1  christos 
    316  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    317  1.1  christos 	test_ovf_clear
    318  1.1  christos 	test_zero_clear
    319  1.1  christos 	test_neg_clear
    320  1.1  christos 
    321  1.1  christos 	cmp.b	#0x5a:8, @byte_dest
    322  1.1  christos 	beq	.Lbabs16
    323  1.1  christos 	fail
    324  1.1  christos .Lbabs16:
    325  1.1  christos 	test_gr_a5a5 0		; Make sure ALL general regs not disturbed
    326  1.1  christos 	test_gr_a5a5 1
    327  1.1  christos 	test_gr_a5a5 2
    328  1.1  christos 	test_gr_a5a5 3
    329  1.1  christos 	test_gr_a5a5 4
    330  1.1  christos 	test_gr_a5a5 5
    331  1.1  christos 	test_gr_a5a5 6
    332  1.1  christos 	test_gr_a5a5 7
    333  1.1  christos 
    334  1.1  christos not_b_abs32dst:
    335  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    336  1.1  christos 	set_ccr_zero
    337  1.1  christos 
    338  1.1  christos 	;;  not.b @aa:32
    339  1.1  christos 	not.b	@byte_dest:32	; 32-bit absolute address
    340  1.1  christos ;;;	.word	0x6a38
    341  1.1  christos ;;;	.long	byte_dest
    342  1.1  christos ;;;	.word	0x1700
    343  1.1  christos 
    344  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    345  1.1  christos 	test_ovf_clear
    346  1.1  christos 	test_zero_clear
    347  1.1  christos 	test_neg_set
    348  1.1  christos 
    349  1.1  christos 	cmp.b	#0xa5:8, @byte_dest
    350  1.1  christos 	beq	.Lbabs32
    351  1.1  christos 	fail
    352  1.1  christos .Lbabs32:
    353  1.1  christos 	test_gr_a5a5 0		; Make sure ALL general regs not disturbed
    354  1.1  christos 	test_gr_a5a5 1
    355  1.1  christos 	test_gr_a5a5 2
    356  1.1  christos 	test_gr_a5a5 3
    357  1.1  christos 	test_gr_a5a5 4
    358  1.1  christos 	test_gr_a5a5 5
    359  1.1  christos 	test_gr_a5a5 6
    360  1.1  christos 	test_gr_a5a5 7
    361  1.1  christos .endif
    362  1.1  christos 
    363  1.1  christos 	#
    364  1.1  christos 	# 16-bit word operations
    365  1.1  christos 	#
    366  1.1  christos 
    367  1.1  christos .if (sim_cpu)			; any except plain-vanilla h8/300
    368  1.1  christos not_w_reg16:
    369  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    370  1.1  christos 	;;  fixme set ccr
    371  1.1  christos 
    372  1.1  christos 	;;  not.w Rd
    373  1.1  christos 	not	r1		; 16-bit register operand
    374  1.1  christos ;;;	.word	0x1711
    375  1.1  christos 
    376  1.1  christos 	cmp.w	#0x5a5a, r1	; result of "not 0xa5a5"
    377  1.1  christos 	beq	.Lwrd
    378  1.1  christos 	fail
    379  1.1  christos .Lwrd:
    380  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
    381  1.1  christos 	test_h_gr32 0xa5a55a5a er1	; er1 changed by 'not'
    382  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    383  1.1  christos 	test_gr_a5a5 2
    384  1.1  christos 	test_gr_a5a5 3
    385  1.1  christos 	test_gr_a5a5 4
    386  1.1  christos 	test_gr_a5a5 5
    387  1.1  christos 	test_gr_a5a5 6
    388  1.1  christos 	test_gr_a5a5 7
    389  1.1  christos 
    390  1.1  christos .if (sim_cpu == h8sx)
    391  1.1  christos not_w_rdind:
    392  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    393  1.1  christos 	set_ccr_zero
    394  1.1  christos 
    395  1.1  christos 	;;  not.w @eRd
    396  1.1  christos 	mov	#word_dest, er1
    397  1.1  christos 	not.w	@er1		; register indirect operand
    398  1.1  christos ;;;	.word	0x0154
    399  1.1  christos ;;;	.word	0x6d18
    400  1.1  christos ;;;	.word	0x1710
    401  1.1  christos 
    402  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    403  1.1  christos 	test_ovf_clear
    404  1.1  christos 	test_zero_clear
    405  1.1  christos 	test_neg_clear
    406  1.1  christos 
    407  1.1  christos 	cmp.w	#0x5a5a, @word_dest	; memory contents changed
    408  1.1  christos 	beq	.Lwind
    409  1.1  christos 	fail
    410  1.1  christos .Lwind:
    411  1.1  christos 	test_h_gr32 word_dest er1	; er1 still contains address
    412  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    413  1.1  christos 	test_gr_a5a5 2
    414  1.1  christos 	test_gr_a5a5 3
    415  1.1  christos 	test_gr_a5a5 4
    416  1.1  christos 	test_gr_a5a5 5
    417  1.1  christos 	test_gr_a5a5 6
    418  1.1  christos 	test_gr_a5a5 7
    419  1.1  christos 
    420  1.1  christos not_w_rdpostinc:
    421  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    422  1.1  christos 	set_ccr_zero
    423  1.1  christos 
    424  1.1  christos 	;;  not.w @eRd+
    425  1.1  christos 	mov	#word_dest, er1	; register post-increment operand
    426  1.1  christos 	not.w	@er1+
    427  1.1  christos ;;;	.word	0x0154
    428  1.1  christos ;;;	.word	0x6d18
    429  1.1  christos ;;;	.word	0x1710
    430  1.1  christos 
    431  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    432  1.1  christos 	test_ovf_clear
    433  1.1  christos 	test_zero_clear
    434  1.1  christos 	test_neg_set
    435  1.1  christos 
    436  1.1  christos 	cmp.w	#0xa5a5, @word_dest
    437  1.1  christos 	beq	.Lwpostinc
    438  1.1  christos 	fail
    439  1.1  christos .Lwpostinc:
    440  1.1  christos 	test_h_gr32 word_dest+2 er1	; er1 contains address plus two
    441  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    442  1.1  christos 	test_gr_a5a5 2
    443  1.1  christos 	test_gr_a5a5 3
    444  1.1  christos 	test_gr_a5a5 4
    445  1.1  christos 	test_gr_a5a5 5
    446  1.1  christos 	test_gr_a5a5 6
    447  1.1  christos 	test_gr_a5a5 7
    448  1.1  christos 
    449  1.1  christos not_w_rdpostdec:
    450  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    451  1.1  christos 	set_ccr_zero
    452  1.1  christos 
    453  1.1  christos 	;;  not.w @eRd-
    454  1.1  christos 	mov	#word_dest, er1
    455  1.1  christos 	not.w	@er1-
    456  1.1  christos ;;;	.word	0x0156
    457  1.1  christos ;;;	.word	0x6d18
    458  1.1  christos ;;;	.word	0x1710
    459  1.1  christos 
    460  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    461  1.1  christos 	test_ovf_clear
    462  1.1  christos 	test_zero_clear
    463  1.1  christos 	test_neg_clear
    464  1.1  christos 
    465  1.1  christos 	cmp.w	#0x5a5a, @word_dest
    466  1.1  christos 	beq	.Lwpostdec
    467  1.1  christos 	fail
    468  1.1  christos .Lwpostdec:
    469  1.1  christos 	test_h_gr32 word_dest-2 er1	; er1 contains address minus two
    470  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    471  1.1  christos 	test_gr_a5a5 2
    472  1.1  christos 	test_gr_a5a5 3
    473  1.1  christos 	test_gr_a5a5 4
    474  1.1  christos 	test_gr_a5a5 5
    475  1.1  christos 	test_gr_a5a5 6
    476  1.1  christos 	test_gr_a5a5 7
    477  1.1  christos 
    478  1.1  christos not_w_rdpreinc:
    479  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    480  1.1  christos 	set_ccr_zero
    481  1.1  christos 
    482  1.1  christos 	;;  not.w @+eRd
    483  1.1  christos 	mov	#word_dest-2, er1
    484  1.1  christos 	not.w	@+er1		; reg pre-increment operand
    485  1.1  christos ;;;	.word	0x0155
    486  1.1  christos ;;;	.word	0x6d18
    487  1.1  christos ;;;	.word	0x1710
    488  1.1  christos 
    489  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    490  1.1  christos 	test_ovf_clear
    491  1.1  christos 	test_zero_clear
    492  1.1  christos 	test_neg_set
    493  1.1  christos 
    494  1.1  christos 	cmp.w	#0xa5a5, @word_dest
    495  1.1  christos 	beq	.Lwpreinc
    496  1.1  christos 	fail
    497  1.1  christos .Lwpreinc:
    498  1.1  christos 	test_h_gr32 word_dest er1	; er1 contains destination address
    499  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    500  1.1  christos 	test_gr_a5a5 2
    501  1.1  christos 	test_gr_a5a5 3
    502  1.1  christos 	test_gr_a5a5 4
    503  1.1  christos 	test_gr_a5a5 5
    504  1.1  christos 	test_gr_a5a5 6
    505  1.1  christos 	test_gr_a5a5 7
    506  1.1  christos 
    507  1.1  christos not_w_rdpredec:
    508  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    509  1.1  christos 	set_ccr_zero
    510  1.1  christos 
    511  1.1  christos 	;;  not.w @-eRd
    512  1.1  christos 	mov	#word_dest+2, er1
    513  1.1  christos 	not.w	@-er1		; reg pre-decr operand
    514  1.1  christos ;;;	.word	0x0157
    515  1.1  christos ;;;	.word	0x6d18
    516  1.1  christos ;;;	.word	0x1710
    517  1.1  christos 
    518  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    519  1.1  christos 	test_ovf_clear
    520  1.1  christos 	test_zero_clear
    521  1.1  christos 	test_neg_clear
    522  1.1  christos 
    523  1.1  christos 	cmp.w	#0x5a5a, @word_dest
    524  1.1  christos 	beq	.Lwpredec
    525  1.1  christos 	fail
    526  1.1  christos .Lwpredec:
    527  1.1  christos 	test_h_gr32 word_dest er1	; er1 contains destination address
    528  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    529  1.1  christos 	test_gr_a5a5 2
    530  1.1  christos 	test_gr_a5a5 3
    531  1.1  christos 	test_gr_a5a5 4
    532  1.1  christos 	test_gr_a5a5 5
    533  1.1  christos 	test_gr_a5a5 6
    534  1.1  christos 	test_gr_a5a5 7
    535  1.1  christos 
    536  1.1  christos not_w_disp2dst:
    537  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    538  1.1  christos 	set_ccr_zero
    539  1.1  christos 
    540  1.1  christos 	;;  not.w @(dd:2, erd)
    541  1.1  christos 	mov	#word_dest-2, er1
    542  1.1  christos 	not.w	@(2:2, er1)	; reg plus 2-bit displacement
    543  1.1  christos ;;; 	.word	0x0155
    544  1.1  christos ;;; 	.word	0x6918
    545  1.1  christos ;;; 	.word	0x1710
    546  1.1  christos 
    547  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    548  1.1  christos 	test_ovf_clear
    549  1.1  christos 	test_zero_clear
    550  1.1  christos 	test_neg_set
    551  1.1  christos 
    552  1.1  christos 	cmp.w	#0xa5a5, @word_dest
    553  1.1  christos 	beq	.Lwdisp2
    554  1.1  christos 	fail
    555  1.1  christos .Lwdisp2:
    556  1.1  christos 	test_h_gr32 word_dest-2 er1	; er1 contains address minus one
    557  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    558  1.1  christos 	test_gr_a5a5 2
    559  1.1  christos 	test_gr_a5a5 3
    560  1.1  christos 	test_gr_a5a5 4
    561  1.1  christos 	test_gr_a5a5 5
    562  1.1  christos 	test_gr_a5a5 6
    563  1.1  christos 	test_gr_a5a5 7
    564  1.1  christos 
    565  1.1  christos not_w_disp16dst:
    566  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    567  1.1  christos 	set_ccr_zero
    568  1.1  christos 
    569  1.1  christos 	;;  not.w @(dd:16, erd)
    570  1.1  christos 	mov	#word_dest+100, er1
    571  1.1  christos 	not.w	@(-100:16, er1)	; reg plus 16-bit displacement
    572  1.1  christos ;;;	.word	0x0154
    573  1.1  christos ;;;	.word	0x6f18
    574  1.1  christos ;;;	.word	-100
    575  1.1  christos ;;;	.word	0x1710
    576  1.1  christos 
    577  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    578  1.1  christos 	test_ovf_clear
    579  1.1  christos 	test_zero_clear
    580  1.1  christos 	test_neg_clear
    581  1.1  christos 
    582  1.1  christos 	cmp.w	#0x5a5a, @word_dest
    583  1.1  christos 	beq	.Lwdisp16
    584  1.1  christos 	fail
    585  1.1  christos .Lwdisp16:
    586  1.1  christos 	test_h_gr32 word_dest+100 er1	; er1 contains destination address
    587  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    588  1.1  christos 	test_gr_a5a5 2
    589  1.1  christos 	test_gr_a5a5 3
    590  1.1  christos 	test_gr_a5a5 4
    591  1.1  christos 	test_gr_a5a5 5
    592  1.1  christos 	test_gr_a5a5 6
    593  1.1  christos 	test_gr_a5a5 7
    594  1.1  christos 
    595  1.1  christos not_w_disp32dst:
    596  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    597  1.1  christos 	set_ccr_zero
    598  1.1  christos 
    599  1.1  christos 	;;  not.w @(dd:32, erd)
    600  1.1  christos 	mov	#word_dest-0xfffff, er1
    601  1.1  christos 	not.w	@(0xfffff:32, er1)	; reg plus 32-bit displacement
    602  1.1  christos ;;;	.word	0x7814
    603  1.1  christos ;;;	.word	0x6b28
    604  1.1  christos ;;;	.long	0xfffff
    605  1.1  christos ;;;	.word	0x1710
    606  1.1  christos 
    607  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    608  1.1  christos 	test_ovf_clear
    609  1.1  christos 	test_zero_clear
    610  1.1  christos 	test_neg_set
    611  1.1  christos 
    612  1.1  christos 	cmp.w	#0xa5a5, @word_dest
    613  1.1  christos 	beq	.Lwdisp32
    614  1.1  christos 	fail
    615  1.1  christos .Lwdisp32:
    616  1.1  christos 	test_h_gr32 word_dest-0xfffff er1 ; er1 contains destination address
    617  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    618  1.1  christos 	test_gr_a5a5 2
    619  1.1  christos 	test_gr_a5a5 3
    620  1.1  christos 	test_gr_a5a5 4
    621  1.1  christos 	test_gr_a5a5 5
    622  1.1  christos 	test_gr_a5a5 6
    623  1.1  christos 	test_gr_a5a5 7
    624  1.1  christos 
    625  1.1  christos not_w_abs16dst:
    626  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    627  1.1  christos 	set_ccr_zero
    628  1.1  christos 
    629  1.1  christos 	;;  not.w @aa:16
    630  1.1  christos 	not.w	@word_dest:16	; 16-bit absolute address
    631  1.1  christos ;;;	.word	0x6b18
    632  1.1  christos ;;;	.word	word_dest
    633  1.1  christos ;;;	.word	0x1710
    634  1.1  christos 
    635  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    636  1.1  christos 	test_ovf_clear
    637  1.1  christos 	test_zero_clear
    638  1.1  christos 	test_neg_clear
    639  1.1  christos 
    640  1.1  christos 	cmp.w	#0x5a5a, @word_dest
    641  1.1  christos 	beq	.Lwabs16
    642  1.1  christos 	fail
    643  1.1  christos .Lwabs16:
    644  1.1  christos 	test_gr_a5a5 0		; Make sure ALL general regs not disturbed
    645  1.1  christos 	test_gr_a5a5 1
    646  1.1  christos 	test_gr_a5a5 2
    647  1.1  christos 	test_gr_a5a5 3
    648  1.1  christos 	test_gr_a5a5 4
    649  1.1  christos 	test_gr_a5a5 5
    650  1.1  christos 	test_gr_a5a5 6
    651  1.1  christos 	test_gr_a5a5 7
    652  1.1  christos 
    653  1.1  christos not_w_abs32dst:
    654  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    655  1.1  christos 	set_ccr_zero
    656  1.1  christos 
    657  1.1  christos 	;;  not.w @aa:32
    658  1.1  christos 	not.w	@word_dest:32	; 32-bit absolute address
    659  1.1  christos ;;;	.word	0x6b38
    660  1.1  christos ;;;	.long	word_dest
    661  1.1  christos ;;;	.word	0x1710
    662  1.1  christos 
    663  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    664  1.1  christos 	test_ovf_clear
    665  1.1  christos 	test_zero_clear
    666  1.1  christos 	test_neg_set
    667  1.1  christos 
    668  1.1  christos 	cmp.w	#0xa5a5, @word_dest
    669  1.1  christos 	beq	.Lwabs32
    670  1.1  christos 	fail
    671  1.1  christos .Lwabs32:
    672  1.1  christos 	test_gr_a5a5 0		; Make sure ALL general regs not disturbed
    673  1.1  christos 	test_gr_a5a5 1
    674  1.1  christos 	test_gr_a5a5 2
    675  1.1  christos 	test_gr_a5a5 3
    676  1.1  christos 	test_gr_a5a5 4
    677  1.1  christos 	test_gr_a5a5 5
    678  1.1  christos 	test_gr_a5a5 6
    679  1.1  christos 	test_gr_a5a5 7
    680  1.1  christos 
    681  1.1  christos .endif				; h8sx
    682  1.1  christos .endif				; h8/300
    683  1.1  christos 
    684  1.1  christos 	#
    685  1.1  christos 	# 32-bit word operations
    686  1.1  christos 	#
    687  1.1  christos 
    688  1.1  christos .if (sim_cpu)			; any except plain-vanilla h8/300
    689  1.1  christos not_l_reg16:
    690  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    691  1.1  christos 	;;  fixme set ccr
    692  1.1  christos 
    693  1.1  christos 	;;  not.l eRd
    694  1.1  christos 	not	er1		; 32-bit register operand
    695  1.1  christos ;;;	.word	0x1731
    696  1.1  christos 
    697  1.1  christos 	cmp.l	#0x5a5a5a5a, er1	; result of "not 0xa5a5a5a5"
    698  1.1  christos 	beq	.Llrd
    699  1.1  christos 	fail
    700  1.1  christos .Llrd:
    701  1.1  christos 	;; fixme test ccr	; H=0 N=1 Z=0 V=0 C=0
    702  1.1  christos 	test_h_gr32 0x5a5a5a5a er1	; er1 changed by 'not'
    703  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    704  1.1  christos 	test_gr_a5a5 2
    705  1.1  christos 	test_gr_a5a5 3
    706  1.1  christos 	test_gr_a5a5 4
    707  1.1  christos 	test_gr_a5a5 5
    708  1.1  christos 	test_gr_a5a5 6
    709  1.1  christos 	test_gr_a5a5 7
    710  1.1  christos 
    711  1.1  christos .if (sim_cpu == h8sx)
    712  1.1  christos not_l_rdind:
    713  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    714  1.1  christos 	set_ccr_zero
    715  1.1  christos 
    716  1.1  christos 	;;  not.l @eRd
    717  1.1  christos 	mov	#long_dest, er1
    718  1.1  christos 	not.l	@er1		; register indirect operand
    719  1.1  christos ;;;	.word	0x0104
    720  1.1  christos ;;;	.word	0x6d18
    721  1.1  christos ;;;	.word	0x1730
    722  1.1  christos 
    723  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    724  1.1  christos 	test_ovf_clear
    725  1.1  christos 	test_zero_clear
    726  1.1  christos 	test_neg_clear
    727  1.1  christos 
    728  1.1  christos 	cmp.l	#0x5a5a5a5a, @long_dest	; memory contents changed
    729  1.1  christos 	beq	.Llind
    730  1.1  christos 	fail
    731  1.1  christos .Llind:
    732  1.1  christos 	test_h_gr32 long_dest er1	; er1 still contains address
    733  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    734  1.1  christos 	test_gr_a5a5 2
    735  1.1  christos 	test_gr_a5a5 3
    736  1.1  christos 	test_gr_a5a5 4
    737  1.1  christos 	test_gr_a5a5 5
    738  1.1  christos 	test_gr_a5a5 6
    739  1.1  christos 	test_gr_a5a5 7
    740  1.1  christos 
    741  1.1  christos not_l_rdpostinc:
    742  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    743  1.1  christos 	set_ccr_zero
    744  1.1  christos 
    745  1.1  christos 	;;  not.l @eRd+
    746  1.1  christos 	mov	#long_dest, er1	; register post-increment operand
    747  1.1  christos 	not.l	@er1+
    748  1.1  christos ;;;	.word	0x0104
    749  1.1  christos ;;;	.word	0x6d18
    750  1.1  christos ;;;	.word	0x1730
    751  1.1  christos 
    752  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    753  1.1  christos 	test_ovf_clear
    754  1.1  christos 	test_zero_clear
    755  1.1  christos 	test_neg_set
    756  1.1  christos 
    757  1.1  christos 	cmp.l	#0xa5a5a5a5, @long_dest
    758  1.1  christos 	beq	.Llpostinc
    759  1.1  christos 	fail
    760  1.1  christos .Llpostinc:
    761  1.1  christos 	test_h_gr32 long_dest+4 er1	; er1 contains address plus two
    762  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    763  1.1  christos 	test_gr_a5a5 2
    764  1.1  christos 	test_gr_a5a5 3
    765  1.1  christos 	test_gr_a5a5 4
    766  1.1  christos 	test_gr_a5a5 5
    767  1.1  christos 	test_gr_a5a5 6
    768  1.1  christos 	test_gr_a5a5 7
    769  1.1  christos 
    770  1.1  christos not_l_rdpostdec:
    771  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    772  1.1  christos 	set_ccr_zero
    773  1.1  christos 
    774  1.1  christos 	;;  not.l @eRd-
    775  1.1  christos 	mov	#long_dest, er1
    776  1.1  christos 	not.l	@er1-
    777  1.1  christos ;;;	.word	0x0106
    778  1.1  christos ;;;	.word	0x6d18
    779  1.1  christos ;;;	.word	0x1730
    780  1.1  christos 
    781  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    782  1.1  christos 	test_ovf_clear
    783  1.1  christos 	test_zero_clear
    784  1.1  christos 	test_neg_clear
    785  1.1  christos 
    786  1.1  christos 	cmp.l	#0x5a5a5a5a, @long_dest
    787  1.1  christos 	beq	.Llpostdec
    788  1.1  christos 	fail
    789  1.1  christos .Llpostdec:
    790  1.1  christos 	test_h_gr32 long_dest-4 er1	; er1 contains address minus two
    791  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    792  1.1  christos 	test_gr_a5a5 2
    793  1.1  christos 	test_gr_a5a5 3
    794  1.1  christos 	test_gr_a5a5 4
    795  1.1  christos 	test_gr_a5a5 5
    796  1.1  christos 	test_gr_a5a5 6
    797  1.1  christos 	test_gr_a5a5 7
    798  1.1  christos 
    799  1.1  christos not_l_rdpreinc:
    800  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    801  1.1  christos 	set_ccr_zero
    802  1.1  christos 
    803  1.1  christos 	;;  not.l @+eRd
    804  1.1  christos 	mov	#long_dest-4, er1
    805  1.1  christos 	not.l	@+er1		; reg pre-increment operand
    806  1.1  christos ;;;	.word	0x0105
    807  1.1  christos ;;;	.word	0x6d18
    808  1.1  christos ;;;	.word	0x1730
    809  1.1  christos 
    810  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    811  1.1  christos 	test_ovf_clear
    812  1.1  christos 	test_zero_clear
    813  1.1  christos 	test_neg_set
    814  1.1  christos 
    815  1.1  christos 	cmp.l	#0xa5a5a5a5, @long_dest
    816  1.1  christos 	beq	.Llpreinc
    817  1.1  christos 	fail
    818  1.1  christos .Llpreinc:
    819  1.1  christos 	test_h_gr32 long_dest er1	; er1 contains destination address
    820  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    821  1.1  christos 	test_gr_a5a5 2
    822  1.1  christos 	test_gr_a5a5 3
    823  1.1  christos 	test_gr_a5a5 4
    824  1.1  christos 	test_gr_a5a5 5
    825  1.1  christos 	test_gr_a5a5 6
    826  1.1  christos 	test_gr_a5a5 7
    827  1.1  christos 
    828  1.1  christos not_l_rdpredec:
    829  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    830  1.1  christos 	set_ccr_zero
    831  1.1  christos 
    832  1.1  christos 	;;  not.l @-eRd
    833  1.1  christos 	mov	#long_dest+4, er1
    834  1.1  christos 	not.l	@-er1		; reg pre-decr operand
    835  1.1  christos ;;;	.word	0x0107
    836  1.1  christos ;;;	.word	0x6d18
    837  1.1  christos ;;;	.word	0x1730
    838  1.1  christos 
    839  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    840  1.1  christos 	test_ovf_clear
    841  1.1  christos 	test_zero_clear
    842  1.1  christos 	test_neg_clear
    843  1.1  christos 
    844  1.1  christos 	cmp.l	#0x5a5a5a5a, @long_dest
    845  1.1  christos 	beq	.Llpredec
    846  1.1  christos 	fail
    847  1.1  christos .Llpredec:
    848  1.1  christos 	test_h_gr32 long_dest er1	; er1 contains destination address
    849  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    850  1.1  christos 	test_gr_a5a5 2
    851  1.1  christos 	test_gr_a5a5 3
    852  1.1  christos 	test_gr_a5a5 4
    853  1.1  christos 	test_gr_a5a5 5
    854  1.1  christos 	test_gr_a5a5 6
    855  1.1  christos 	test_gr_a5a5 7
    856  1.1  christos 
    857  1.1  christos not_l_disp2dst:
    858  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    859  1.1  christos 	set_ccr_zero
    860  1.1  christos 
    861  1.1  christos 	;;  not.l @(dd:2, erd)
    862  1.1  christos 	mov	#long_dest-4, er1
    863  1.1  christos 	not.l	@(4:2, er1)	; reg plus 2-bit displacement
    864  1.1  christos ;;; 	.word	0x0105
    865  1.1  christos ;;; 	.word	0x6918
    866  1.1  christos ;;; 	.word	0x1730
    867  1.1  christos 
    868  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    869  1.1  christos 	test_ovf_clear
    870  1.1  christos 	test_zero_clear
    871  1.1  christos 	test_neg_set
    872  1.1  christos 
    873  1.1  christos 	cmp.l	#0xa5a5a5a5, @long_dest
    874  1.1  christos 	beq	.Lldisp2
    875  1.1  christos 	fail
    876  1.1  christos .Lldisp2:
    877  1.1  christos 	test_h_gr32 long_dest-4 er1	; er1 contains address minus one
    878  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    879  1.1  christos 	test_gr_a5a5 2
    880  1.1  christos 	test_gr_a5a5 3
    881  1.1  christos 	test_gr_a5a5 4
    882  1.1  christos 	test_gr_a5a5 5
    883  1.1  christos 	test_gr_a5a5 6
    884  1.1  christos 	test_gr_a5a5 7
    885  1.1  christos 
    886  1.1  christos not_l_disp16dst:
    887  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    888  1.1  christos 	set_ccr_zero
    889  1.1  christos 
    890  1.1  christos 	;;  not.l @(dd:16, erd)
    891  1.1  christos 	mov	#long_dest+100, er1
    892  1.1  christos 	not.l	@(-100:16, er1)	; reg plus 16-bit displacement
    893  1.1  christos ;;;	.word	0x0104
    894  1.1  christos ;;;	.word	0x6f18
    895  1.1  christos ;;;	.word	-100
    896  1.1  christos ;;;	.word	0x1730
    897  1.1  christos 
    898  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    899  1.1  christos 	test_ovf_clear
    900  1.1  christos 	test_zero_clear
    901  1.1  christos 	test_neg_clear
    902  1.1  christos 
    903  1.1  christos 	cmp.l	#0x5a5a5a5a, @long_dest
    904  1.1  christos 	beq	.Lldisp16
    905  1.1  christos 	fail
    906  1.1  christos .Lldisp16:
    907  1.1  christos 	test_h_gr32 long_dest+100 er1	; er1 contains destination address
    908  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    909  1.1  christos 	test_gr_a5a5 2
    910  1.1  christos 	test_gr_a5a5 3
    911  1.1  christos 	test_gr_a5a5 4
    912  1.1  christos 	test_gr_a5a5 5
    913  1.1  christos 	test_gr_a5a5 6
    914  1.1  christos 	test_gr_a5a5 7
    915  1.1  christos 
    916  1.1  christos not_l_disp32dst:
    917  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    918  1.1  christos 	set_ccr_zero
    919  1.1  christos 
    920  1.1  christos 	;;  not.l @(dd:32, erd)
    921  1.1  christos 	mov	#long_dest-0xfffff, er1
    922  1.1  christos 	not.l	@(0xfffff:32, er1)	; reg plus 32-bit displacement
    923  1.1  christos ;;;	.word	0x7894
    924  1.1  christos ;;;	.word	0x6b28
    925  1.1  christos ;;;	.long	0xfffff
    926  1.1  christos ;;;	.word	0x1730
    927  1.1  christos 
    928  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    929  1.1  christos 	test_ovf_clear
    930  1.1  christos 	test_zero_clear
    931  1.1  christos 	test_neg_set
    932  1.1  christos 
    933  1.1  christos 	cmp.l	#0xa5a5a5a5, @long_dest
    934  1.1  christos 	beq	.Lldisp32
    935  1.1  christos 	fail
    936  1.1  christos .Lldisp32:
    937  1.1  christos 	test_h_gr32 long_dest-0xfffff er1 ; er1 contains destination address
    938  1.1  christos 	test_gr_a5a5 0		; Make sure other general regs not disturbed
    939  1.1  christos 	test_gr_a5a5 2
    940  1.1  christos 	test_gr_a5a5 3
    941  1.1  christos 	test_gr_a5a5 4
    942  1.1  christos 	test_gr_a5a5 5
    943  1.1  christos 	test_gr_a5a5 6
    944  1.1  christos 	test_gr_a5a5 7
    945  1.1  christos 
    946  1.1  christos not_l_abs16dst:
    947  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    948  1.1  christos 	set_ccr_zero
    949  1.1  christos 
    950  1.1  christos 	;;  not.l @aa:16
    951  1.1  christos 	not.l	@long_dest:16	; 16-bit absolute address
    952  1.1  christos ;;;	.word	0x0104
    953  1.1  christos ;;;	.word	0x6b08
    954  1.1  christos ;;;	.word	long_dest
    955  1.1  christos ;;;	.word	0x1730
    956  1.1  christos 
    957  1.1  christos 	test_carry_clear	; H=0 N=0 Z=0 V=0 C=0
    958  1.1  christos 	test_ovf_clear
    959  1.1  christos 	test_zero_clear
    960  1.1  christos 	test_neg_clear
    961  1.1  christos 
    962  1.1  christos 	cmp.l	#0x5a5a5a5a, @long_dest
    963  1.1  christos 	beq	.Llabs16
    964  1.1  christos 	fail
    965  1.1  christos .Llabs16:
    966  1.1  christos 	test_gr_a5a5 0		; Make sure ALL general regs not disturbed
    967  1.1  christos 	test_gr_a5a5 1
    968  1.1  christos 	test_gr_a5a5 2
    969  1.1  christos 	test_gr_a5a5 3
    970  1.1  christos 	test_gr_a5a5 4
    971  1.1  christos 	test_gr_a5a5 5
    972  1.1  christos 	test_gr_a5a5 6
    973  1.1  christos 	test_gr_a5a5 7
    974  1.1  christos 
    975  1.1  christos not_l_abs32dst:
    976  1.1  christos 	set_grs_a5a5		; Fill all general regs with a fixed pattern
    977  1.1  christos 	set_ccr_zero
    978  1.1  christos 
    979  1.1  christos 	;;  not.l @aa:32
    980  1.1  christos 	not.l	@long_dest:32	; 32-bit absolute address
    981  1.1  christos ;;;	.word	0x0104
    982  1.1  christos ;;;	.word	0x6b28
    983  1.1  christos ;;;	.long	long_dest
    984  1.1  christos ;;;	.word	0x1730
    985  1.1  christos 
    986  1.1  christos 	test_carry_clear	; H=0 N=1 Z=0 V=0 C=0
    987  1.1  christos 	test_ovf_clear
    988  1.1  christos 	test_zero_clear
    989  1.1  christos 	test_neg_set
    990  1.1  christos 
    991  1.1  christos 	cmp.l	#0xa5a5a5a5, @long_dest
    992  1.1  christos 	beq	.Llabs32
    993  1.1  christos 	fail
    994  1.1  christos .Llabs32:
    995  1.1  christos 	test_gr_a5a5 0		; Make sure ALL general regs not disturbed
    996  1.1  christos 	test_gr_a5a5 1
    997  1.1  christos 	test_gr_a5a5 2
    998  1.1  christos 	test_gr_a5a5 3
    999  1.1  christos 	test_gr_a5a5 4
   1000  1.1  christos 	test_gr_a5a5 5
   1001  1.1  christos 	test_gr_a5a5 6
   1002  1.1  christos 	test_gr_a5a5 7
   1003  1.1  christos 
   1004  1.1  christos .endif				; h8sx
   1005  1.1  christos .endif				; h8/300
   1006  1.1  christos 
   1007  1.1  christos 	pass
   1008  1.1  christos 
   1009  1.1  christos 	exit 0
   1010