# ex1.s -- Example program for running the spim simulator .data prompt: .asciiz "Please enter an integer: " nl: .asciiz "\n" .text main: li $v0, 4 # print the prompt on the screen la $a0, prompt sycall li $v0, 5 # get an integer from the user syscall move $s0, $v0 # move the input from a0 to s0 li $v0, 4 # print another prompt la $a0, prompt syscall li $v0, 5 # get 2nd number from user syscall move $s1, $v0 # move user's input into s1 add $s2, $s0, $s1 # add the 2 numbers, sum into s2 li $v0, 1 # print the integer value in $s2 move $a0, $s2 syscall li $v0, 4 # print newline string la $a0, nl syscall li $v0, 10 # now, exit the program syscall