Write an assembly program which stores 0 times 30 in all memory locations betwee
ID: 3929161 • Letter: W
Question
Write an assembly program which stores 0 times 30 in all memory locations between memory addresses AO and A1, including AO and A1. A1 is greater than AO. Assume A1 is 0x0000.2020 and A0 is 0x0000.2000. Simulate the program in ARMSim to verify its correctness and do the following: List the complete program in this answer sheet. Make sure you comment each instruction properly. 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
In ARM memory address space every sequential address will be increased by 4 in hexadecimal form. So we will store 0x32 number at locations showing in the below mentined 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 = next sequential target address
STR r0, [r1]
MOV r1, #0x00002008 ; r1 = next sequential target address
STR r0, [r1]
MOV r1, #0x00002012 ; r1 = next sequential target address
STR r0, [r1]
MOV r1, #0x00002016 ; r1 = next sequential target address
STR r0, [r1]
MOV r1, #0x00002020 ; r1 = next sequential target address
STR r0, [r1]
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.