In: Computer Science
Write a MIPS program that will ask the user to enter two numbers at the console and pass the values to a function that does multiplication
.data
prompt: .asciiz "Enter 2 numbers number "
.text
main:
#promoting number
li $v0,4
la $a0,prompt
syscall
#reading number
li $v0, 5
syscall
move $a1, $v0
#reading number
li $v0, 5
syscall
move $a2, $v0
jal mulNumbers
li $v0,1
add $a0,$v1,$zero
syscall
#tells the system that the program
is done
li $v0 10
syscall
mulNumbers:
mul $v1,$a1,$a2
jr $ra
# returns the control to the calling function
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me