I am new to sdcc and Pic in general but I think the answer to your question is to specify the address location of your variable when you declare it and then point your assembly to that spot when you want to access it in asm.
This page has a good reference on converting other compiler code over into sdcc code. In their example they declare some unsigned int with

uint8_t at 0x10 foo;
uint8_t at 0x11 bar;

My guess is you can access them in asm via the address you gave them in your code.


On Thu, Feb 28, 2008 at 8:49 AM, Massimo Gaggero <> wrote:
       I'm using SDCC on PIC 16F target. Now I need to use inline assembly
function to manage data on local variables. How can I use local
variables within inline assembly code?
My case is:

unsigned char handle (unsigned char data) {
       unsigned char temp;
               some_assembly_manipulation on temp
       return temp;

I can't find the way to reference variable 'temp' in inline assembly code.

Thank you,

This email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Sdcc-user mailing list