We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How do I access a local variable in assembly?
I have used the SRC to determine how the compiler created the variable. it changes it's name from variable to variable?nnn where nnn is a number.
How do I determine what nnn is? (other than looking at the .src file) can I access the variable using the original label name?
If I use the variable:nnn , nnn will occasionally change and ten I get errors!
Help
a Sample:
This sample only proves that if you absolutely insist, you can drive a 10-inch nail into concrete using a fine-tip soldering iron, even if you have a perfectly usable hammer at hand.
It spectacularly fails to answer the actual question, though: why the heck would anyone want to do such a thing?
this little snippet
#pragma endasm i=8; ACC=RcvFIFOEmptyFlagHi; #pragma asm
access the accumulator in C and, while it MAY not blow it all up, the practice is, at least, dangerous. Thus it does not matter if you can "access local "c" variables in inline assembly" since the whole mess, most likely, will blow up anyhow.
To the OP rewrite the mess totally in assembler and look up the OVERLAYABLE command to the assembler, that will give you local variables in an assembler routine.
Erik