# ********************************************* # demo3.asm inputs 2 integers, outputs sum # uses string annotation for inputs and outputs # .text .globl main main: la $a0, msg # prompt user for a int... li $v0, 4 syscall li $v0, 5 # read an int into V0 syscall move $a1, $v0 # move this int into A1 la $a0, msg # prompt user for another int... li $v0, 4 syscall li $v0, 5 # read a second int into V0 syscall move $a2, $v0 # and copy into A2 la $a0, rslt # show the result message li $v0, 4 syscall add $a0, $a1,$a2 # sum these two ints into A0 li $v0, 1 # and print the sum syscall li $v0, 10 # system call code for exit syscall .data msg: .asciiz "enter an int: " rslt: .asciiz "the result is: "