Benoit Steinmetz schrieb:
hi all
I have written a function in AVR assembler that returns an 8-bit
result. The
function is called from C, so it should respect the avr-gcc ABI.
I am a bit confused as to whether the function is required to
zero/sign-extend the 8-bit result to 16 bits or not.
One question: Does the omission of sign extension by avr-gcc remain
without optimisation for size?
Thank you for your suggestion, I did not think of that.
When I compile without any optimization at all, the sign extension
by the called function is also missing, like with optimizations
enabled.
Benoit,
See "C WITHOUT RAM" section of this 2006 article named "Tiny AVR Serial
Port Programmer".
http://www.lightner.net/avr/2605018Lightner.pdf
...and this Webpage...
http://www.lightner.net/avr/ATtinyAvrGcc.html
Compiling C-code for an AVR like the ATtiny2313 with few resources---and