.data # This shows you can use a .word and directly encode the value in hex # if you so choose num1: .word 0x3F800000#CHANGE ME num2: .float 1.0 num3: .word 0x00000000#CHANGE ME result1:.word 0 result2:.word 0#use this if you wish string: .asciiz "\n" .text main: la $t0, num1#load address of first floating number lwc1 $f2, 0($t0)#load num1 into a fp register lwc1 $f4, 4($t0) lwc1 $f6, 8($t0) lw $s0 0($t0)#load num1 into a regular register # Print out the values of the summands #num1 li $v0, 2 mov.s $f12, $f2 syscall jal printNewline #num1 hex li $v0, 34 move $a0 $s0 syscall jal printNewline #num2 (1.0) li $v0, 2 mov.s $f12, $f4 syscall jal printNewline jal printNewline # Do the actual addition add.s $f12, $f2, $f4 # Transfer the value from the floating point reg to the integer reg swc1 $f12, 12($t0) lw $s0, 12($t0) # At this point, $f12 holds the sum, and $s0 holds the sum which can # be read in hexadecimal #sum li $v0, 2 syscall jal printNewline #sum hex li $v0, 34 move $a0 $s0 syscall jal printNewline jal printNewline #PART 2 #add num1, num2, num3 in 2 different orders to get 2 different results. #Print out the hex values of the two sums. #exit li $v0, 10 syscall printNewline: li $v0, 4 la $a0, string syscall jr $ra