[Icc-mot] ICC12 Advanced V7.03 bug
Gene Norris
genenorris at spotengineering.com
Mon Apr 7 09:08:05 PDT 2008
Willard,
The below is not much information, please show your function and the
listing (.lis) segment pertinent to this problem.
In general, arithmetic shifts are done on signed values and logical on
unsigned, so you probably have a sign type problem. Data that is not
typed is assumed to be signed...
Gene
willard.a.hall at gm.com wrote:
>
> 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);
> 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