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

Assignment 2. Write an assembly program which stores 0x30 in all memory location

ID: 3739275 • Letter: A

Question

Assignment 2. Write an assembly program which stores 0x30 in all memory locations between memory addresses A0 and Al, including A0 and Al. Al is greater than A0. Assume Al is 0x0000.2020 and A0 is 0x0000.2000. Simulate the program in ARMSim to verify its correctness and do the following: 1. List the complete program in this answer sheet. Make sure you comment each instruction properly. 2. Attach the screenshot of your final simulation result. You can open a MemoryView window by pressing View ->Memory in ARMSim. You can then type in the address of A0 and view the content of memory locations start from A0.

Explanation / Answer

Answer

given by

In ARM memory address space each sequential address resolve be augmented by 4 in hexadecimal form.

we will store 0x32 number at spot showing in the below mention program.

Mnemonic Operands        Comment

MOV r0, #0x32           ; r0 = 0x32

MOV            r1, #0x00002000       ; r1 = the target address

STR            r0, [r1]            ; *r1 = r0 means it store 0x32 at location given to adress given in r1 register

MOV            r1, #0x00002004       ; r1 = after that sequential target address

STR            r0, [r1]

MOV            r1, #0x00002008       ; r1 = after that sequential target address

STR            r0, [r1]

MOV            r1, #0x00002012       ; r1 = after that sequential target address

STR            r0, [r1]

MOV            r1, #0x00002016       ; r1 = after that sequential target address

STR            r0, [r1]

MOV            r1, #0x00002020       ; r1 = after that sequential target address

STR            r0, [r1]