;
; group r, test 4
;
; cmpb.ne.16 a,u16(dp),e8
; cmpb.ne.16 a,u8(sp),d8
; cmpb.ne.16 a,u8(b),d8
; cmpb.ne.16 a,i16
; cmpb.ne.16 a,extii8
; cmpb.ne.16 a,0
; cmpb.ne.16 a,b
;

m4_include(..\tmacros.h)

INIT_TEST(r,0x04)

; declare symbols here
SYM(hop)
SYM(d1)
SYM(d2)
SYM(d3)
SYM(next0)
SYM(next1)
SYM(next2)
SYM(next3)
SYM(next4)
SYM(next5)
SYM(next6)
SYM(next7)
SYM(next8)
SYM(next9)
SYM(next10)
SYM(next11)
SYM(next12)
SYM(next13)
SYM(next14)
SYM(fail0)
SYM(fail1)
SYM(fail2)
SYM(fail3)
SYM(fail4)
SYM(fail5)
SYM(fail6)

    br	hop

d1:
    defw    0xff00
    defw    0x0100
    defw    0xff00
d2:
    defw    0x0000
    defw    0x4400
    defw    0x0000
d3:
    defw    0x0f00
    defw    0xf000
    defw    0x0f00

hop:
; Begin test here

SUBTEST(1)
;   cmpb.ne.16  a,u16(dp),d8
    ld.16   a,d1
    lea	    a,-555(a)
    copy    dp,a
    ld.16    a,555(dp)
    cmpb.ne.16	a,555+2(dp),next0
    FAIL
next0:
    cmpb.ne.16	a,555+4(dp),fail0
    br	next2
fail0:
    FAIL
next2:

SUBTEST(2)
;   cmpb.ne.16	a,u8(sp),d8
    ld.16   a,d2
    lea	a,-44(a)
    copy    sp,a
    ld.16    a,44(sp)
    cmpb.ne.16	a,44+2(sp),next3
    FAIL
next3:
    cmpb.ne.16	a,44+4(sp),fail1
    br	next4
fail1:
    FAIL
next4:
    ld.16   a,0x7000
    copy    sp,a

SUBTEST(3)
;   cmpb.ne.16	a,u8(b),d8
    ld.16   b,d3
    lea	    b,-200(b)
    ld.16    a,200(b)
    cmpb.ne.16	a,200+2(b),next5
    FAIL
next5:
    cmpb.ne.16	a,200+4(b),fail2
    br	next6
fail2:
    FAIL
next6:

SUBTEST(4)
;   cmpb.ne.16	a,i16,d8
    ld.16    a,2020
    cmpb.ne.16	a,2030,next7
    FAIL
next7:
    cmpb.ne.16	a,2020,fail3
    br	next8
fail3:
    FAIL
next8:

SUBTEST(5)
;   cmpb.ne.16	a,i8,d8
    ld.16    a,-12
    cmpb.ne.16	a,-13,next9
    FAIL
next9:
    cmpb.ne.16	a,-12,fail4
    br	next10
fail4:
    FAIL
next10:

SUBTEST(6)
;   cmpb.ne.16	a,0,d8
    ld.16    a,0xff00
    cmpb.ne.16	a,0x0,next11
    FAIL
next11:
    ld.16    a,0x0
    cmpb.ne.16	a,0x0,fail5
    br	next12
fail5:
    FAIL
next12:

SUBTEST(7)
;   cmpb.ne.16	a,b,d8
    ld.16    a,1200
    ld.16    b,-1200
    cmpb.ne.16	a,b,next13
    FAIL
next13:
    ld.16    b,1200
    cmpb.ne.16	a,b,fail6
    br	next14
fail6:
    FAIL
next14:





;   Finally, when done branch to pass
    END_TEST
