What is the primary function of the LDR and STR instructions in ARM architecture?
Think about how data moves between memory and registers.
LDR (Load Register) copies data from memory into a register. STR (Store Register) copies data from a register into memory. They are fundamental for data transfer.
Which addressing mode is NOT commonly used with the LDR and STR instructions in ARM?
Consider how LDR and STR interact with memory addresses.
LDR and STR always involve memory access. Direct register-to-register addressing without memory access is not an addressing mode for these instructions.
Given the ARM instruction LDR R1, [R2, #4], what happens when this instruction executes?
Focus on the syntax: [R2, #4] means base register plus offset.
The instruction loads into R1 the value stored at the memory address calculated by adding 4 to the value in R2. It does not modify R2.
What is the key difference between the STR and STRB instructions in ARM?
Consider the size of data each instruction handles.
STR stores a 32-bit word from a register into memory. STRB stores only the least significant byte (8 bits) from a register into memory.
Consider the instruction STR R0, [R1], #4. What is the state of register R1 after this instruction executes?
Post-increment means the register is updated after the memory operation.
The instruction stores the value of R0 at the address currently in R1, then increments R1 by 4 after the store.
