PLEASE BE NEAT AND SHOW ALL WORK PLEASE TAKE GOOD PICTURES T

PLEASE BE NEAT AND SHOW ALL WORK!!! PLEASE TAKE GOOD PICTURES TOO!!!

Assuming that the registers R1, R1, R3, R4 contain the values 0 times 11aa, 0 times 22bb, 0 times 33cc, 0 times 44dd respectively, and that the register R5 contains the value 0 times 1000, what is the value in R5 after each of the following ARM instructions in this program fragment and what byte value is stored in each affected memory location? (Assume a little-endian configuration.) STR R1, [R5] STR R2, [R5, #4] STR R3, [R5], #4 STR R4, [R5, #4]!

Solution

Answer

Given:

R1 = 0x11aa

R2 = 0x22bb

R3 = 0x33cc

R4 = 0x44dd

R5 = 0x1000

a.

STR R1, [R5] # stores the content of register R5 in the memory location pointed by the content of R5

# so register R5 will have 0x1000, and memory location 0x1000 will have 0x11aa

b.

STR R2, [R5, #4] # offset 4 is added to the content of R5 and the reulting address is used for storing the content

# of R2

# So, R5 will have 0x1000, [R5, #4] will give memory location 0x1000 + 4 = 0x1004 and this
   # memory location will store content of R2, i.e. 0x22bb

c.

STR R3, [R5], #4 #content of R3 is stored in the memory location indicated by the content of R5 and offset is # added to R5 and written back to R5
   # so, content of R3, i.e. 0x33cc is written on memory location 0x1000, after this,
   # 0x1000 + 4 = 0x1004 and this written on R5, so R5 will have 0x1004

d.

STR R4, [R5, #4]! # Similar to (b) except that the updated address is written back on R5
   # So, memory location 0x1000 will have 0x44dd and R5 will have 0x1004

PLEASE BE NEAT AND SHOW ALL WORK!!! PLEASE TAKE GOOD PICTURES TOO!!! Assuming that the registers R1, R1, R3, R4 contain the values 0 times 11aa, 0 times 22bb, 0

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site