Suppose r0 = 0x20000000 and r1 = 0x12345678 All bytes in memory are initialized
ID: 3672842 • Letter: S
Question
Suppose r0 = 0x20000000 and r1 = 0x12345678 All bytes in memory are initialized to 0x00. The following three lines of assembly code has been executed successfully. Fill in the blanks with the values for the memory address at which each line of code stores the value of r1. Also fill in the value of register r0 as each line of code is executed. STR r1, [r0], #4 ; Value of r1 (i.e. 0x12345678 ) is stored into memory address----------- . The value of r0 is -------------- STR r1, [r0, #4]! ; Value of r1 (i.e. 0x12345678) is stored into memory address ----------. The value of r0 is ---------------- STR r1, [r0, 4] ; Value of r1 (i.e. 0x12345678) is stored into memory address ------------- . The value of r0 is --------------
Explanation / Answer
STR R0, [Rbase], Rindex Store R0 at Rbase, & write back Rbase + Rindex to Rbase. STR r1, [r0], #4 ; Value of r1 (i.e. 0x12345678 ) is stored into memory address = 0x20000000 The value of r0 is 0x20000004 STR R0, [Rbase, #index]! Store R0 at Rbase + index, & write back new address to Rbase. STR r1, [r0, #4]! Value of r1 (i.e. 0x12345678) is stored into memory address = 0x20000004 The value of r0 is 0x20000004 STR R0, [Rbase, Rindex] Store R0 at Rbase + Rindex. STR r1, [r0, 4] Value of r1 (i.e. 0x12345678) is stored into memory address = 0x20000004 The value of r0 is 0x20000000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.