# ############################################################### # # Program_03_sample_01.ASM # # # # Test program for floating-point fundamentals # # # # This is a PC-SPIM sample program for performing "li" for # # MIPS floating-point registers # # ############################################################### # .data NUM_01: .float 100.5 NUM_02: .float 100.7 MSG_01: .asciiz "The first fraction number is larger than the second one" MSG_02: .asciiz "The second fraction number is larger than the first one" .text .globl main main: la $a0, NUM_01 # load the first fraction contsnat lwc1 $f10, ($a0) # load it to $f10 register la $a0, NUM_02 # load the second fraction contsnat lwc1 $f11, ($a0) # load it to $f10 register c.lt.s $f10, $f11 # if (1st) < (2nd), set "cond flag" bc1t SECOND_LARGER # jump to SECOND_LARGER li $v0, 4 # system call #4 - print a message la $a0, MSG_01 # specify MESSAGE #1 syscall j EXIT_THIS_P SECOND_LARGER: li $v0, 4 # system call #4 - print a message la $a0, MSG_02 # specify MESSAGE #1 syscall EXIT_THIS_P: jr $31