News for hackers. Stuff that matters.
Re:ARM immediate value encoding (2014) by repiret on Tuesday January 30, 2018 @07:43PM (#16270423)
On ARM1156, and ARMv7 and newer, use MOVW, which takes a simple 16-bit immediate. If 16 bits doesn’t do it, use a MOVW/MOVT pair which can load any 32-bit value.

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.

There are no comments on this comment yet.