# text segment (code) .text .globl __start __start: lw $t0, X # I-type memory transfer (pseudo instruction) # lui $s0, 0x1000 # machine instruction # lw $t0, 0($s0) # I-type memory transfer (machine instruction); lw $t1, Y # I-type memory transfer (pseudo instruction) # lw $t1, 4($s0) # I-type memory transfer (machine instruction); beq $t0, $t1, equal la $a0,msg2 # load msg2 (pseudo instruction) # lui $a0, 0x1000 # machine instruction # ori $a0, $a0, 29 # machine instruction addi $v0, $0, 4 # syscall to print string syscall beq $0, $0, exit # unconditional branch equal: la $a0,msg1 # load msg1 (pseudo instruction) # lui $a0, 0x1000 # machine instruction # ori $a0, $a0, 8 # machine instruction addi $v0, $0, 4 # syscall to print string syscall exit: addi $v0,$0, 10 syscall # ends the program # data segment .data 0x10000000 X: .word 0xff Y: .word 255 msg1: .asciiz "$t0 is equal to $t1\n" msg2: .asciiz "$t0 is not equal to $t1\n"