.text main: # Locals: # $t0: int a # $t1: int b # $t2: int tmp li $v0, 4 # syscall print string la $a0, prompt1_msg # printf("Enter a number: "); syscall li $v0, 5 # syscall read int syscall move $t0, $v0 # scanf("%d", &a); li $v0, 4 la $a0, prompt2_msg syscall # printf("Enter another number: "); li $v0, 5 # syscall read int syscall move $t1, $v0 # scanf("%d", &b); add $t2, $t0, $t1 # tmp = a + b; div $t2, $t2, 2 # tmp = tmp/2; li $v0, 4 la $a0, result_msg_1 # printf("The average is "); syscall li $v0, 1 # printf("%d",tmp); move $a0, $t2 syscall li $v0, 11 la $a0, '\n' syscall li $v0, 0 jr $ra # return 0; .data prompt1_msg: .asciiz "Enter a number: " prompt2_msg: .asciiz "Enter another number: " result_msg_1: .asciiz "The average is "