Question: Below is some assembly code. Describe what it does, both in plain English, as well as provide some C code which performs the same functionality.

 Below is some assembly code. Describe what it does, both in

Below is some assembly code. Describe what it does, both in plain English, as well as provide some C code which performs the same functionality. We're not looking for C code that will compile to this assembly (it won't, as there is no main function). Instead, provide C code that shows the variables, how they are initialized, and what the code looks like The below program is a fully working assembly program-you can load it into the Altera Monitor Program to see how it works. To do that, create a new project of type assembly, and then instead of including a getting started example, you'd skip that part and when it gets to add a file, add this file (you have to save it as a .S file and put it into your project's directory first). You can download this file from Assignment/ProgrammingProjectl/plq2.S include "nios macros.s" global _start start: /*the following two instr. (orhi and ori) are what movia converts to orh r2, r0 , %hi (X) orl moviar3, Y moviar4, N ldwr4, 0(r4) add r2, r2, %10 (X) r5, r0, r0 LABEL ldwr6, 0(r2) stwr6, 0(r3) addir2, r2, 4 addi r3, r3, 4 subir4, r4, 1 r4, r0, LABEL STOP br STOP data N: word 6 word 5, 3, -6, 19, 8, 12 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!