This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM assembler register read

Note: This was originally posted on 11th September 2010 at http://forums.arm.com

Hello All,

I need a quick example of how to place a value from a hardware register (0x70001234 for example) into a register such as R0
then compare it to a constant such as 0xE0680003 and do a branch based on equality.

So far I have had no luck getting something this simple to work.

Thanks,
Dennis
Parents
  • Note: This was originally posted on 14th September 2010 at http://forums.arm.com

    ldr     r1, =(SBMR)

    --> This code will not read a RAM/Peripheral register. The parenthesis is treated by the assembler to contain an equation of sorts that eventually results to a constant. Thus, this code boils down to ldr, r1, = constant.

    See my example and study it. Also read the Assembly instruction sets manual from ARM. The books by Sloss and Hohl are very good place to start with.
Reply
  • Note: This was originally posted on 14th September 2010 at http://forums.arm.com

    ldr     r1, =(SBMR)

    --> This code will not read a RAM/Peripheral register. The parenthesis is treated by the assembler to contain an equation of sorts that eventually results to a constant. Thus, this code boils down to ldr, r1, = constant.

    See my example and study it. Also read the Assembly instruction sets manual from ARM. The books by Sloss and Hohl are very good place to start with.
Children
No data