Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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