Re: [arm-gnu] bug or me doing something wrong?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] bug or me doing something wrong?



Gene Smith schrieb:
> I have a function that accepts a uint16_t parameter. And I have a global 
> variable of type int16_t. They are both set to zero. But inside the 
> function I compare them, if (a==b), and they compare not equal. In the 
> assembly language the compare is actually "cmp r0, r2" where r0 is 
> 0xc000000 and r2 0x0 so they compare not equal.

Maybe post the striped down function + generated code. From your info it
is hard to judge.

> 
> Note: r2 is the global var and gets setup with ldrh r2, [r3, #4] and it 
> looks correct.  while r0 is the function parameter and gets set from r6 
> at beginning of function and r6 contain 0xc000000. (Don't immediately 
> see where r6 is set.)

There must be something else, parameters are passed in r0..r3, not r6.

-- 
42Bastian
+
| http://www.sciopta.com
| Fastest direct message passing kernel.
| IEC61508 certified.
+