# lab1-01.asm # Evaluate the expression (10 + 9) and print the result. # Equivalent C statement: printf("%d\n", 10 + 9); # Equivalent Java statement: System.out.println(10+9); # Student: Name Date # There are four parts to this program. # Evaluate the expression. # Print the result. # Print endl. # Return. .TEXT .GLOBL main main: # Evaluate the expression. # Put the final result in a0 to prepare for the syscall. li $t0, 10 # Put 10 in a temporary register li $t1, 9 # Put 9 in a temporary register add $a0, $t0, $t1 # a0 = t0 + t1 # Print the integer result in a0 li $v0, 1 # Load the system call number syscall # Print endl. la $a0, endl # Load the address of the string li $v0, 4 # Load the system call number syscall # Return to operating system li $v0, 10 # Load the system call number. syscall # Return. .DATA msg1: .ascii "abcda" endl: .asciiz "\n"