Question: #1: Write a MIPSzy assembly program to determine the range between pairs of numbers. Keep things very basic with instructions such as load (lw), store

#1: Write a MIPSzy assembly program to determine the range between pairs of numbers. Keep things very basic with instructions such as load (lw), store (sw), add (addi and add), subtract (sub), multiplication (mul), branch (beq and bne), jump (j), and set on less than (slt) instructions. Your program should meet the following functional requirements:

  • Input: an arbitrary number of integer pairs (in all pairs, the first number will be the max value)
  • Output: for each pair, output the range
  • You may assume an even number on input values

Below is a converter that will be used to run the assembly code in which you can base your code on:

#1: Write a MIPSzy assembly program to determine the range between pairs

Here is an example of MIPSzy code:

of numbers. Keep things very basic with instructions such as load (lw),

PARTICIPATION ACTIVITY 3.10.2: MIPSzy simulator with input and output. Assembly Input Registers $zero 0 Line 1 # Type your program here Data memory 5000 5004 0 0 0 0 0 InputReady Output 0 0 InputValue 0 OutputValue 0 0 ENTER SIMULATION STEP RUN More options Feedback? Assembly Input 3 25 4444 Registers Szero Line 1 addi $t1, Szero, 8192 Line 2 GetIn: lw $t3, ($ti) # kb ready? Line 3 beq $zero, $ts, Done Line 4 Line 5 addi $t2, Szero, 8196 Line 6 lw $t4, ($t2) # Get kb input Line 7 Line 8 add $t4, St4, $t4 # Double Line 9 Line 10 addi $ts, $zero, 8200 Line 11 sw $t4, ($t5) # Output double to sc Line 12 j Getin Line 13 Done: 0 8192 8196 0 8888 8200 Data memory 5000 0 5004 0 5008 8192 0 8196 4444 8200 8888 Output $13 InputReady InputValue OutputValue $t5 EXIT SIMULATION START AGAIN PARTICIPATION ACTIVITY 3.10.2: MIPSzy simulator with input and output. Assembly Input Registers $zero 0 Line 1 # Type your program here Data memory 5000 5004 0 0 0 0 0 InputReady Output 0 0 InputValue 0 OutputValue 0 0 ENTER SIMULATION STEP RUN More options Feedback? Assembly Input 3 25 4444 Registers Szero Line 1 addi $t1, Szero, 8192 Line 2 GetIn: lw $t3, ($ti) # kb ready? Line 3 beq $zero, $ts, Done Line 4 Line 5 addi $t2, Szero, 8196 Line 6 lw $t4, ($t2) # Get kb input Line 7 Line 8 add $t4, St4, $t4 # Double Line 9 Line 10 addi $ts, $zero, 8200 Line 11 sw $t4, ($t5) # Output double to sc Line 12 j Getin Line 13 Done: 0 8192 8196 0 8888 8200 Data memory 5000 0 5004 0 5008 8192 0 8196 4444 8200 8888 Output $13 InputReady InputValue OutputValue $t5 EXIT SIMULATION START AGAIN

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!