I want to interface some assembly routines with sdcc C-code (pic14 target).
However it is not clear to me what rules should be followed.
More concretely: code generated by sdcc itself starts by copying the registers
STK** to locally defined registers. Is this always necessary? In my assembly
code I would like to manipulate the STK registers directly to save instructions.
Are there pitfalls to this?
Do like this:
unsigned char a_byte = 1;
//Increment a_byte using ASM
When writing in ASM in a C file, you should reference a byte with an underscore before it as prescribed in the manual.
>When writing in ASM in a C file, you should reference a byte with an underscore before it as prescribed in >the manual.
Your example is wrong. This works only for globals.
The example also has nothing to do with my question which was about linking a seperate assembly file.
More specifically I was asking if it is really necessary to copy the argument registers STK** to locally defined registers (which is what the assembler generated by sdcc seems to do by default).