so... what is the proper way to set a register to the value 0x101, or any other value that cannot be represented?
Edit: Also, ARMv8 has dedicated instructions for for pc-relative loads and jumps.
On older ARMs, either do a load immediate followed by an immediate arithmetic, like so:
MOV R0, 0x0100
ADD R0, R0, 0x01
Or use a PC relative load: LDR R0, [PC, offset where you stored 0x101]
Which the assembler allows you to abbreviate as: LDR R0, =0x101
And it will find a spot for 0x101 and generate the correct PC relative load.When writing ARM assembly, the assembler (at least the ones I've seen) abstract this detail away from you.
You can use
ldr r0, =0xff000000
and the assembler will emit a MOV if it can, and if it can't it will put the value somewhere in RAM and use LDR to load it up.ARM is fun.