Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1- Belowis some assembly code. Describe what it does, both in plain english, as well as provide some C code which performs that functionalityIm

image text in transcribedimage text in transcribed

QUESTION 1- Belowis some assembly code. Describe what it does, both in plain english, as well as provide some C code which performs that functionalityIm not looking for code that will compile to this (which it won't because we're not using a main function. Instead, I just want C code which which shows what variables there are, how theyre initialized, and what the code looks like - basically the same functionality. 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 ofincluding 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 putit into your project's directory first). Im providing this file as a2q1.S .include "nios macros.s" .global start start: /* the fllowing two instr. ( rhi and ri) are what movi a convert t *) orhi r2, r0, thi (X ori r2, r2, ilo (X] movia r3, Y mo via r4, N add r5, r0, r0 LABEL: stw r, 0 (r3) addi r2, r2, 4 addi r3, r3, 4 subi r4, r4, 1 ogt r4, r0, LABEL STOP: br STOP .data word word 5, 3, -6, 19, B, 12 word 0, 0, 0, 0, 0, 0 QUESTION 1- Belowis some assembly code. Describe what it does, both in plain english, as well as provide some C code which performs that functionalityIm not looking for code that will compile to this (which it won't because we're not using a main function. Instead, I just want C code which which shows what variables there are, how theyre initialized, and what the code looks like - basically the same functionality. 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 ofincluding 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 putit into your project's directory first). Im providing this file as a2q1.S .include "nios macros.s" .global start start: /* the fllowing two instr. ( rhi and ri) are what movi a convert t *) orhi r2, r0, thi (X ori r2, r2, ilo (X] movia r3, Y mo via r4, N add r5, r0, r0 LABEL: stw r, 0 (r3) addi r2, r2, 4 addi r3, r3, 4 subi r4, r4, 1 ogt r4, r0, LABEL STOP: br STOP .data word word 5, 3, -6, 19, B, 12 word 0, 0, 0, 0, 0, 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What information is shown in Form W-2?

Answered: 1 week ago

Question

1. Define mass and mediated communication

Answered: 1 week ago