Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having trouble getting my code to work for the following program in MIPS. The issue is that I cna get the program working with using

Having trouble getting my code to work for the following program in MIPS.

The issue is that I cna get the program working with using psuedo code but in this progrma I cannot use psuedo code.

The issue is converting the pseduo code over to bare machine non-sudo code.

RULES OF PROBLEM

1) Use integer arithmetic only and round results.

2) Include at least one instruction from each instruction type: R-type arithmetic, I-type arithmetic, Memory transfer and Branch.

3) Include input and output through system calls.

4***) Do NOT use pseudo-instructions or not machine level instructions. The program must load and run with "Allow pseudo instructions" unchecked and "Bare machine" - checked (in Simulator/Settings).

5) Include comment explaining the type, format and the meaning of each instruction including the compiler directives.

6) Use the SPIM simulator to debug and run the program.

_________________________________________________________

Below is my code that I wrote - I am doing a Celcius -> Farenheight converter using a simplified algorithm **** f = c 2 + 32 ****

image text in transcribed

image text in transcribed

_________________________________________________________________________

Looking forward to seeing what I did wrong.

Thank you!

text globl main main la $a0, promptc syscal.l syscal.l #read input li $s1, 50 li $52, -50 #upper bound #lower bound bgt $v0, $s1, exit nop blt Sv0, $52, exit nop #if larger than 50, exit #if lower than -50, exit move $a0, v0 #prepare argument Jal conversion #subroutine call to convert C to F (in $v0) nop move $s0, 0 #F is moved into $s0 la $a0, msgF syscall move $a0, $50 syscall #print F main #go back to main to do next round nop text globl main main la $a0, promptc syscal.l syscal.l #read input li $s1, 50 li $52, -50 #upper bound #lower bound bgt $v0, $s1, exit nop blt Sv0, $52, exit nop #if larger than 50, exit #if lower than -50, exit move $a0, v0 #prepare argument Jal conversion #subroutine call to convert C to F (in $v0) nop move $s0, 0 #F is moved into $s0 la $a0, msgF syscall move $a0, $50 syscall #print F main #go back to main to do next round nop

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How does education add to a nations capital stock?

Answered: 1 week ago