Question

Problem: On an ARM processor using big endian format, given the following memory map and [R1]...

Problem: On an ARM processor using big endian format, given the following memory map and [R1] = 0xA10E0C2D, [R2] = 0x00000060, [R3] = 0x00000002, [R4] = 0x0000000C, predict [R1] and [R2] and draw the updated memory map after an ARM data transfer instruction is executed in EACH case. (hint: (1) in this map, each memory location is a word long and occupies 4 bytes; also you only need to draw the section of the memory including the changed word and its address; (2) these instructions are NOT executed one after the other one; instead, each instruction starts with the initial conditions given in the statement.)

0x6C [0x78092A7B]

0x68 [0x56AB8CEF]

0x64 [0x3490AB02]

0x60 [0x902E8C9A]

(1) LDR R1, [R2], #0x4

(2) STR R1, [R2, R3, LSL #2]

(3) LDRB R1, [R2]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given that [R1] = 0xA10E0C2D, [R2] = 0x00000060, [R3] = 0x00000002, [R4] = 0x0000000C

Given that the processor executes in Big Endian format (MSB is stored in the lowest address location), Therefore the address location along with the value is given as follows
0x60 = 0x90
0x61 = 0x2E
0x62 = 0x8C
0x63 = 0x9A
0x64 = 0x34
0x65 = 0x90
0x66 = 0xAB
0x67 = 0x02
0x68 = 0x56
0x69 = 0xAB
0x6A = 0x8C
0x6B = 0xEF
0x6C = 0x78
0x6D = 0x09
0x6E = 0x2A
0x6F = 0x7B

1. LDR R1,[R2],#0x4
This is in post index notation LDR data:mem[base], #offset
After the execution of this instruction
R1 = 32bit value from address location which is in R2(0x60 - 0x63)
Therefore R1 = 0x902E8C9A
and R2 is added with offset i.e.,0x60+0x04 = 0x64

2. STR R1, [R2, R3, LSL #2]
store R1 in the address given by R2+R3*4(LSL 2 will perform multiply 4 to the value in register)
After this instruction is executed
R1 = 0xA10E0C2D(Value unchanged)
R2 = 0x00000060(Value unchanged)
R3 = 0x00000002(Value unchanged)
[R2, R3, LSL #2] = [0x60+ 0x02*4] = [0x68]
value in address locations
0x60 = 0x90(Value unchanged)
0x61 = 0x2E(Value unchanged)
0x62 = 0x8C(Value unchanged)
0x63 = 0x9A(Value unchanged)
0x64 = 0x34(Value unchanged)
0x65 = 0x90(Value unchanged)
0x66 = 0xAB(Value unchanged)
0x67 = 0x02(Value unchanged)
0x68 = 0xA1(Value Changed)
0x69 = 0x0E(Value Changed)
0x6A = 0x0C(Value Changed)
0x6B = 0x2D(Value Changed)

0x6C = 0x78(Value unchanged)
0x6D = 0x09(Value unchanged)
0x6E = 0x2A(Value unchanged)
0x6F = 0x7B(Value unchanged)

3. LDRB R1, [R2]
Byte(8 bits) value from [R2] is loaded into Reg R1
R1 = 0x00000090(Value changed)
R2 = 0x00000060(Value unchanged)

Add a comment
Know the answer?
Add Answer to:
Problem: On an ARM processor using big endian format, given the following memory map and [R1]...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT