Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(a) Figure 4 on page 5 shows an ARM assembly program, which generates an arithmetic progression series of 20 numbers, with the first number of
(a) Figure 4 on page 5 shows an ARM assembly program, which generates an arithmetic progression series of 20 numbers, with the first number of 10 and constant difference of 5. These 32-bit numbers are stored in a table, starting at address 0x4000 0008. However, there are programming errors listed in Figure 4. Your task is to identify and correct these errors Based on your corrected program, answer the following questions (i) State the memory usage (in bytes) of the corrected program. (ii) State the address range of the table that is occupied by the data generated. (iii) What are the final data generated in the table? (iv) Modify the program to make the counter (R1) count down. Any advantage in using count-down loop, instead of the given count-up loop? AREA APTable, CODE, READONLY TABLE BASE EQU 0x40000008 base of table ENTRY MOV R1, #0x20 MOV R2 , #0x0A LDR R3 , TABLE BASE MOV R4 , #0x5 MOV R5, #0x0 STR R2, [R3] ADD R5 , R5 , #1 CMP R5, R1 BNE DONE ADD R2, R4, R4 STR R2, [R3 , R5 , LSL #1] ;number generate :first number constant difference LOOP LOOP DONE Figure 4 (a) Figure 4 on page 5 shows an ARM assembly program, which generates an arithmetic progression series of 20 numbers, with the first number of 10 and constant difference of 5. These 32-bit numbers are stored in a table, starting at address 0x4000 0008. However, there are programming errors listed in Figure 4. Your task is to identify and correct these errors Based on your corrected program, answer the following questions (i) State the memory usage (in bytes) of the corrected program. (ii) State the address range of the table that is occupied by the data generated. (iii) What are the final data generated in the table? (iv) Modify the program to make the counter (R1) count down. Any advantage in using count-down loop, instead of the given count-up loop? AREA APTable, CODE, READONLY TABLE BASE EQU 0x40000008 base of table ENTRY MOV R1, #0x20 MOV R2 , #0x0A LDR R3 , TABLE BASE MOV R4 , #0x5 MOV R5, #0x0 STR R2, [R3] ADD R5 , R5 , #1 CMP R5, R1 BNE DONE ADD R2, R4, R4 STR R2, [R3 , R5 , LSL #1] ;number generate :first number constant difference LOOP LOOP DONE Figure 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started