Hello, I use sdcc 4.4.0 pic14, under the command --stack-auto, c code:
#include "pic16f877a.h"
unsigned char k;
//----------------------------------------------------------------------------------
unsigned char compare(unsigned char a, unsigned char b)
{
unsigned char result;
if(a > b)
result = 0x11;
else
result = 0x22;
return result;
}
void main()
{
k = compare(5, 20);
while(1)
{
;
}
}
There is --stack-auto in the transfer. When comparing the asm code, it is only a small difference from the first paragraph. Is this correct? It seems that the a and b data are reversed after being passed in.
I don't know if anyone can really help here, after all the pic14 port is unmaintained. I know nearly nothing about pic14. But: AFAIK, parameters on the stack are passed right-to-left for all ports.
Got it, thank you for your reply.
Since nothing here appears to indicate actually broken code, I take it that this can be closed as invalid.