Could some one please show how the passing of variables is achieved between a Pic c program and an inline #ASM routine and perhaps how we can get ASM modified variables back into the C program once again ,
I am working with a PIC18F device and using the CCS c compiler ver 4.141
my search for this topic on this forum has not given any meaningful results
many thanks
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
Posted: Thu Nov 21, 2013 7:49 am
A variable is stored in a ram location with a specific address... you can reference this adress directly on ASM. _________________ CCS PCM 5.078 & CCS PCH 5.093
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
#asm
MOVLW 4
ADDWF A,W
MOVWF A
#endasm
//'a' is now 14...
while (TRUE) ;
}
It will automatically bank switch to select the variable if needed.
However it is now almost totally unnecessary to use assembler in CCS. Just about everything that can be done in assembler can be done directly from the language without using this.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum