Question: 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 ****

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

MIPS. The issue is that I cna get the program working with

_________________________________________________________________________

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

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!