;  
; group 3, test 3  
;  
; 16-bit load immediate using signed extended 8-bit immediate  
;  
  
m4_include(..\tmacros.h)  
  
INIT_TEST(b,0x03)  
  
; declare symbols here  
    SYM(next0)  
    SYM(next1)  
    SYM(next2)  
    SYM(next3)  
    SYM(next4)  
  
SUBTEST(1)  
  
; Now, put actual test code here....  
  
    ; zero extended to a  
    ld.16   a,0x1234  
    ld.16   a,0x34  
    cmpb.eq.16	a,0x0034,next0  
    FAIL  
  
    ; zero extended to b  
next0:  
    ld.16   b,0x4321  
    ld.16   b,0x77  
    copy    a,b  
    cmpb.eq.16	a,0x77,next1  
    FAIL  
  
    ; 1 extended to a  
next1:  
    ld.16   a,0x1284  
    ld.16   a,-1  
    cmpb.eq.16	a,0xffff,next2  
    FAIL  
  
    ; 1 extended to b  
next2:  
    ld.16   b,0x4321  
    ld.16   b,-2  
    copy    a,b  
    cmpb.eq.16	a,0xfffe,next3  
    FAIL  
      
next3:  
    ld.16   c,0x1  
    copy    a,c  
    cmpb.eq.16  a,1,next4  
    FAIL  
next4:  
  
;   Finally, when done branch to pass  
    END_TEST  
  
