3 Enhance the program to allow it to receive the two argumen

 3) 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.           .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                  

Solution

.data arg2: .word 0 .text li $v0, 5 # system call for reading the int value syscall # reading Integer la $t0, arg2 sw $v0, 0($t0) # here storing the integer at the location arg2
 3) 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 arg

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site