Question: Replace the highlighted lines with the correct code. Hint: You dont need more than one instruction line for each highlighted line. AREA Lab 05 YourFirstName

Replace the highlighted lines with the correct code.
Hint: You dont need more than one instruction line for each highlighted line.
AREA Lab 05 YourFirstName YourLastName, CODE, READONLY EXPORT main main MOV RO,- Replace with base register MOV R1, #1 R1 will be used to increment the loop MOV R2, #20; R2 will represent the number of iterations Mov R3, #0 R3 will be used to hold the sum of the array storeValuesLoop :Store the value of R1 to address of RO, then auto increment the address by 4. Hint use STR instruction. ADD R1, #1 Increment the Loop by adding 1 to R1 CMP R1, R2 Compare R1 & R2 to determine if we need to exit the loop or not BLE store ValuesLoop; Stay in the loop if R1 is less than or equal t R2 o MOV R1, #1 Reset R1 to start from the beginning again for the 2nd loop. Reset with the code to reset the pointer to be able to use it in the 2n loop below read Values Loop Read the value of current iteration to R4. Hint use LDR instruction. ADD R3, R4 Add the value your read [R4] to the sum [R3] ADD R1, #1 Increment the Loop by adding 1 to R1 CMP R1, R2 Compare R1 & R2 to determine if we need to exit the loop or not BLE readValuesLoop; Stay in the loop if R1 is less than or equal to R2 stop B stop END We are trying to evaluate the following formula, where R1 1, and R2320: R2 20 R3 210 n-R1 n-1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
