SV: [Icc-avr] Bootloader problem
Johan Wallström
johan at edab.nu
Thu Nov 1 23:39:57 PST 2007
> Hi Silvian
>
> I don't know, but is it possible to force the order with brackets?
> Like this:
>
> PageAddressHigh = (( RxChar() ) + (RxChar() ) << 8);
>
> You can test this, if you reorder the brackets to force a false result:
> PageAddressHigh = ( RxChar() + ( (RxChar() ) ) << 8);
>
> Edi
Nooo, it doesn't make it clearer.
I hardly think the following code would produce alot more instructions.
After all, it's just local variables that the compiler can put in any
registers it want to, just like it does when reading both chars on the same
line.
char firstRxChar = RxChar();
char secondRxChar = RxChar();
PageAddressHigh = firstRxChar + (secondRxChar << 8);
More information about the Icc-avr
mailing list