Instruction to load register

Thread Starter

Ruson

Joined May 10, 2016
4
Hi everyone!
Could anyone help to answer the question?
Instruction to load register R5 with 20000008 hexadecimal?
LDR R5, #20000008
MOV R5, #0x20000008
LDR R5, =0x20000008
None of the above.
 

WBahn

Joined Mar 31, 2012
30,058
Hi everyone!
Could anyone help to answer the question?
Instruction to load register R5 with 20000008 hexadecimal?
LDR R5, #20000008
MOV R5, #0x20000008
LDR R5, =0x20000008
None of the above.
Really?

You don't think that it might be the least bit useful to know which processor you are talking about or which assembler you are using?

This is akin to asking, "I don't know how to turn on my car headlights, could someone please tell me?"
 

MrChips

Joined Oct 2, 2009
30,806
This question challenges your knowledge and understanding of ARM syntax and architecture.

We can eliminate the first instruction
LDR R5, #20000008
since this is not hexadecimal representation.

If you have any knowledge of ARM architecture, you can eliminate the second instruction
MOV R5, #0x20000008
since the ARM instruction set cannot generate any random 32-bit literal.

The third instruction
LDR R5, =0x20000008
is a pseudo-instruction meaning that there is no single instruction to perform this operation. In this case the assembler will generate a single instruction or multiple instructions in order to achieve this objective.
 
Top