[Icc-mot] ICC12 Advanced V7.03 bug
Edward Karpicz
ekarpicz at freemail.lt
Mon Apr 7 10:35:06 PDT 2008
> Thanks for the suggestion Edward, I tried changing to an unsigned 16, but
> the compiler still does a "jsr asr16"
> Bill
>
Then you should check your defines. I tried this, and one case calls asr16,
another one lsr16. Please attach your code along with all used defines.
#define I16 signed
#define U16 unsigned
short getid(void)
{
short id;
id = ((((I16)(CAN0RXIDR0 << 8)) | ((I16)(CAN0RXIDR1)))>> 5);
id = ((((U16)(CAN0RXIDR0 << 8)) | ((U16)(CAN0RXIDR1)))>> 5);
}
Edward
>
>
>
> "Edward Karpicz"
> <ekarpicz at freemai
> l.lt> To
> Sent by: "Discussion List for ICC08/11/12/16
> icc-mot-bounces at i users. You do NOT need tosubscribe
> magecraft.com toicc-announce if you are a member
> of this." <icc-mot at imagecraft.com>
> cc
> 04/07/2008 01:03
> PM Subject
> Re: [Icc-mot] ICC12 Advanced V7.03
> bug
> Please respond to
> "Discussion List
> for
> ICC08/11/12/16
> users. You do NOT
> need to
> subscribe to
> icc-announce if
> you are a member
> of this."
> <icc-mot at imagecra
> ft.com>
>
>
>
>
>
>
>
>
>>
>>
>> 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
>>
>
> _______________________________________________
> Icc-mot mailing list
> Icc-mot at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-mot
>
>
> _______________________________________________
> Icc-mot mailing list
> Icc-mot at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-mot
>
More information about the Icc-mot
mailing list