[Icc-mot] ICC12 Advanced V7.03 bug

Edward Karpicz ekarpicz at freemail.lt
Mon Apr 7 10:03:30 PDT 2008



>
>
> The code shown needs to do a logical shift right to give me id = 0x0581
> The compiler uses an arithmatic shift which wraps the sign bit to give me
> id = 0xFD81
>
> CANRIDR0 = 0xB0   CANRIDR1 = 0x20
>
>
> 06B9           ;     id    = ((((I16)(CANRIDR0 << 8)) | ((I16)(CANRIDR1)))
>>> 5);



What's I16? Is it signed? Replace I16 with U16 and I guess you'll get 
desired result.

Edward




> 06B9 F60161            ldab 0x161
> 06BC 87                clra
> 06BD B746              tfr D,Y
> 06BF C7                clrb
> 06C0 B60160            ldaa 0x160
> 06C3 6D80              sty 0,S
> 06C5 AA80              ora 0,S
> 06C7 EA81              orb 1,S
> 06C9 B746              tfr D,Y
> 06CB CE0005            ldx #5
> 06CE B764              tfr Y,D
> 06D0 160000            jsr asr16
> 06D3 B746              tfr D,Y
> 06D5 6D83              sty 3,S
> 06D7                   .dbline 269
>
> _______________________________________________
> Icc-mot mailing list
> Icc-mot at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-mot
> 



More information about the Icc-mot mailing list