Explanation:
.data
msg1: .asciiz "Enter the floating point value = "
msg2: .asciiz "\nEnter the shape (Circle - 1, Triangle - 2, Square - 3) = "
msg3: .asciiz "\nThe perimeter of the triangle with side = "
msg4: .asciiz " meters is "
msg5: .asciiz " meters.\n"
msg6: .asciiz "\nThe area of the triangle with side = "
msg7: .asciiz " square meters.\n"
msg8: .asciiz "\nThe circumference of the circle with radius = "
msg9: .asciiz "\nThe area of the circle with radius = "
msg10: .asciiz "\nThe perimeter of the square with side = "
msg11: .asciiz "\nThe area of the square with side = "
pi: .float 3.1415816
eq_tr_area: .float 0.43305186
two: .float 2
three: .float 3
four: .float 4
.text
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg1 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
li $v0,6 Â Â Â Â Â # system call code for reading floating point number
syscall      # call operating system to perform read operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg2 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
li $v0,5 Â Â Â Â Â # system call code for reading integer
syscall      # call operating system to perform read operation
move $t0,$v0
IF:
bne $t0,1,ELSE_IF Â #if not 1 then goto elseif
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg8 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
li $v0, 2 Â Â Â # system call code for printing float = 2
mov.s $f12,$f0 Â Â Â #move the single precision f2 in f12
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg4 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
l.s $f1,pi
l.s $f3,two
mul.s $f3,$f3,$f1 Â #calculate 2*pi*radius
mul.s $f3,$f3,$f0
li $v0, 2 Â Â Â # system call code for printing float = 2
mov.s $f12,$f3 Â Â Â #move the single precision f2 in f12
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg5 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg9 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
li $v0, 2 Â Â Â # system call code for printing float = 2
mov.s $f12,$f0 Â Â Â #move the single precision f2 in f12
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg4 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
mul.s $f2,$f0,$f0 Â #calculate radius *radius
mul.s $f2,$f2,$f1 Â #calculate pi *r^2
li $v0, 2 Â Â Â # system call code for printing float = 2
mov.s $f12,$f2 Â Â Â #move the single precision f2 in f12
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg7 Â Â Â # load address of string to be printed into $a0
syscall Â
ELSE_IF:
bne $t0,2,ELSE Â Â Â #if not 2 then check else
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg3 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
li $v0, 2 Â Â Â # system call code for printing float = 2
mov.s $f12,$f0 Â Â Â #move the single precision f2 in f12
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â # system call code for printing string = 4
la $a0,msg4 Â Â Â # load address of string to be printed into $a0
syscall      # call operating system to perform print operation
l.s $f3,three
mul.s $f3,$f3,$f0 Â #calculate 3*side
li $v0, 2 Â Â Â # system call code for printing float = 2
mov.s $f12,$f3 Â Â Â #move the single precision f2 in f12
syscall      # call operating system to perform print operation
li $v0,4 Â Â Â Â Â Â
la $a0,msg5 Â Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â Â
la $a0,msg6 Â Â Â Â
syscall     Â
li $v0, 2 Â Â Â Â
mov.s $f12,$f0 Â Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â Â
la $a0,msg4 Â Â Â
syscall      Â
l.s $f3,eq_tr_area  Â
mul.s $f2,$f0,$f0 Â Â
mul.s $f2,$f2,$f3 Â Â
li $v0, 2 Â Â Â
mov.s $f12,$f2 Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â Â
la $a0,msg7 Â Â Â Â
syscall Â
ELSE:
bne $t0,3,END Â Â Â Â
li $v0,4 Â Â Â Â Â Â
la $a0,msg10 Â Â Â Â
syscall      Â
li $v0, 2 Â Â Â Â
mov.s $f12,$f0 Â Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â Â
la $a0,msg4 Â Â Â Â
syscall      Â
l.s $f3,four   Â
mul.s $f3,$f3,$f0 Â Â
li $v0, 2 Â Â Â Â
mov.s $f12,$f3 Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â
la $a0,msg5 Â Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â
la $a0,msg11 Â Â Â
syscall      Â
li $v0, 2 Â Â Â Â
mov.s $f12,$f0 Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â
la $a0,msg4 Â Â Â Â
syscall     Â
mul.s $f2,$f0,$f0 Â Â
li $v0, 2 Â Â Â Â
mov.s $f12,$f2 Â Â Â
syscall      Â
li $v0,4 Â Â Â Â Â Â
la $a0,msg7 Â Â Â Â
syscall Â
END:
li $v0,10 Â Â Â Â
syscall     Â