Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write two lines of ARM assembly language equivalent to the following code segmen

ID: 1715338 • Letter: W

Question

Write two lines of ARM assembly language equivalent to the following code segment. Given the memory map shown below, determine the contents of r0 and r2 after the following ARM assembly language instructions have executed. Indicate all changes to the memory map after the program is complete. Assume that r0 and r2 initially contain Ox00008A0D and Ox0000000A respectively. The byte ordering is little endian. LDRSH r2, [r0, #1] STR r2, [r0, #-5] Ox00008A10 OxE2855001 0x00000A0C OxFFFCA37F Ox00008A08 Ox9EA9C786 Ox00008A04 OxAF015613 Ox00008A04 Ox00008A07

Explanation / Answer

3.

ADD r0,r0,#5

SUB r9, r0,#3

4. r0 =0x00008A0D

[r0,#1] = 0x00008A0E

LDRSH r2, [r0,#1]                 r2 = 0x0000000A = 0x00008A0E

r0 =0x00008A0D

[r0,#-5] = 0x00008A08

STR r2, [r0,#-5]             r2 content will stored in [r0,#-5] i.e., 0x00008A08

address 0x00008A08 will contain a content 0x00008A0E