OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [h8300/] [shlr.s] - Diff between revs 24 and 157

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 157
# Hitachi H8 testcase 'shlr'
# Hitachi H8 testcase 'shlr'
# mach(): all
# mach(): all
# as(h8300):    --defsym sim_cpu=0
# as(h8300):    --defsym sim_cpu=0
# as(h8300h):   --defsym sim_cpu=1
# as(h8300h):   --defsym sim_cpu=1
# as(h8300s):   --defsym sim_cpu=2
# as(h8300s):   --defsym sim_cpu=2
# as(h8sx):     --defsym sim_cpu=3
# as(h8sx):     --defsym sim_cpu=3
# ld(h8300h):   -m h8300helf
# ld(h8300h):   -m h8300helf
# ld(h8300s):   -m h8300self
# ld(h8300s):   -m h8300self
# ld(h8sx):     -m h8300sxelf
# ld(h8sx):     -m h8300sxelf
 
 
        .include "testutils.inc"
        .include "testutils.inc"
 
 
        start
        start
 
 
        .data
        .data
byte_dest:      .byte   0xa5
byte_dest:      .byte   0xa5
        .align 2
        .align 2
word_dest:      .word   0xa5a5
word_dest:      .word   0xa5a5
        .align 4
        .align 4
long_dest:      .long   0xa5a5a5a5
long_dest:      .long   0xa5a5a5a5
 
 
        .text
        .text
 
 
shlr_b_reg8_1:
shlr_b_reg8_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  r0l             ; shift right logical by one
        shlr.b  r0l             ; shift right logical by one
;;;     .word   0x1108
;;;     .word   0x1108
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16 0xa552 r0   ; 1010 0101 -> 0101 0010
        test_h_gr16 0xa552 r0   ; 1010 0101 -> 0101 0010
.if (sim_cpu)
.if (sim_cpu)
        test_h_gr32 0xa5a5a552 er0
        test_h_gr32 0xa5a5a552 er0
.endif
.endif
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
shlr_b_ind_1:
shlr_b_ind_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  @er0    ; shift right logical by one, indirect
        shlr.b  @er0    ; shift right logical by one, indirect
;;;     .word   0x7d00
;;;     .word   0x7d00
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbind1
        beq     .Lbind1
        fail
        fail
.Lbind1:
.Lbind1:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_postinc_1:
shlr_b_postinc_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  @er0+   ; shift right logical by one, postinc
        shlr.b  @er0+   ; shift right logical by one, postinc
;;;     .word   0x0174
;;;     .word   0x0174
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest+1 er0
        test_h_gr32 byte_dest+1 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbpostinc1
        beq     .Lbpostinc1
        fail
        fail
.Lbpostinc1:
.Lbpostinc1:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_postdec_1:
shlr_b_postdec_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  @er0-   ; shift right logical by one, postdec
        shlr.b  @er0-   ; shift right logical by one, postdec
;;;     .word   0x0176
;;;     .word   0x0176
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-1 er0
        test_h_gr32 byte_dest-1 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbpostdec1
        beq     .Lbpostdec1
        fail
        fail
.Lbpostdec1:
.Lbpostdec1:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_preinc_1:
shlr_b_preinc_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-1, er0
        mov     #byte_dest-1, er0
        shlr.b  @+er0   ; shift right logical by one, preinc
        shlr.b  @+er0   ; shift right logical by one, preinc
;;;     .word   0x0175
;;;     .word   0x0175
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbpreinc1
        beq     .Lbpreinc1
        fail
        fail
.Lbpreinc1:
.Lbpreinc1:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_predec_1:
shlr_b_predec_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest+1, er0
        mov     #byte_dest+1, er0
        shlr.b  @-er0   ; shift right logical by one, predec
        shlr.b  @-er0   ; shift right logical by one, predec
;;;     .word   0x0177
;;;     .word   0x0177
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbpredec1
        beq     .Lbpredec1
        fail
        fail
.Lbpredec1:
.Lbpredec1:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp2_1:
shlr_b_disp2_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-2, er0
        mov     #byte_dest-2, er0
        shlr.b  @(2:2, er0)     ; shift right logical by one, disp2
        shlr.b  @(2:2, er0)     ; shift right logical by one, disp2
;;;     .word   0x0176
;;;     .word   0x0176
;;;     .word   0x6808
;;;     .word   0x6808
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-2 er0
        test_h_gr32 byte_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbdisp21
        beq     .Lbdisp21
        fail
        fail
.Lbdisp21:
.Lbdisp21:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp16_1:
shlr_b_disp16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-44, er0
        mov     #byte_dest-44, er0
        shlr.b  @(44:16, er0)   ; shift right logical by one, disp16
        shlr.b  @(44:16, er0)   ; shift right logical by one, disp16
;;;     .word   0x0174
;;;     .word   0x0174
;;;     .word   0x6e08
;;;     .word   0x6e08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-44 er0
        test_h_gr32 byte_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbdisp161
        beq     .Lbdisp161
        fail
        fail
.Lbdisp161:
.Lbdisp161:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp32_1:
shlr_b_disp32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-666, er0
        mov     #byte_dest-666, er0
        shlr.b  @(666:32, er0)  ; shift right logical by one, disp32
        shlr.b  @(666:32, er0)  ; shift right logical by one, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6a28
;;;     .word   0x6a28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-666 er0
        test_h_gr32 byte_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbdisp321
        beq     .Lbdisp321
        fail
        fail
.Lbdisp321:
.Lbdisp321:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_abs16_1:
shlr_b_abs16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  @byte_dest:16   ; shift right logical by one, abs16
        shlr.b  @byte_dest:16   ; shift right logical by one, abs16
;;;     .word   0x6a18
;;;     .word   0x6a18
;;;     .word   byte_dest
;;;     .word   byte_dest
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbabs161
        beq     .Lbabs161
        fail
        fail
.Lbabs161:
.Lbabs161:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_abs32_1:
shlr_b_abs32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  @byte_dest:32   ; shift right logical by one, abs32
        shlr.b  @byte_dest:32   ; shift right logical by one, abs32
;;;     .word   0x6a38
;;;     .word   0x6a38
;;;     .long   byte_dest
;;;     .long   byte_dest
;;;     .word   0x1100
;;;     .word   0x1100
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0101 0010
        ; 1010 0101 -> 0101 0010
        cmp.b   #0x52, @byte_dest
        cmp.b   #0x52, @byte_dest
        beq     .Lbabs321
        beq     .Lbabs321
        fail
        fail
.Lbabs321:
.Lbabs321:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
.endif
.endif
 
 
shlr_b_reg8_2:
shlr_b_reg8_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  #2, r0l         ; shift right logical by two
        shlr.b  #2, r0l         ; shift right logical by two
;;;     .word   0x1148
;;;     .word   0x1148
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        test_h_gr16 0xa529 r0   ; 1010 0101 -> 0010 1001
        test_h_gr16 0xa529 r0   ; 1010 0101 -> 0010 1001
.if (sim_cpu)
.if (sim_cpu)
        test_h_gr32 0xa5a5a529 er0
        test_h_gr32 0xa5a5a529 er0
.endif
.endif
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
shlr_b_ind_2:
shlr_b_ind_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  #2, @er0        ; shift right logical by two, indirect
        shlr.b  #2, @er0        ; shift right logical by two, indirect
;;;     .word   0x7d00
;;;     .word   0x7d00
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbind2
        beq     .Lbind2
        fail
        fail
.Lbind2:
.Lbind2:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_postinc_2:
shlr_b_postinc_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  #2, @er0+       ; shift right logical by two, postinc
        shlr.b  #2, @er0+       ; shift right logical by two, postinc
;;;     .word   0x0174
;;;     .word   0x0174
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest+1 er0
        test_h_gr32 byte_dest+1 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbpostinc2
        beq     .Lbpostinc2
        fail
        fail
.Lbpostinc2:
.Lbpostinc2:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_postdec_2:
shlr_b_postdec_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  #2, @er0-       ; shift right logical by two, postdec
        shlr.b  #2, @er0-       ; shift right logical by two, postdec
;;;     .word   0x0176
;;;     .word   0x0176
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-1 er0
        test_h_gr32 byte_dest-1 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbpostdec2
        beq     .Lbpostdec2
        fail
        fail
.Lbpostdec2:
.Lbpostdec2:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_preinc_2:
shlr_b_preinc_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-1, er0
        mov     #byte_dest-1, er0
        shlr.b  #2, @+er0       ; shift right logical by two, preinc
        shlr.b  #2, @+er0       ; shift right logical by two, preinc
;;;     .word   0x0175
;;;     .word   0x0175
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbpreinc2
        beq     .Lbpreinc2
        fail
        fail
.Lbpreinc2:
.Lbpreinc2:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_predec_2:
shlr_b_predec_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest+1, er0
        mov     #byte_dest+1, er0
        shlr.b  #2, @-er0       ; shift right logical by two, predec
        shlr.b  #2, @-er0       ; shift right logical by two, predec
;;;     .word   0x0177
;;;     .word   0x0177
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbpredec2
        beq     .Lbpredec2
        fail
        fail
.Lbpredec2:
.Lbpredec2:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp2_2:
shlr_b_disp2_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-2, er0
        mov     #byte_dest-2, er0
        shlr.b  #2, @(2:2, er0) ; shift right logical by two, disp2
        shlr.b  #2, @(2:2, er0) ; shift right logical by two, disp2
;;;     .word   0x0176
;;;     .word   0x0176
;;;     .word   0x6808
;;;     .word   0x6808
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-2 er0
        test_h_gr32 byte_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbdisp22
        beq     .Lbdisp22
        fail
        fail
.Lbdisp22:
.Lbdisp22:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp16_2:
shlr_b_disp16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-44, er0
        mov     #byte_dest-44, er0
        shlr.b  #2, @(44:16, er0)       ; shift right logical by two, disp16
        shlr.b  #2, @(44:16, er0)       ; shift right logical by two, disp16
;;;     .word   0x0174
;;;     .word   0x0174
;;;     .word   0x6e08
;;;     .word   0x6e08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-44 er0
        test_h_gr32 byte_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbdisp162
        beq     .Lbdisp162
        fail
        fail
.Lbdisp162:
.Lbdisp162:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp32_2:
shlr_b_disp32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-666, er0
        mov     #byte_dest-666, er0
        shlr.b  #2, @(666:32, er0)      ; shift right logical by two, disp32
        shlr.b  #2, @(666:32, er0)      ; shift right logical by two, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6a28
;;;     .word   0x6a28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-666 er0
        test_h_gr32 byte_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbdisp322
        beq     .Lbdisp322
        fail
        fail
.Lbdisp322:
.Lbdisp322:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_abs16_2:
shlr_b_abs16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  #2, @byte_dest:16       ; shift right logical by two, abs16
        shlr.b  #2, @byte_dest:16       ; shift right logical by two, abs16
;;;     .word   0x6a18
;;;     .word   0x6a18
;;;     .word   byte_dest
;;;     .word   byte_dest
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbabs162
        beq     .Lbabs162
        fail
        fail
.Lbabs162:
.Lbabs162:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_abs32_2:
shlr_b_abs32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  #2, @byte_dest:32       ; shift right logical by two, abs32
        shlr.b  #2, @byte_dest:32       ; shift right logical by two, abs32
;;;     .word   0x6a38
;;;     .word   0x6a38
;;;     .long   byte_dest
;;;     .long   byte_dest
;;;     .word   0x1140
;;;     .word   0x1140
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0010 1001
        ; 1010 0101 -> 0010 1001
        cmp.b   #0x29, @byte_dest
        cmp.b   #0x29, @byte_dest
        beq     .Lbabs322
        beq     .Lbabs322
        fail
        fail
.Lbabs322:
.Lbabs322:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_reg8_4:
shlr_b_reg8_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  #4, r0l         ; shift right logical by four
        shlr.b  #4, r0l         ; shift right logical by four
;;;     .word   0x11a8
;;;     .word   0x11a8
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16 0xa50a r0   ; 1010 0101 -> 0000 1010 
        test_h_gr16 0xa50a r0   ; 1010 0101 -> 0000 1010 
        test_h_gr32 0xa5a5a50a er0
        test_h_gr32 0xa5a5a50a er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_b_reg8_reg8:
shlr_b_reg8_reg8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #5, r0h
        mov     #5, r0h
        shlr.b  r0h, r0l        ; shift right logical by register value
        shlr.b  r0h, r0l        ; shift right logical by register value
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16 0x0505 r0   ; 1010 0101 -> 0000 0101
        test_h_gr16 0x0505 r0   ; 1010 0101 -> 0000 0101
        test_h_gr32 0xa5a50505 er0
        test_h_gr32 0xa5a50505 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_b_ind_4:
shlr_b_ind_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  #4, @er0        ; shift right logical by four, indirect
        shlr.b  #4, @er0        ; shift right logical by four, indirect
;;;     .word   0x7d00
;;;     .word   0x7d00
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbind4
        beq     .Lbind4
        fail
        fail
.Lbind4:
.Lbind4:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_postinc_4:
shlr_b_postinc_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  #4, @er0+       ; shift right logical by four, postinc
        shlr.b  #4, @er0+       ; shift right logical by four, postinc
;;;     .word   0x0174
;;;     .word   0x0174
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest+1 er0
        test_h_gr32 byte_dest+1 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbpostinc4
        beq     .Lbpostinc4
        fail
        fail
.Lbpostinc4:
.Lbpostinc4:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_postdec_4:
shlr_b_postdec_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest, er0
        mov     #byte_dest, er0
        shlr.b  #4, @er0-       ; shift right logical by four, postdec
        shlr.b  #4, @er0-       ; shift right logical by four, postdec
;;;     .word   0x0176
;;;     .word   0x0176
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-1 er0
        test_h_gr32 byte_dest-1 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbpostdec4
        beq     .Lbpostdec4
        fail
        fail
.Lbpostdec4:
.Lbpostdec4:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_preinc_4:
shlr_b_preinc_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-1, er0
        mov     #byte_dest-1, er0
        shlr.b  #4, @+er0       ; shift right logical by four, preinc
        shlr.b  #4, @+er0       ; shift right logical by four, preinc
;;;     .word   0x0175
;;;     .word   0x0175
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbpreinc4
        beq     .Lbpreinc4
        fail
        fail
.Lbpreinc4:
.Lbpreinc4:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_predec_4:
shlr_b_predec_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest+1, er0
        mov     #byte_dest+1, er0
        shlr.b  #4, @-er0       ; shift right logical by four, predec
        shlr.b  #4, @-er0       ; shift right logical by four, predec
;;;     .word   0x0177
;;;     .word   0x0177
;;;     .word   0x6c08
;;;     .word   0x6c08
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest er0
        test_h_gr32 byte_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbpredec4
        beq     .Lbpredec4
        fail
        fail
.Lbpredec4:
.Lbpredec4:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp2_4:
shlr_b_disp2_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-2, er0
        mov     #byte_dest-2, er0
        shlr.b  #4, @(2:2, er0) ; shift right logical by four, disp2
        shlr.b  #4, @(2:2, er0) ; shift right logical by four, disp2
;;;     .word   0x0176
;;;     .word   0x0176
;;;     .word   0x6808
;;;     .word   0x6808
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-2 er0
        test_h_gr32 byte_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbdisp24
        beq     .Lbdisp24
        fail
        fail
.Lbdisp24:
.Lbdisp24:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp16_4:
shlr_b_disp16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-44, er0
        mov     #byte_dest-44, er0
        shlr.b  #4, @(44:16, er0)       ; shift right logical by four, disp16
        shlr.b  #4, @(44:16, er0)       ; shift right logical by four, disp16
;;;     .word   0x0174
;;;     .word   0x0174
;;;     .word   0x6e08
;;;     .word   0x6e08
;;;     .word   44
;;;     .word   44
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-44 er0
        test_h_gr32 byte_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbdisp164
        beq     .Lbdisp164
        fail
        fail
.Lbdisp164:
.Lbdisp164:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_disp32_4:
shlr_b_disp32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #byte_dest-666, er0
        mov     #byte_dest-666, er0
        shlr.b  #4, @(666:32, er0)      ; shift right logical by four, disp32
        shlr.b  #4, @(666:32, er0)      ; shift right logical by four, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6a28
;;;     .word   0x6a28
;;;     .long   666
;;;     .long   666
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 byte_dest-666 er0
        test_h_gr32 byte_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbdisp324
        beq     .Lbdisp324
        fail
        fail
.Lbdisp324:
.Lbdisp324:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_abs16_4:
shlr_b_abs16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  #4, @byte_dest:16       ; shift right logical by four, abs16
        shlr.b  #4, @byte_dest:16       ; shift right logical by four, abs16
;;;     .word   0x6a18
;;;     .word   0x6a18
;;;     .word   byte_dest
;;;     .word   byte_dest
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbabs164
        beq     .Lbabs164
        fail
        fail
.Lbabs164:
.Lbabs164:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
 
 
shlr_b_abs32_4:
shlr_b_abs32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.b  #4, @byte_dest:32       ; shift right logical by four, abs32
        shlr.b  #4, @byte_dest:32       ; shift right logical by four, abs32
;;;     .word   0x6a38
;;;     .word   0x6a38
;;;     .long   byte_dest
;;;     .long   byte_dest
;;;     .word   0x11a0
;;;     .word   0x11a0
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 -> 0000 1010 
        ; 1010 0101 -> 0000 1010 
        cmp.b   #0x0a, @byte_dest
        cmp.b   #0x0a, @byte_dest
        beq     .Lbabs324
        beq     .Lbabs324
        fail
        fail
.Lbabs324:
.Lbabs324:
        mov.b   #0xa5, @byte_dest
        mov.b   #0xa5, @byte_dest
.endif
.endif
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
shlr_w_imm5_1:
shlr_w_imm5_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #15:5, r0       ; shift right logical by 5-bit immediate
        shlr.w  #15:5, r0       ; shift right logical by 5-bit immediate
;;;     .word   0x038f
;;;     .word   0x038f
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        ; 1010 0101 1010 0101 -> 0000 0000 0000 0001
        ; 1010 0101 1010 0101 -> 0000 0000 0000 0001
        test_h_gr32 0xa5a50001 er0
        test_h_gr32 0xa5a50001 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
.endif
.endif
 
 
.if (sim_cpu)                   ; Not available in h8300 mode
.if (sim_cpu)                   ; Not available in h8300 mode
shlr_w_reg16_1:
shlr_w_reg16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  r0              ; shift right logical by one
        shlr.w  r0              ; shift right logical by one
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        test_h_gr16 0x52d2 r0   ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
        test_h_gr16 0x52d2 r0   ; 1010 0101 1010 0101 -> 0101 0010 1101 0010
        test_h_gr32 0xa5a552d2 er0
        test_h_gr32 0xa5a552d2 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
shlr_w_ind_1:
shlr_w_ind_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  @er0    ; shift right logical by one, indirect
        shlr.w  @er0    ; shift right logical by one, indirect
;;;     .word   0x7d80
;;;     .word   0x7d80
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwind1
        beq     .Lwind1
        fail
        fail
.Lwind1:
.Lwind1:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postinc_1:
shlr_w_postinc_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  @er0+   ; shift right logical by one, postinc
        shlr.w  @er0+   ; shift right logical by one, postinc
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest+2 er0
        test_h_gr32 word_dest+2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwpostinc1
        beq     .Lwpostinc1
        fail
        fail
.Lwpostinc1:
.Lwpostinc1:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postdec_1:
shlr_w_postdec_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  @er0-   ; shift right logical by one, postdec
        shlr.w  @er0-   ; shift right logical by one, postdec
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-2 er0
        test_h_gr32 word_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwpostdec1
        beq     .Lwpostdec1
        fail
        fail
.Lwpostdec1:
.Lwpostdec1:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_preinc_1:
shlr_w_preinc_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-2, er0
        mov     #word_dest-2, er0
        shlr.w  @+er0   ; shift right logical by one, preinc
        shlr.w  @+er0   ; shift right logical by one, preinc
;;;     .word   0x0155
;;;     .word   0x0155
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwpreinc1
        beq     .Lwpreinc1
        fail
        fail
.Lwpreinc1:
.Lwpreinc1:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_predec_1:
shlr_w_predec_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest+2, er0
        mov     #word_dest+2, er0
        shlr.w  @-er0   ; shift right logical by one, predec
        shlr.w  @-er0   ; shift right logical by one, predec
;;;     .word   0x0157
;;;     .word   0x0157
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwpredec1
        beq     .Lwpredec1
        fail
        fail
.Lwpredec1:
.Lwpredec1:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp2_1:
shlr_w_disp2_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-4, er0
        mov     #word_dest-4, er0
        shlr.w  @(4:2, er0)     ; shift right logical by one, disp2
        shlr.w  @(4:2, er0)     ; shift right logical by one, disp2
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-4 er0
        test_h_gr32 word_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwdisp21
        beq     .Lwdisp21
        fail
        fail
.Lwdisp21:
.Lwdisp21:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp16_1:
shlr_w_disp16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-44, er0
        mov     #word_dest-44, er0
        shlr.w  @(44:16, er0)   ; shift right logical by one, disp16
        shlr.w  @(44:16, er0)   ; shift right logical by one, disp16
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-44 er0
        test_h_gr32 word_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwdisp161
        beq     .Lwdisp161
        fail
        fail
.Lwdisp161:
.Lwdisp161:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp32_1:
shlr_w_disp32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-666, er0
        mov     #word_dest-666, er0
        shlr.w  @(666:32, er0)  ; shift right logical by one, disp32
        shlr.w  @(666:32, er0)  ; shift right logical by one, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-666 er0
        test_h_gr32 word_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwdisp321
        beq     .Lwdisp321
        fail
        fail
.Lwdisp321:
.Lwdisp321:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs16_1:
shlr_w_abs16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  @word_dest:16   ; shift right logical by one, abs16
        shlr.w  @word_dest:16   ; shift right logical by one, abs16
;;;     .word   0x6b18
;;;     .word   0x6b18
;;;     .word   word_dest
;;;     .word   word_dest
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwabs161
        beq     .Lwabs161
        fail
        fail
.Lwabs161:
.Lwabs161:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs32_1:
shlr_w_abs32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  @word_dest:32   ; shift right logical by one, abs32
        shlr.w  @word_dest:32   ; shift right logical by one, abs32
;;;     .word   0x6b38
;;;     .word   0x6b38
;;;     .long   word_dest
;;;     .long   word_dest
;;;     .word   0x1110
;;;     .word   0x1110
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        ; 1010 0101 1010 0101 -> 0101 0010 1101 0010 
        cmp.w   #0x52d2, @word_dest
        cmp.w   #0x52d2, @word_dest
        beq     .Lwabs321
        beq     .Lwabs321
        fail
        fail
.Lwabs321:
.Lwabs321:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
.endif
.endif
 
 
shlr_w_reg16_2:
shlr_w_reg16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #2, r0          ; shift right logical by two
        shlr.w  #2, r0          ; shift right logical by two
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16 0x2969 r0   ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
        test_h_gr16 0x2969 r0   ; 1010 0101 1010 0101 -> 0010 1001 0110 1001
        test_h_gr32 0xa5a52969 er0
        test_h_gr32 0xa5a52969 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
shlr_w_ind_2:
shlr_w_ind_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #2, @er0        ; shift right logical by two, indirect
        shlr.w  #2, @er0        ; shift right logical by two, indirect
;;;     .word   0x7d80
;;;     .word   0x7d80
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwind2
        beq     .Lwind2
        fail
        fail
.Lwind2:
.Lwind2:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postinc_2:
shlr_w_postinc_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #2, @er0+       ; shift right logical by two, postinc
        shlr.w  #2, @er0+       ; shift right logical by two, postinc
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest+2 er0
        test_h_gr32 word_dest+2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwpostinc2
        beq     .Lwpostinc2
        fail
        fail
.Lwpostinc2:
.Lwpostinc2:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postdec_2:
shlr_w_postdec_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #2, @er0-       ; shift right logical by two, postdec
        shlr.w  #2, @er0-       ; shift right logical by two, postdec
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-2 er0
        test_h_gr32 word_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwpostdec2
        beq     .Lwpostdec2
        fail
        fail
.Lwpostdec2:
.Lwpostdec2:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_preinc_2:
shlr_w_preinc_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-2, er0
        mov     #word_dest-2, er0
        shlr.w  #2, @+er0       ; shift right logical by two, preinc
        shlr.w  #2, @+er0       ; shift right logical by two, preinc
;;;     .word   0x0155
;;;     .word   0x0155
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwpreinc2
        beq     .Lwpreinc2
        fail
        fail
.Lwpreinc2:
.Lwpreinc2:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_predec_2:
shlr_w_predec_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest+2, er0
        mov     #word_dest+2, er0
        shlr.w  #2, @-er0       ; shift right logical by two, predec
        shlr.w  #2, @-er0       ; shift right logical by two, predec
;;;     .word   0x0157
;;;     .word   0x0157
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwpredec2
        beq     .Lwpredec2
        fail
        fail
.Lwpredec2:
.Lwpredec2:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp2_2:
shlr_w_disp2_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-4, er0
        mov     #word_dest-4, er0
        shlr.w  #2, @(4:2, er0) ; shift right logical by two, disp2
        shlr.w  #2, @(4:2, er0) ; shift right logical by two, disp2
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-4 er0
        test_h_gr32 word_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwdisp22
        beq     .Lwdisp22
        fail
        fail
.Lwdisp22:
.Lwdisp22:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp16_2:
shlr_w_disp16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-44, er0
        mov     #word_dest-44, er0
        shlr.w  #2, @(44:16, er0)       ; shift right logical by two, disp16
        shlr.w  #2, @(44:16, er0)       ; shift right logical by two, disp16
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-44 er0
        test_h_gr32 word_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwdisp162
        beq     .Lwdisp162
        fail
        fail
.Lwdisp162:
.Lwdisp162:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp32_2:
shlr_w_disp32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-666, er0
        mov     #word_dest-666, er0
        shlr.w  #2, @(666:32, er0)      ; shift right logical by two, disp32
        shlr.w  #2, @(666:32, er0)      ; shift right logical by two, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-666 er0
        test_h_gr32 word_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwdisp322
        beq     .Lwdisp322
        fail
        fail
.Lwdisp322:
.Lwdisp322:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs16_2:
shlr_w_abs16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #2, @word_dest:16       ; shift right logical by two, abs16
        shlr.w  #2, @word_dest:16       ; shift right logical by two, abs16
;;;     .word   0x6b18
;;;     .word   0x6b18
;;;     .word   word_dest
;;;     .word   word_dest
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwabs162
        beq     .Lwabs162
        fail
        fail
.Lwabs162:
.Lwabs162:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs32_2:
shlr_w_abs32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #2, @word_dest:32       ; shift right logical by two, abs32
        shlr.w  #2, @word_dest:32       ; shift right logical by two, abs32
;;;     .word   0x6b38
;;;     .word   0x6b38
;;;     .long   word_dest
;;;     .long   word_dest
;;;     .word   0x1150
;;;     .word   0x1150
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        ; 1010 0101 1010 0101 -> 0010 1001 0110 1001  
        cmp.w   #0x2969, @word_dest
        cmp.w   #0x2969, @word_dest
        beq     .Lwabs322
        beq     .Lwabs322
        fail
        fail
.Lwabs322:
.Lwabs322:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_reg16_4:
shlr_w_reg16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #4, r0          ; shift right logical by four
        shlr.w  #4, r0          ; shift right logical by four
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16 0x0a5a r0   ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        test_h_gr16 0x0a5a r0   ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        test_h_gr32 0xa5a50a5a er0
        test_h_gr32 0xa5a50a5a er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_w_reg16_reg8:
shlr_w_reg16_reg8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #5, r1l
        mov     #5, r1l
        shlr.w  r1l, r0         ; shift right logical by register value
        shlr.w  r1l, r0         ; shift right logical by register value
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16  0x052d r0  ; 1010 0101 1010 0101 -> 0000 0101 0010 1101
        test_h_gr16  0x052d r0  ; 1010 0101 1010 0101 -> 0000 0101 0010 1101
        test_h_gr32  0xa5a5052d er0
        test_h_gr32  0xa5a5052d er0
        test_h_gr32  0xa5a5a505 er1
        test_h_gr32  0xa5a5a505 er1
        test_gr_a5a5 2          ; Make sure other general regs not disturbed
        test_gr_a5a5 2          ; Make sure other general regs not disturbed
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_w_ind_4:
shlr_w_ind_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #4, @er0        ; shift right logical by four, indirect
        shlr.w  #4, @er0        ; shift right logical by four, indirect
;;;     .word   0x7d80
;;;     .word   0x7d80
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwind4
        beq     .Lwind4
        fail
        fail
.Lwind4:
.Lwind4:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postinc_4:
shlr_w_postinc_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #4, @er0+       ; shift right logical by four, postinc
        shlr.w  #4, @er0+       ; shift right logical by four, postinc
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest+2 er0
        test_h_gr32 word_dest+2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwpostinc4
        beq     .Lwpostinc4
        fail
        fail
.Lwpostinc4:
.Lwpostinc4:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postdec_4:
shlr_w_postdec_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #4, @er0-       ; shift right logical by four, postdec
        shlr.w  #4, @er0-       ; shift right logical by four, postdec
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-2 er0
        test_h_gr32 word_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwpostdec4
        beq     .Lwpostdec4
        fail
        fail
.Lwpostdec4:
.Lwpostdec4:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_preinc_4:
shlr_w_preinc_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-2, er0
        mov     #word_dest-2, er0
        shlr.w  #4, @+er0       ; shift right logical by four, preinc
        shlr.w  #4, @+er0       ; shift right logical by four, preinc
;;;     .word   0x0155
;;;     .word   0x0155
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwpreinc4
        beq     .Lwpreinc4
        fail
        fail
.Lwpreinc4:
.Lwpreinc4:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_predec_4:
shlr_w_predec_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest+2, er0
        mov     #word_dest+2, er0
        shlr.w  #4, @-er0       ; shift right logical by four, predec
        shlr.w  #4, @-er0       ; shift right logical by four, predec
;;;     .word   0x0157
;;;     .word   0x0157
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwpredec4
        beq     .Lwpredec4
        fail
        fail
.Lwpredec4:
.Lwpredec4:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp2_4:
shlr_w_disp2_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-4, er0
        mov     #word_dest-4, er0
        shlr.w  #4, @(4:2, er0) ; shift right logical by four, disp2
        shlr.w  #4, @(4:2, er0) ; shift right logical by four, disp2
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-4 er0
        test_h_gr32 word_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwdisp24
        beq     .Lwdisp24
        fail
        fail
.Lwdisp24:
.Lwdisp24:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp16_4:
shlr_w_disp16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-44, er0
        mov     #word_dest-44, er0
        shlr.w  #4, @(44:16, er0)       ; shift right logical by four, disp16
        shlr.w  #4, @(44:16, er0)       ; shift right logical by four, disp16
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-44 er0
        test_h_gr32 word_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwdisp164
        beq     .Lwdisp164
        fail
        fail
.Lwdisp164:
.Lwdisp164:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp32_4:
shlr_w_disp32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-666, er0
        mov     #word_dest-666, er0
        shlr.w  #4, @(666:32, er0)      ; shift right logical by four, disp32
        shlr.w  #4, @(666:32, er0)      ; shift right logical by four, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-666 er0
        test_h_gr32 word_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwdisp324
        beq     .Lwdisp324
        fail
        fail
.Lwdisp324:
.Lwdisp324:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs16_4:
shlr_w_abs16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #4, @word_dest:16       ; shift right logical by four, abs16
        shlr.w  #4, @word_dest:16       ; shift right logical by four, abs16
;;;     .word   0x6b18
;;;     .word   0x6b18
;;;     .word   word_dest
;;;     .word   word_dest
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwabs164
        beq     .Lwabs164
        fail
        fail
.Lwabs164:
.Lwabs164:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs32_4:
shlr_w_abs32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #4, @word_dest:32       ; shift right logical by four, abs32
        shlr.w  #4, @word_dest:32       ; shift right logical by four, abs32
;;;     .word   0x6b38
;;;     .word   0x6b38
;;;     .long   word_dest
;;;     .long   word_dest
;;;     .word   0x1120
;;;     .word   0x1120
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        ; 1010 0101 1010 0101 -> 0000 1010 0101 1010 
        cmp.w   #0x0a5a, @word_dest
        cmp.w   #0x0a5a, @word_dest
        beq     .Lwabs324
        beq     .Lwabs324
        fail
        fail
.Lwabs324:
.Lwabs324:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_reg16_8:
shlr_w_reg16_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #8, r0          ; shift right logical by eight
        shlr.w  #8, r0          ; shift right logical by eight
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr16 0x00a5 r0   ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        test_h_gr16 0x00a5 r0   ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        test_h_gr32 0xa5a500a5 er0
        test_h_gr32 0xa5a500a5 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_w_ind_8:
shlr_w_ind_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #8, @er0        ; shift right logical by eight, indirect
        shlr.w  #8, @er0        ; shift right logical by eight, indirect
;;;     .word   0x7d80
;;;     .word   0x7d80
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwind8
        beq     .Lwind8
        fail
        fail
.Lwind8:
.Lwind8:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postinc_8:
shlr_w_postinc_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #8, @er0+       ; shift right logical by eight, postinc
        shlr.w  #8, @er0+       ; shift right logical by eight, postinc
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest+2 er0
        test_h_gr32 word_dest+2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwpostinc8
        beq     .Lwpostinc8
        fail
        fail
.Lwpostinc8:
.Lwpostinc8:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_postdec_8:
shlr_w_postdec_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest, er0
        mov     #word_dest, er0
        shlr.w  #8, @er0-       ; shift right logical by eight, postdec
        shlr.w  #8, @er0-       ; shift right logical by eight, postdec
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-2 er0
        test_h_gr32 word_dest-2 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwpostdec8
        beq     .Lwpostdec8
        fail
        fail
.Lwpostdec8:
.Lwpostdec8:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_preinc_8:
shlr_w_preinc_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-2, er0
        mov     #word_dest-2, er0
        shlr.w  #8, @+er0       ; shift right logical by eight, preinc
        shlr.w  #8, @+er0       ; shift right logical by eight, preinc
;;;     .word   0x0155
;;;     .word   0x0155
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwpreinc8
        beq     .Lwpreinc8
        fail
        fail
.Lwpreinc8:
.Lwpreinc8:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_predec_8:
shlr_w_predec_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest+2, er0
        mov     #word_dest+2, er0
        shlr.w  #8, @-er0       ; shift right logical by eight, predec
        shlr.w  #8, @-er0       ; shift right logical by eight, predec
;;;     .word   0x0157
;;;     .word   0x0157
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest er0
        test_h_gr32 word_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwpredec8
        beq     .Lwpredec8
        fail
        fail
.Lwpredec8:
.Lwpredec8:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp2_8:
shlr_w_disp2_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-4, er0
        mov     #word_dest-4, er0
        shlr.w  #8, @(4:2, er0) ; shift right logical by eight, disp2
        shlr.w  #8, @(4:2, er0) ; shift right logical by eight, disp2
;;;     .word   0x0156
;;;     .word   0x0156
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-4 er0
        test_h_gr32 word_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwdisp28
        beq     .Lwdisp28
        fail
        fail
.Lwdisp28:
.Lwdisp28:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp16_8:
shlr_w_disp16_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-44, er0
        mov     #word_dest-44, er0
        shlr.w  #8, @(44:16, er0)       ; shift right logical by eight, disp16
        shlr.w  #8, @(44:16, er0)       ; shift right logical by eight, disp16
;;;     .word   0x0154
;;;     .word   0x0154
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-44 er0
        test_h_gr32 word_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwdisp168
        beq     .Lwdisp168
        fail
        fail
.Lwdisp168:
.Lwdisp168:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_disp32_8:
shlr_w_disp32_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #word_dest-666, er0
        mov     #word_dest-666, er0
        shlr.w  #8, @(666:32, er0)      ; shift right logical by eight, disp32
        shlr.w  #8, @(666:32, er0)      ; shift right logical by eight, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 word_dest-666 er0
        test_h_gr32 word_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwdisp328
        beq     .Lwdisp328
        fail
        fail
.Lwdisp328:
.Lwdisp328:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs16_8:
shlr_w_abs16_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #8, @word_dest:16       ; shift right logical by eight, abs16
        shlr.w  #8, @word_dest:16       ; shift right logical by eight, abs16
;;;     .word   0x6b18
;;;     .word   0x6b18
;;;     .word   word_dest
;;;     .word   word_dest
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwabs168
        beq     .Lwabs168
        fail
        fail
.Lwabs168:
.Lwabs168:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_w_abs32_8:
shlr_w_abs32_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.w  #8, @word_dest:32       ; shift right logical by eight, abs32
        shlr.w  #8, @word_dest:32       ; shift right logical by eight, abs32
;;;     .word   0x6b38
;;;     .word   0x6b38
;;;     .long   word_dest
;;;     .long   word_dest
;;;     .word   0x1160
;;;     .word   0x1160
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        ; 1010 0101 1010 0101 -> 0000 0000 1010 0101 
        cmp.w   #0x00a5, @word_dest
        cmp.w   #0x00a5, @word_dest
        beq     .Lwabs328
        beq     .Lwabs328
        fail
        fail
.Lwabs328:
.Lwabs328:
        mov.w   #0xa5a5, @word_dest
        mov.w   #0xa5a5, @word_dest
 
 
shlr_l_imm5_1:
shlr_l_imm5_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #31:5, er0      ; shift right logical by 5-bit immediate
        shlr.l  #31:5, er0      ; shift right logical by 5-bit immediate
;;;     .word   0x0399
;;;     .word   0x0399
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        ; 1010 0101 1010 0101 1010 0101 1010 0101 
        ; 1010 0101 1010 0101 1010 0101 1010 0101 
        ; -> 0000 0000 0000 0000 0000 0000 0000 0001
        ; -> 0000 0000 0000 0000 0000 0000 0000 0001
        test_h_gr32 0x1 er0
        test_h_gr32 0x1 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
.endif
.endif
 
 
shlr_l_reg32_1:
shlr_l_reg32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  er0             ; shift right logical by one, register
        shlr.l  er0             ; shift right logical by one, register
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        ; 1010 0101 1010 0101 1010 0101 1010 0101 
        ; 1010 0101 1010 0101 1010 0101 1010 0101 
        ; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ; -> 0101 0010 1101 0010 1101 0010 1101 0010
        test_h_gr32 0x52d2d2d2 er0
        test_h_gr32 0x52d2d2d2 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
shlr_l_ind_1:
shlr_l_ind_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  @er0    ; shift right logical by one, indirect
        shlr.l  @er0    ; shift right logical by one, indirect
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llind1
        beq     .Llind1
        fail
        fail
.Llind1:
.Llind1:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postinc_1:
shlr_l_postinc_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  @er0+   ; shift right logical by one, postinc
        shlr.l  @er0+   ; shift right logical by one, postinc
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest+4 er0
        test_h_gr32 long_dest+4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llpostinc1
        beq     .Llpostinc1
        fail
        fail
.Llpostinc1:
.Llpostinc1:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postdec_1:
shlr_l_postdec_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  @er0-   ; shift right logical by one, postdec
        shlr.l  @er0-   ; shift right logical by one, postdec
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-4 er0
        test_h_gr32 long_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llpostdec1
        beq     .Llpostdec1
        fail
        fail
.Llpostdec1:
.Llpostdec1:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_preinc_1:
shlr_l_preinc_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-4, er0
        mov     #long_dest-4, er0
        shlr.l  @+er0   ; shift right logical by one, preinc
        shlr.l  @+er0   ; shift right logical by one, preinc
;;;     .word   0x0105
;;;     .word   0x0105
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llpreinc1
        beq     .Llpreinc1
        fail
        fail
.Llpreinc1:
.Llpreinc1:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_predec_1:
shlr_l_predec_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest+4, er0
        mov     #long_dest+4, er0
        shlr.l  @-er0   ; shift right logical by one, predec
        shlr.l  @-er0   ; shift right logical by one, predec
;;;     .word   0x0107
;;;     .word   0x0107
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llpredec1
        beq     .Llpredec1
        fail
        fail
.Llpredec1:
.Llpredec1:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp2_1:
shlr_l_disp2_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-8, er0
        mov     #long_dest-8, er0
        shlr.l  @(8:2, er0)     ; shift right logical by one, disp2
        shlr.l  @(8:2, er0)     ; shift right logical by one, disp2
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-8 er0
        test_h_gr32 long_dest-8 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Lldisp21
        beq     .Lldisp21
        fail
        fail
.Lldisp21:
.Lldisp21:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp16_1:
shlr_l_disp16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-44, er0
        mov     #long_dest-44, er0
        shlr.l  @(44:16, er0)   ; shift right logical by one, disp16
        shlr.l  @(44:16, er0)   ; shift right logical by one, disp16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-44 er0
        test_h_gr32 long_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Lldisp161
        beq     .Lldisp161
        fail
        fail
.Lldisp161:
.Lldisp161:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp32_1:
shlr_l_disp32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-666, er0
        mov     #long_dest-666, er0
        shlr.l  @(666:32, er0)  ; shift right logical by one, disp32
        shlr.l  @(666:32, er0)  ; shift right logical by one, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-666 er0
        test_h_gr32 long_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Lldisp321
        beq     .Lldisp321
        fail
        fail
.Lldisp321:
.Lldisp321:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs16_1:
shlr_l_abs16_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  @long_dest:16   ; shift right logical by one, abs16
        shlr.l  @long_dest:16   ; shift right logical by one, abs16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b08
;;;     .word   0x6b08
;;;     .word   long_dest
;;;     .word   long_dest
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llabs161
        beq     .Llabs161
        fail
        fail
.Llabs161:
.Llabs161:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs32_1:
shlr_l_abs32_1:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  @long_dest:32   ; shift right logical by one, abs32
        shlr.l  @long_dest:32   ; shift right logical by one, abs32
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   long_dest
;;;     .long   long_dest
;;;     .word   0x1130
;;;     .word   0x1130
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        ;; -> 0101 0010 1101 0010 1101 0010 1101 0010
        cmp.l   #0x52d2d2d2, @long_dest
        cmp.l   #0x52d2d2d2, @long_dest
        beq     .Llabs321
        beq     .Llabs321
        fail
        fail
.Llabs321:
.Llabs321:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
.endif
.endif
 
 
shlr_l_reg32_2:
shlr_l_reg32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #2, er0         ; shift right logical by two, register
        shlr.l  #2, er0         ; shift right logical by two, register
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ; -> 0010 1001 0110 1001 0110 1001 0110 1001
        test_h_gr32 0x29696969 er0
        test_h_gr32 0x29696969 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
 
 
shlr_l_ind_2:
shlr_l_ind_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #2, @er0        ; shift right logical by two, indirect
        shlr.l  #2, @er0        ; shift right logical by two, indirect
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llind2
        beq     .Llind2
        fail
        fail
.Llind2:
.Llind2:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postinc_2:
shlr_l_postinc_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #2, @er0+       ; shift right logical by two, postinc
        shlr.l  #2, @er0+       ; shift right logical by two, postinc
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest+4 er0
        test_h_gr32 long_dest+4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llpostinc2
        beq     .Llpostinc2
        fail
        fail
.Llpostinc2:
.Llpostinc2:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postdec_2:
shlr_l_postdec_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #2, @er0-       ; shift right logical by two, postdec
        shlr.l  #2, @er0-       ; shift right logical by two, postdec
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-4 er0
        test_h_gr32 long_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llpostdec2
        beq     .Llpostdec2
        fail
        fail
.Llpostdec2:
.Llpostdec2:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_preinc_2:
shlr_l_preinc_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-4, er0
        mov     #long_dest-4, er0
        shlr.l  #2, @+er0       ; shift right logical by two, preinc
        shlr.l  #2, @+er0       ; shift right logical by two, preinc
;;;     .word   0x0105
;;;     .word   0x0105
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llpreinc2
        beq     .Llpreinc2
        fail
        fail
.Llpreinc2:
.Llpreinc2:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_predec_2:
shlr_l_predec_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest+4, er0
        mov     #long_dest+4, er0
        shlr.l  #2, @-er0       ; shift right logical by two, predec
        shlr.l  #2, @-er0       ; shift right logical by two, predec
;;;     .word   0x0107
;;;     .word   0x0107
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llpredec2
        beq     .Llpredec2
        fail
        fail
.Llpredec2:
.Llpredec2:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp2_2:
shlr_l_disp2_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-8, er0
        mov     #long_dest-8, er0
        shlr.l  #2, @(8:2, er0) ; shift right logical by two, disp2
        shlr.l  #2, @(8:2, er0) ; shift right logical by two, disp2
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-8 er0
        test_h_gr32 long_dest-8 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Lldisp22
        beq     .Lldisp22
        fail
        fail
.Lldisp22:
.Lldisp22:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp16_2:
shlr_l_disp16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-44, er0
        mov     #long_dest-44, er0
        shlr.l  #2, @(44:16, er0)       ; shift right logical by two, disp16
        shlr.l  #2, @(44:16, er0)       ; shift right logical by two, disp16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-44 er0
        test_h_gr32 long_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Lldisp162
        beq     .Lldisp162
        fail
        fail
.Lldisp162:
.Lldisp162:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp32_2:
shlr_l_disp32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-666, er0
        mov     #long_dest-666, er0
        shlr.l  #2, @(666:32, er0)      ; shift right logical by two, disp32
        shlr.l  #2, @(666:32, er0)      ; shift right logical by two, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-666 er0
        test_h_gr32 long_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Lldisp322
        beq     .Lldisp322
        fail
        fail
.Lldisp322:
.Lldisp322:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs16_2:
shlr_l_abs16_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #2, @long_dest:16       ; shift right logical by two, abs16
        shlr.l  #2, @long_dest:16       ; shift right logical by two, abs16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b08
;;;     .word   0x6b08
;;;     .word   long_dest
;;;     .word   long_dest
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llabs162
        beq     .Llabs162
        fail
        fail
.Llabs162:
.Llabs162:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs32_2:
shlr_l_abs32_2:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #2, @long_dest:32       ; shift right logical by two, abs32
        shlr.l  #2, @long_dest:32       ; shift right logical by two, abs32
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   long_dest
;;;     .long   long_dest
;;;     .word   0x1170
;;;     .word   0x1170
 
 
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear                ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        ;; -> 0010 1001 0110 1001 0110 1001 0110 1001
        cmp.l   #0x29696969, @long_dest
        cmp.l   #0x29696969, @long_dest
        beq     .Llabs322
        beq     .Llabs322
        fail
        fail
.Llabs322:
.Llabs322:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_reg32_4:
shlr_l_reg32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #4, er0         ; shift right logical by four, register
        shlr.l  #4, er0         ; shift right logical by four, register
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; -> 0000 1010 0101 1010 0101 1010 0101 1010 
        ; -> 0000 1010 0101 1010 0101 1010 0101 1010 
        test_h_gr32 0x0a5a5a5a er0
        test_h_gr32 0x0a5a5a5a er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_l_reg32_reg8:
shlr_l_reg32_reg8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #5, r1l
        mov     #5, r1l
        shlr.l  r1l, er0        ; shift right logical by value of register
        shlr.l  r1l, er0        ; shift right logical by value of register
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; -> 0000 0101 0010 1101 0010 1101 0010 1101
        ; -> 0000 0101 0010 1101 0010 1101 0010 1101
        test_h_gr32  0x052d2d2d er0
        test_h_gr32  0x052d2d2d er0
        test_h_gr32  0xa5a5a505 er1
        test_h_gr32  0xa5a5a505 er1
 
 
        test_gr_a5a5 2          ; Make sure other general regs not disturbed
        test_gr_a5a5 2          ; Make sure other general regs not disturbed
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_l_ind_4:
shlr_l_ind_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #4, @er0        ; shift right logical by four, indirect
        shlr.l  #4, @er0        ; shift right logical by four, indirect
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llind4
        beq     .Llind4
        fail
        fail
.Llind4:
.Llind4:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postinc_4:
shlr_l_postinc_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #4, @er0+       ; shift right logical by four, postinc
        shlr.l  #4, @er0+       ; shift right logical by four, postinc
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest+4 er0
        test_h_gr32 long_dest+4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llpostinc4
        beq     .Llpostinc4
        fail
        fail
.Llpostinc4:
.Llpostinc4:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postdec_4:
shlr_l_postdec_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #4, @er0-       ; shift right logical by four, postdec
        shlr.l  #4, @er0-       ; shift right logical by four, postdec
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-4 er0
        test_h_gr32 long_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llpostdec4
        beq     .Llpostdec4
        fail
        fail
.Llpostdec4:
.Llpostdec4:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_preinc_4:
shlr_l_preinc_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-4, er0
        mov     #long_dest-4, er0
        shlr.l  #4, @+er0       ; shift right logical by four, preinc
        shlr.l  #4, @+er0       ; shift right logical by four, preinc
;;;     .word   0x0105
;;;     .word   0x0105
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llpreinc4
        beq     .Llpreinc4
        fail
        fail
.Llpreinc4:
.Llpreinc4:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_predec_4:
shlr_l_predec_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest+4, er0
        mov     #long_dest+4, er0
        shlr.l  #4, @-er0       ; shift right logical by four, predec
        shlr.l  #4, @-er0       ; shift right logical by four, predec
;;;     .word   0x0107
;;;     .word   0x0107
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llpredec4
        beq     .Llpredec4
        fail
        fail
.Llpredec4:
.Llpredec4:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp2_4:
shlr_l_disp2_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-8, er0
        mov     #long_dest-8, er0
        shlr.l  #4, @(8:2, er0) ; shift right logical by four, disp2
        shlr.l  #4, @(8:2, er0) ; shift right logical by four, disp2
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-8 er0
        test_h_gr32 long_dest-8 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Lldisp24
        beq     .Lldisp24
        fail
        fail
.Lldisp24:
.Lldisp24:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp16_4:
shlr_l_disp16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-44, er0
        mov     #long_dest-44, er0
        shlr.l  #4, @(44:16, er0)       ; shift right logical by four, disp16
        shlr.l  #4, @(44:16, er0)       ; shift right logical by four, disp16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-44 er0
        test_h_gr32 long_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Lldisp164
        beq     .Lldisp164
        fail
        fail
.Lldisp164:
.Lldisp164:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp32_4:
shlr_l_disp32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-666, er0
        mov     #long_dest-666, er0
        shlr.l  #4, @(666:32, er0)      ; shift right logical by four, disp32
        shlr.l  #4, @(666:32, er0)      ; shift right logical by four, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-666 er0
        test_h_gr32 long_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Lldisp324
        beq     .Lldisp324
        fail
        fail
.Lldisp324:
.Lldisp324:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs16_4:
shlr_l_abs16_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #4, @long_dest:16       ; shift right logical by four, abs16
        shlr.l  #4, @long_dest:16       ; shift right logical by four, abs16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b08
;;;     .word   0x6b08
;;;     .word   long_dest
;;;     .word   long_dest
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llabs164
        beq     .Llabs164
        fail
        fail
.Llabs164:
.Llabs164:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs32_4:
shlr_l_abs32_4:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #4, @long_dest:32       ; shift right logical by four, abs32
        shlr.l  #4, @long_dest:32       ; shift right logical by four, abs32
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   long_dest
;;;     .long   long_dest
;;;     .word   0x1138
;;;     .word   0x1138
 
 
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_carry_clear        ; H=0 N=0 Z=0 V=0 C=0
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        ;; -> 0000 1010 0101 1010 0101 1010 0101 1010
        cmp.l   #0x0a5a5a5a, @long_dest
        cmp.l   #0x0a5a5a5a, @long_dest
        beq     .Llabs324
        beq     .Llabs324
        fail
        fail
.Llabs324:
.Llabs324:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_reg32_8:
shlr_l_reg32_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #8, er0         ; shift right logical by eight, register
        shlr.l  #8, er0         ; shift right logical by eight, register
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; -> 0000 0000 1010 0101 1010 0101 1010 0101 
        ; -> 0000 0000 1010 0101 1010 0101 1010 0101 
        test_h_gr32 0x00a5a5a5 er0
        test_h_gr32 0x00a5a5a5 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_l_ind_8:
shlr_l_ind_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #8, @er0        ; shift right logical by eight, indirect
        shlr.l  #8, @er0        ; shift right logical by eight, indirect
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llind8
        beq     .Llind8
        fail
        fail
.Llind8:
.Llind8:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postinc_8:
shlr_l_postinc_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #8, @er0+       ; shift right logical by eight, postinc
        shlr.l  #8, @er0+       ; shift right logical by eight, postinc
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest+4 er0
        test_h_gr32 long_dest+4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llpostinc8
        beq     .Llpostinc8
        fail
        fail
.Llpostinc8:
.Llpostinc8:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postdec_8:
shlr_l_postdec_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #8, @er0-       ; shift right logical by eight, postdec
        shlr.l  #8, @er0-       ; shift right logical by eight, postdec
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-4 er0
        test_h_gr32 long_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llpostdec8
        beq     .Llpostdec8
        fail
        fail
.Llpostdec8:
.Llpostdec8:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_preinc_8:
shlr_l_preinc_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-4, er0
        mov     #long_dest-4, er0
        shlr.l  #8, @+er0       ; shift right logical by eight, preinc
        shlr.l  #8, @+er0       ; shift right logical by eight, preinc
;;;     .word   0x0105
;;;     .word   0x0105
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llpreinc8
        beq     .Llpreinc8
        fail
        fail
.Llpreinc8:
.Llpreinc8:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_predec_8:
shlr_l_predec_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest+4, er0
        mov     #long_dest+4, er0
        shlr.l  #8, @-er0       ; shift right logical by eight, predec
        shlr.l  #8, @-er0       ; shift right logical by eight, predec
;;;     .word   0x0107
;;;     .word   0x0107
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llpredec8
        beq     .Llpredec8
        fail
        fail
.Llpredec8:
.Llpredec8:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp2_8:
shlr_l_disp2_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-8, er0
        mov     #long_dest-8, er0
        shlr.l  #8, @(8:2, er0) ; shift right logical by eight, disp2
        shlr.l  #8, @(8:2, er0) ; shift right logical by eight, disp2
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-8 er0
        test_h_gr32 long_dest-8 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Lldisp28
        beq     .Lldisp28
        fail
        fail
.Lldisp28:
.Lldisp28:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp16_8:
shlr_l_disp16_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-44, er0
        mov     #long_dest-44, er0
        shlr.l  #8, @(44:16, er0)       ; shift right logical by eight, disp16
        shlr.l  #8, @(44:16, er0)       ; shift right logical by eight, disp16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-44 er0
        test_h_gr32 long_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Lldisp168
        beq     .Lldisp168
        fail
        fail
.Lldisp168:
.Lldisp168:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp32_8:
shlr_l_disp32_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-666, er0
        mov     #long_dest-666, er0
        shlr.l  #8, @(666:32, er0)      ; shift right logical by eight, disp32
        shlr.l  #8, @(666:32, er0)      ; shift right logical by eight, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-666 er0
        test_h_gr32 long_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Lldisp328
        beq     .Lldisp328
        fail
        fail
.Lldisp328:
.Lldisp328:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs16_8:
shlr_l_abs16_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #8, @long_dest:16       ; shift right logical by eight, abs16
        shlr.l  #8, @long_dest:16       ; shift right logical by eight, abs16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b08
;;;     .word   0x6b08
;;;     .word   long_dest
;;;     .word   long_dest
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llabs168
        beq     .Llabs168
        fail
        fail
.Llabs168:
.Llabs168:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs32_8:
shlr_l_abs32_8:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #8, @long_dest:32       ; shift right logical by eight, abs32
        shlr.l  #8, @long_dest:32       ; shift right logical by eight, abs32
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   long_dest
;;;     .long   long_dest
;;;     .word   0x1178
;;;     .word   0x1178
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 1010 0101 1010 0101 1010 0101
        cmp.l   #0x00a5a5a5, @long_dest
        cmp.l   #0x00a5a5a5, @long_dest
        beq     .Llabs328
        beq     .Llabs328
        fail
        fail
.Llabs328:
.Llabs328:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_reg32_16:
shlr_l_reg32_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #16, er0        ; shift right logical by sixteen, register
        shlr.l  #16, er0        ; shift right logical by sixteen, register
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        test_h_gr32 0x0000a5a5 er0
        test_h_gr32 0x0000a5a5 er0
 
 
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
shlr_l_ind_16:
shlr_l_ind_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #16, @er0       ; shift right logical by sixteen, indirect
        shlr.l  #16, @er0       ; shift right logical by sixteen, indirect
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llind16
        beq     .Llind16
        fail
        fail
.Llind16:
.Llind16:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postinc_16:
shlr_l_postinc_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #16, @er0+      ; shift right logical by sixteen, postinc
        shlr.l  #16, @er0+      ; shift right logical by sixteen, postinc
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest+4 er0
        test_h_gr32 long_dest+4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llpostinc16
        beq     .Llpostinc16
        fail
        fail
.Llpostinc16:
.Llpostinc16:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_postdec_16:
shlr_l_postdec_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest, er0
        mov     #long_dest, er0
        shlr.l  #16, @er0-      ; shift right logical by sixteen, postdec
        shlr.l  #16, @er0-      ; shift right logical by sixteen, postdec
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-4 er0
        test_h_gr32 long_dest-4 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llpostdec16
        beq     .Llpostdec16
        fail
        fail
.Llpostdec16:
.Llpostdec16:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_preinc_16:
shlr_l_preinc_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-4, er0
        mov     #long_dest-4, er0
        shlr.l  #16, @+er0      ; shift right logical by sixteen, preinc
        shlr.l  #16, @+er0      ; shift right logical by sixteen, preinc
;;;     .word   0x0105
;;;     .word   0x0105
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llpreinc16
        beq     .Llpreinc16
        fail
        fail
.Llpreinc16:
.Llpreinc16:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_predec_16:
shlr_l_predec_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest+4, er0
        mov     #long_dest+4, er0
        shlr.l  #16, @-er0      ; shift right logical by sixteen, predec
        shlr.l  #16, @-er0      ; shift right logical by sixteen, predec
;;;     .word   0x0107
;;;     .word   0x0107
;;;     .word   0x6d08
;;;     .word   0x6d08
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest er0
        test_h_gr32 long_dest er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llpredec16
        beq     .Llpredec16
        fail
        fail
.Llpredec16:
.Llpredec16:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp2_16:
shlr_l_disp2_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-8, er0
        mov     #long_dest-8, er0
        shlr.l  #16, @(8:2, er0)        ; shift right logical by 16, dest2
        shlr.l  #16, @(8:2, er0)        ; shift right logical by 16, dest2
;;;     .word   0x0106
;;;     .word   0x0106
;;;     .word   0x6908
;;;     .word   0x6908
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-8 er0
        test_h_gr32 long_dest-8 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Lldisp216
        beq     .Lldisp216
        fail
        fail
.Lldisp216:
.Lldisp216:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp16_16:
shlr_l_disp16_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-44, er0
        mov     #long_dest-44, er0
        shlr.l  #16, @(44:16, er0)      ; shift right logical by 16, disp16
        shlr.l  #16, @(44:16, er0)      ; shift right logical by 16, disp16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6f08
;;;     .word   0x6f08
;;;     .word   44
;;;     .word   44
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-44 er0
        test_h_gr32 long_dest-44 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Lldisp1616
        beq     .Lldisp1616
        fail
        fail
.Lldisp1616:
.Lldisp1616:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_disp32_16:
shlr_l_disp32_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        mov     #long_dest-666, er0
        mov     #long_dest-666, er0
        shlr.l  #16, @(666:32, er0)     ; shift right logical by 16, disp32
        shlr.l  #16, @(666:32, er0)     ; shift right logical by 16, disp32
;;;     .word   0x7884
;;;     .word   0x7884
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   666
;;;     .long   666
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_h_gr32 long_dest-666 er0
        test_h_gr32 long_dest-666 er0
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Lldisp3216
        beq     .Lldisp3216
        fail
        fail
.Lldisp3216:
.Lldisp3216:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs16_16:
shlr_l_abs16_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #16, @long_dest:16      ; shift right logical by 16, abs16
        shlr.l  #16, @long_dest:16      ; shift right logical by 16, abs16
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b08
;;;     .word   0x6b08
;;;     .word   long_dest
;;;     .word   long_dest
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llabs1616
        beq     .Llabs1616
        fail
        fail
.Llabs1616:
.Llabs1616:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
 
 
shlr_l_abs32_16:
shlr_l_abs32_16:
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_grs_a5a5            ; Fill all general regs with a fixed pattern
        set_ccr_zero
        set_ccr_zero
 
 
        shlr.l  #16, @long_dest:32      ; shift right logical by 16, abs32
        shlr.l  #16, @long_dest:32      ; shift right logical by 16, abs32
;;;     .word   0x0104
;;;     .word   0x0104
;;;     .word   0x6b28
;;;     .word   0x6b28
;;;     .long   long_dest
;;;     .long   long_dest
;;;     .word   0x11f8
;;;     .word   0x11f8
 
 
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_carry_set          ; H=0 N=0 Z=0 V=0 C=1
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_neg_clear
        test_neg_clear
 
 
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 0           ; Make sure ALL general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ; 1010 0101 1010 0101 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        ;; -> 0000 0000 0000 0000 1010 0101 1010 0101
        cmp.l   #0x0000a5a5, @long_dest
        cmp.l   #0x0000a5a5, @long_dest
        beq     .Llabs3216
        beq     .Llabs3216
        fail
        fail
.Llabs3216:
.Llabs3216:
        mov     #0xa5a5a5a5, @long_dest
        mov     #0xa5a5a5a5, @long_dest
.endif
.endif
.endif
.endif
        pass
        pass
 
 
        exit 0
        exit 0
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.