In MIPS, how would you add and multiply two integer numbers like 5 & 6 and display on the screen?
.data num1: .asciiz "Enter first number: " num2: .asciiz "Enter second number: " newline: .asciiz "\n" sum: .asciiz "Sum of two numbers is " product: .asciiz "Product of two numbers is " .text la $a0, num1 li $v0, 4 syscall li $v0, 5 syscall addi $s0, $v0, 0 la $a0, num2 li $v0, 4 syscall li $v0, 5 syscall addi $s1, $v0, 0 add $t0, $s0, $s1 mul $t1, $s0, $s1 la $a0, sum li $v0, 4 syscall addi $a0, $t0, 0 li $v0, 1 syscall la $a0, newline li $v0, 4 syscall la $a0, product li $v0, 4 syscall addi $a0, $t1, 0 li $v0, 1 syscall la $a0, newline li $v0, 4 syscall
Get Answers For Free
Most questions answered within 1 hours.