.data prompt1: .asciiz "Input a: " prompt2: .asciiz "Input b: " output: .asciiz "The sum of a and b is " nl: .asciiz "\n" .text .globl main # Prints the contents of register $a0 printstr: li $v0, 4 syscall jr $ra printint: li $v0, 1 syscall jr $ra getint: li $v0, 5 syscall jr $ra main: sub $sp, $sp, 4 sw $ra, 0($sp) # Save the return address # Prompt for first int la $a0, prompt1 jal printstr # print the prompt jal getint # get user input move $s0, $v0 la $a0, prompt2 jal printstr jal getint move $s1, $v0 add $s2, $s0, $s1 la $a0, output jal printstr move $a0, $s2 jal printint la $a0, nl jal printstr lw $ra, 0($sp) add $sp, $sp, 4 jr $ra