Instruction to load register

Discussion in 'Homework Help' started by Ruson, May 13, 2016.

  1. Ruson

    Thread Starter New Member

    May 10, 2016
    4
    0
    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.
     
  2. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,647
    759
    What micro is that? What are all possible notations to express an hexadecimal value?
     
  3. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    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?"
     
  4. Ruson

    Thread Starter New Member

    May 10, 2016
    4
    0
    Hey, sorry about that. It's ARM® Cortex®-M0+ processor with 32 bits
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    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.
     
Loading...