In: Computer Science
For the following instruction fill in the following blanks to answer the questions:
STUR X3, [X4, 0x40] Assume X3 currently has 0x100 in it and X4 currently has 0x200 in it. Assume the following memory addresses have the associated data in them before the instruction is executed as listed in this table:
Address Data
0x100 0x0
0x140 0x1
0x200 0x2
0x240 0x3
0x300 0x4
Fill in the table for what the values will be after the instruction has executed:
Address Data
0x100 ___
0x140 ___
0x200 ___
0x240 ___
0x300 ___
As always precede each value with 0x
Given instruction is STUR X3, [X4, 0x40]. Basically, STUR (Store (unscaled) Register) loads the value from an address and stores it in the memory addressed by the base plus an offset. Here, STUR loads the value from the address in X3 and stores it in the memory addressed by X4 plus the offset 40 bytes.
The address of X4 is 0x200 and offset is 0x40. So the new address will be 0x200+0x40(offset) ==> 0x240
The value in the X3 is 0x0. So the value 0x0 will be stored in the new address 0x240. This will modify the value at X4 to 0x0.
Address Table before the execution of instruction:
Address | Data |
---|---|
0x100 | 0x0 |
0x140 | 0x1 |
0x200 | 0x2 |
0x240 | 0x3 |
0x300 | 0x4 |
Address Table after the execution of instruction:
Address | Data |
---|---|
0x100 | 0x0 |
0x140 | 0x1 |
0x200 | 0x2 |
0x240 | 0x0 |
0x300 | 0x4 |