Assume the following register and memory contents in an ARM computer: Register r
ID: 3621387 • Letter: A
Question
Assume the following register and memory contents in an ARM computer:Register r0 contains 1000 (0x3e8)
Register r1 contains 2000 (0x7d0)
Register r2 contains 1016 (0x3f8)
Register r6 contains 20 (0x14)
Register r7 contains 30 (0x1e)
The numbers 1, 2, 3, 4, 5, and 6, are stored in successive word locations starting at memory address 1000 (0x3e8).
What is the effect of executing each of the following short instruction blocks, starting each time using the given initial values?
(a)
ldr r8,[r0]
ldr r9,[r0,#4]
add r10,r8,r9
(b)
ldmia r2!,{r4,r5}
add r4,r4,r5
(c)
str r6,[r1,#-4]!
str r7,[r1,#-4]!
ldr r8,[r1],#4
ldr r9,[r1],#4
sub r10,r8,r9
Explanation / Answer
(a) LDR R8,[R0] R0= 1000 R8 [R1,#-4] ------> [2000,#-4] -------> [2000-4] 20 ------> [1996] 20 WILL BE STORED AT ADDRESS1996 (C) LDMIA R2!,{R4,R5} -----LOAD DATA STARTING FROM R2 LOCATION INTO R4 & R5 -----CONTENT OF R2=CONTENT OF 2016,THAT IS 17 -----SO 17 WILL BE LOADED TO R4 AND NEXT 18 WILL BE LOADED TO R5 LDR R9,[R0,#4] --- WILL LOAD R9 WITH DATA AT[R0,#4] ---- R9Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.