#Application 3 .text 0x00400000 #Code section #Read the first number (Α) li $v0,5 #Load the function number syscall #Function call move $t1,$v0 #Load the first number in $t1 #Read the second number (Β) li $v0,5 #Load the function number syscall #Function call move $t2,$v0 #Load the second number in $t2 #Read the third number (C) li $v0,5 #Load the function number syscall #Function call move $t3,$v0 #Load the third number in $t3 #Calculate X1=A-B-C sub $t0,$t1,$t2 #$t0=$t1-$t2, (Α-Β) sub $t0,$t0,$t3 #$t0=$t0-$t3, ((Α-Β)-C) #Display message "\nX1=" li $v0,4 #Load the function number la $a0,x1 #Load the message starting address syscall #Function call #Display result X1 li $v0,1 #Load the function number move $a0,$t0 #Load the result to be displayed syscall #Function call #Calculate X2=A+B-(C/2) add $t0,$t1,$t2 #$t0=$t1+$t2, (A+B) div $t4,$t3,2 #$t4=$t3/2, (C/2) sub $t0,$t0,$t4 #$t0=$t0-$t4, ((A+B)-(C/2)) #Display message "\nX2=" li $v0,4 #Load the function number la $a0,x2 #Load the message starting address syscall #Function call #Display result X2 li $v0,1 #Load the function number move $a0,$t0 #Load the result to be displayed syscall #Function call #Calculate X3=(3*A)+(B*C) mul $t0,$t1,3 #$t0=$t1*3, A*3 mul $t1,$t2,$t3 #$t1=$t2*$t3, B*C add $t0,$t0,$t1 #$t0=$t0+$t1, (A*3)+(B*C) #Display message "\nX3=" li $v0,4 #Load the function number la $a0,x3 #Load the message starting address syscall #Function call #Display result X3 li $v0,1 #Load the function number move $a0,$t0 #Load the result to be displayed syscall #Function call #Program termination li $v0,10 #Load the function number syscall #Function call .data #Data section x1: .asciiz "\nX1=" x2: .asciiz "\nX2=" x3: .asciiz "\nX3="