This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

local variables in assembler

Hi all,
In my function, I use local variables, and everything works fine while I stay in C. But when I try to use the same variables in an assembler insertion in the same function, I get error A45: undefined symbol. At the same time, if these variables are declared global, it works. Can anything be done about it? Here is a model of my function:

unsigned char between(unsigned char order)
{
unsigned char hi;
hi = order;
#pragma ASM
xch a, hi
rrc a
xch a, hi
#pragma ENDASM
return hi;
}
void main(void)
{
unsigned char a,b;
b=170;
a=between(b);
}

Michael.

0