;
; group p, test 1
;
; bset.16 a,mask,d8
; bclr.16 b.mask,d8
;

m4_include(..\tmacros.h)

INIT_TEST(p,0x01)

; declare symbols here
SYM(failhop0)
SYM(failhop1)
SYM(failhop2)
SYM(failhop3)
SYM(next0)
SYM(next1)
SYM(next2)
SYM(next3)
SYM(next4)
SYM(next5)
SYM(next6)
SYM(next7)
SYM(next8)

   
;
    SUBTEST(1)
    ld.16    a,0x50
    bset.16  a,0xa0,failhop0
    br	next0
failhop0:
    FAIL
next0:

    SUBTEST(2)
    ld.16    a,0xa0
    bset.16  a,0x50,failhop1
    br	next1
failhop1:
    FAIL
next1:

    SUBTEST(3)
    ld.16    a,0x50
    bset.16  a,0x40,next2
    FAIL
next2:

    SUBTEST(4)
    ld.16    a,0xa0
    bset.16  a,0xa0,next3
    FAIL
next3:

    SUBTEST(5)
    ld.16    a,0x80
    bclr.16  a,0xa0,failhop2
    br	next4
failhop2:
    FAIL
next4:

    SUBTEST(6)
    ld.16    a,0xa0
    bclr.16  a,0x20,failhop3
    br	next5
failhop3:
    FAIL
next5:

    SUBTEST(7)
    ld.16    a,0x10
    bclr.16  a,0x40,next6
    FAIL
next6:

    SUBTEST(8)
    ld.16    a,0x50
    bclr.16  a,0xa0,next7
    FAIL
next7:


;   Finally, when done branch to pass
    END_TEST
