Reputation: 25397
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.
$
-symbol is replaced by the actual address of the instruction by the assembler - but what is the SDCC equivalent?T0Run
etc.?Upvotes: 0
Views: 1586
Reputation: 11
LOL... That sounds like sdcc it is amusing. I am just now starting to add header files. I had to put it in the bin Dir, as it did not find it as keil does in its project folder.
this might help. now i am not an expert yet, but some things they say don't work as they say. i had to use both the SDCC manual, and the migration manual eventually i found the correct syntax for what i wanted...
Upvotes: 1
Reputation: 23001
I would think you could just replace the $ with a label defined on the same line.
00001$:
jnb T0Full, 00001$
Note that according to the SDCC Compiler User Guide:
All labels defined within inline assembler code have to be of the form nnnnn$ where nnnnn is a number less than 100 (which implies a limit of utmost 100 inline assembler labels per function).
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?
Upvotes: 1