Hacker News new | ask | show | jobs
by jmgrosen 4740 days ago
From what I can tell, yes. ldr r0, =0x20200000 loads from memory. In C, r0 = *0x20200000; what we would want is just r0 = 0x20200000; or mov r0, #0x20200000
1 comments

They have it right, LDR acts differently if it's a register argument or register plus offset vs a immediate.

The immediate pseudo-instruction:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc....

The regular form:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc....