I had a function which took a byte argument and returned a byte.  From
another file (compiled into a separate object), I called the function
without first declaring it.  The calling function used an argument which
evaluated to uint32_t.

In the called function, it looked for the argument in R15.  In the calling
function, it left the low byte of the argument in R14.

Declaring the called function fixed the problem.  Here's an example:

file1.c:
uint8_t bytefunc(uint8_t arg)
{ ...
}

file2.c:
extern uint8_t bytefunc(uint8_t); // this line required to make the ABI
generate the correct code

main()
{
uint32_t i = 123456;
bytefunc(i & 0xFFL);
}
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to