In an iPhone project, I'm compiling a .s assembly file. In this file, I need to access the address of an external C variable and load it into a register. I have the code below:
_execute_read_spsr:
ldr r0,=_spsr_pointer
ldr r0, [r0]
ldr r0, [r0]
bx lr
However, when compiling, Clang/LLVM throws an error on the first line of the method, saying:
unexpected token in operand
ldr r1,=_spsr_pointer
^
I've read somewhere that the iOS assembler does not support this form of pseudo-operation. Unfortunately, this is code I've received from someone else, and my knowledge of assembly is limited. What would be the equivalent of this line of code that the assembler would accept?