Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This MIPS program calculates the factorial of 2 (2!). Change the program to load immediate 4 into $a0 but instead of li use the instruction

This MIPS program calculates the factorial of 2 (2!). Change the program to load immediate 4 into $a0 but instead of li use the instruction compatible for QTSpim. Also change $v0 to $v1.

image text in transcribed

(I think the instruction is lui to load 4 into $a0)

something: 1000 1004 1008 1012 1016 1020 1024 1028 1032 1036 1040 addi SW SW slti beg addi addi ir addi jal lw $sp,$sp, -8 $ra,4 ($sp) $a0,0 ($sp) $t0,$a0,1 $t0,$zero, L1 $v0, $zero, 1 $sp,$sp, 8 $ra $a0,$a0,-1 something $a0,0 ($sp) $ra, 4 ($sp) $sp,$sp, 8 $v0, $a0, $v0 L1: 1044 lw 1048 1052 1056 addi mul jr fra something: 1000 1004 1008 1012 1016 1020 1024 1028 1032 1036 1040 addi SW SW slti beg addi addi ir addi jal lw $sp,$sp, -8 $ra,4 ($sp) $a0,0 ($sp) $t0,$a0,1 $t0,$zero, L1 $v0, $zero, 1 $sp,$sp, 8 $ra $a0,$a0,-1 something $a0,0 ($sp) $ra, 4 ($sp) $sp,$sp, 8 $v0, $a0, $v0 L1: 1044 lw 1048 1052 1056 addi mul jr fra

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_2

Step: 3

blur-text-image_3

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions