Question: Turn this fully working nios ii assembley program to C code (were not looking for C code that will compile to this assembly (it wont,

Turn this fully working nios ii assembley program to C code (were not looking for C code that will compile to this assembly (it wont, as there is no main function). Instead, provide C code that shows the variables, how they are initialized, and what the code looks like). Also, explain it in plain English:

.include "nios_macros.s" .global _start _start: /* the following two instr. (orhi and ori) are what movia converts to */ orhi r2, r0, %hi(X) ori r2, r2, %lo(X) movia r3, Y movia r4, N ldw r4, 0(r4) add r5, r0, r0 LABEL: ldw r6, 0(r2) stw r6, 0(r3) addi r2, r2, 4 addi r3, r3, 4 subi r4, r4, 1 bgt r4, r0, LABEL STOP: br STOP .data N: .word 6 X: .word 5, 3, -6, 19, 8, 12 Y: .word 0, 0, 0, 0, 0, 0

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!