Question: Write a MIPSzy assembly program to perform integer division and modulo arithmetic. Keep things basic. Your program should meet the following requirements: Input: an arbitrary

Write a MIPSzy assembly program to perform integer division and modulo arithmetic. Keep things basic. Your program should meet the following requirements:

  • Input: an arbitrary number of integer pairs where the first number in the pair is the dividend and the second number is the divisor
  • Output: for each pair, output the integer quotient followed by the remainder

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

Write a MIPSzy assembly program to perform integer division and modulo arithmetic.

Here is an example of MIPSzy code:

Keep things basic. Your program should meet the following requirements: Input: an

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 Accounting Questions!