#Poorak Mody CSE220 Lab-1 .data promptx: .asciiz "Enter x: " prompty: .asciiz "Enter y: " xplusy: .asciiz "\n x + y is: " xminusy: .asciiz "\n x - y is: " xpytxmy: .asciiz "\n (x+y)*(x-y) is: " xsquared: .asciiz "\n x^2 is: " xsqtysq: .asciiz "\n (x^2)*(y^2) is: " .text #Class work----------------------------------- main: li $v0, 4 #load system code for printing strings la $a0, promptx #load address of string to be printed syscall #print string li$v0, 5 #load sys code for reading ints syscall #reads the int move $t0, $v0 #t0=v0 li $v0, 4 #load system code for printing strings la $a0, prompty #load address of string to be printed syscall #prints string li$v0,5 #load sys code for reading ints syscall #reads the int move $t1, $v0 #sets t1=v0 li $v0, 4 #lode sys code for printing strings la $a0, xplusy #load address of string to be printed syscall #prints the string add $t2, $t0, $t1 #adds t1 + t0 and stores it in t2 li $v0, 1 #system code for printing int move $a0, $t2 #makes $t2=$a0 syscall li $v0, 4 #load sys code for printing strings la $a0, xminusy #load address of string to be printed syscall #prints the string sub $t3, $t0, $t1 #Subtracts t1 - t0 and stores it in t3 li $v0, 1 #lode sys code for printing int move $a0, $t3 #$a0 = $t3 syscall #HW ------------------------------------------------------------- li $v0, 4 #load sys code for printing strings la $a0, xpytxmy #load address of string to be printed syscall #prints the string mul $t4, $t2, $t3 #multiplies the results from t0+t1 by the result of t0-t1 and stores it in t4 li $v0, 1 #load sys code for printing ints move $a0, $t4 #$a0 = $t8 syscall li $v0, 4 #load sys code for printing strings la $a0, xsquared #load address of string to be printed syscall #prints the string mul $t5, $t0, $t0 #squares t0 and stores it in t4 li $v0, 1 #load sys code for printing ints move$a0, $t5 #$a0 = $t4 syscall li $v0, 4 #load sys code for printing strings la $a0, xsqtysq #load address of string to be printed syscall #prints the string mul $t6, $t1, $t1 #compute y^2 mul $t7, $t5, $t6 #squares (x^2)*(y^2) li $v0, 1 #load sys code for printing ints move$a0, $t7 #$a0 = $t4 syscall