Hi All,
I am working on ARM processor. I have successfully used following assembly instructions into .asm i.e. assembly source file:
------------------------------------------------------------------------------------------------
LDR R1, otp_add ; load address 0x00001000 into R1
BLX R1 ; branch to location 0x00001000
;***************************************************************
;* CONSTANTS USED BY THIS MODULE
;***************************************************************
.if !__TI_AVOID_EMBEDDED_CONSTANTS
otp_add .long 0x00001000
.endif
------------------------------------------------------------------------------------------------
Now I want to use above assembly instruction into C source file so I used following syntax:
__asm(" otp_add .long 0x00001000\n"
" ldr R1, otp_add\n "
" blx R1");
However I am getting following errors:
otp_add .long 0x00001000 - [E0002] Illegal mnemonic specified
ldr R1, otp_add -[E0001] Address must be defined in the, [E0001] Undefined symbol
Please let me know correct way to define constants in __asm.
Please Note: I used C syntax like #define otp_add 0x1001 at the start of C source file as well as
const unsigned int otp_add = 0x00001001 at the start of C source file and used following instructions
__asm(" ldr R1, otp_add\n "
" blx R1");
however in vain.
Thanks in advance.
Tushar