Hello:
Recently we added protection to constant defines in our C headers. These headers are shared by assembly code too. BUt when I compile the code, the assembler bails out with an error since it cannot recognize the literals. See the example below for what's happening
def_reg.h has the following define
#define TEMP_RESET_REG (0x24UL) // to make it an unsigned lon constant.
This header is shared between C code and assembly code
So my start_pt.S has the following snippet:
ldr r2, [#TEMP_RESET_REG]
The preprocessor translates this to
ldr r2, [#(0x24UL)]
which the compiler/assembler does not accept as "UL" is not an expected character.
How do I get around this? Is there any assembler/compiler directive I can give so it recognizes it as an unsigned long? Any pointers are greatly appreciated.
Thanks.
-kirti
Hello,
Here is how Linux deals with embedding constants into C and assembly.
-amol