I'm not very into assembly but for a project I have to modify a few lines of assembly code for the C51 C compiler to the SDCC.
This is code for C51
setb T1Run
setb T0Run
setb IDLE
jnb T0Full, $
Which, compiled with SDCC produces
?ASlink-Warning-Undefined Global 'IDLE' referenced by module 'Com_Func'
?ASlink-Warning-Undefined Global '$' referenced by module 'Com_Func'
?ASlink-Warning-Undefined Global 'T0Run' referenced by module 'Com_Func'
?ASlink-Warning-Undefined Global 'T1Run' referenced by module 'Com_Func'
?ASlink-Warning-Byte PCR relocation error for symbol $
file module area offset
Refby ./Com_Func.rel Com_Func CSEG 004A
Defin ./Com_Func.rel Com_Func CABS 0000
as compiler errors/warnings.
- I know the
$
-symbol is replaced by the actual address of the instruction by the assembler - but what is the SDCC equivalent? - How can I resolve the warnings for
T0Run
etc.?
I would think you could just replace the $ with a label defined on the same line.
Note that according to the SDCC Compiler User Guide:
As for the other compiler warnings, those are symbols that assumedly haven't been defined anywhere. How were they defined in the original C51 code?