PIC microcontrollers (PIC12/PIC14/PIC16) doesn't have a general purpose stack (it has a hardware stack used only to sub-routines and interrupts return). I don't known how the sdcc implements local variables for these targets (may be a software stack or fixed allocation).

Augusto

On 08/06/2017 07:12 PM, Maarten Brock wrote:
Access to global variable is no problem, just use _varname, but how can
I access local variables? Is there no other way than using the
compiler-generated names (which may change if the code is changed)?

BR
Erlo
This highly depends on the target and compiler options. Local variables on
stack don't even have a name in assembler.

Hav you considered using static variables?

Maarten


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to