So I have written a simple program for my comp arch class in MIPS assembly. We are now required to enhance this program so that it takes two arguments. If the arguments are both the same then the answer should be the same as that of the original program that takes only one argument. If they are different then you should figure out what your program should do based on the above. Try to make as few changes as possible. Enhance the program to allow it to receive the two arguments from the keyboard and display the result in the console window of SPIM. If any of the input arguments is a negative number (less than zero), your enhanced program should display a zero in the console.
Here is my code from the un-enhanced part:
.data
arg: .word 5
.text
.globl main
main:
la $t3, arg
lw $t2, 0($t3)
lw $t3, 0($t3)
addi $t1, $zero, 0
beqz $t2, fin
fori:
add $t1, $t1, $t2
addi $t3, $t3, -1
bnez $t3, fori
fin:
li $v0, 10
syscall