Question: for the following question I cant figured a solution need some help. (ARM simulator must be used) Question: Take the array program given above, and

for the following question I cant figured a solution need some help. (ARM simulator must be used)
Question:
Take the array program given above, and reserve space for a second array of the same size, labelled sum. Write a loop-initialising sum to the sum of all preceding elements of array.
In Java sum[i] = sum[i-1] + array[i] having initialised sum[0] to array[0].
You can confirm that you have correctly implemented this by outputting the final value, which should be 210 for an array of size 20.
 for the following question I cant figured a solution need some

Step Over Step Out Shit F2 Step Into F2 Continue 3 Stop F4 Restart Ctrl-R Reload Ctrl-Shift- File Help Ctrl-F2 untitled. [changed since save) (changed Editor (Ctrl-E) Compile and Load (F5) Language: Nios II 1 global _start 2 start: 3 // array initialization 4 .text 5 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 QOS06.0.0.0 Call stack it Trace Watchpoints it Symbols 6 LDR R1,=array // get address of array 7 LDR R2,=1 // initialize R1 to 1 8 LDR R3,20 // initialize R3 to 20 9 loop: 10 11 STRB R2,[R1,#0] / STR?B store "byte! 12 ADD R2, R2,1 W Add to R2 13 ADD R1, R1,1 // Add to Ri 14 CMP R2,R3 // compare R2 and R3 15 BNE loop // loop while not equal (R2 and R3) 16 nop // no instruction 17 //initialise array memory 18 .data 19 20 value: .byte 1 21 array: .skip 20 // Reserve 2e consecutive bytes of memory 22 // (declare empty block of memory) 23 Olay Options decimal per row: 4 Editor (Ctrl-E) >Disassembly (Ctrl-D) Q Memory (Ctrl-M) Step Over Step Out Shit F2 Step Into F2 Continue 3 Stop F4 Restart Ctrl-R Reload Ctrl-Shift- File Help Ctrl-F2 untitled. [changed since save) (changed Editor (Ctrl-E) Compile and Load (F5) Language: Nios II 1 global _start 2 start: 3 // array initialization 4 .text 5 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 QOS06.0.0.0 Call stack it Trace Watchpoints it Symbols 6 LDR R1,=array // get address of array 7 LDR R2,=1 // initialize R1 to 1 8 LDR R3,20 // initialize R3 to 20 9 loop: 10 11 STRB R2,[R1,#0] / STR?B store "byte! 12 ADD R2, R2,1 W Add to R2 13 ADD R1, R1,1 // Add to Ri 14 CMP R2,R3 // compare R2 and R3 15 BNE loop // loop while not equal (R2 and R3) 16 nop // no instruction 17 //initialise array memory 18 .data 19 20 value: .byte 1 21 array: .skip 20 // Reserve 2e consecutive bytes of memory 22 // (declare empty block of memory) 23 Olay Options decimal per row: 4 Editor (Ctrl-E) >Disassembly (Ctrl-D) Q Memory (Ctrl-M)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!