.data nums: .word 4,0x34A45,0x1234567,-5,-53 .text loop: add $t0,$zero,$t0 add $t1,$zero,$t1 li $t2,0x44 bne $t5,$zero,loop li $t0,0x10000000 addi $t0,$t0,-1 li $t0,0x80000000 addi $t0,$t0,-1 li $t0,0x10000000 addiu $t0,$t0,-1 li $t0,0x80000000 addiu $t0,$t0,0xffffffff li $t2,55 li $t0,0xffffffff li $t1,-1 beq $t0,$t1,label1 addi $t2,$zero,9 label1: la $t0,nums addi $t0,$t0,20 lhu $t3,-6($t0) lbu $t4,-11($t0) li $t0,55 li $t1,0xffffffff slt $t2,$t0,$t1 sltu $t3,$t0,$t1 .text # Recall that more than one instruction is needed to work with # immediates that are larger than 2 bytes # For positive numbers, this is the case if there is a 1 somewhere in # bits 15 through 31 (below we'll turn to why this is not bits 16 through 31): addi $t1,$zero,0x00010000 addi $t2,$zero,0x0010ffff addi $t3,$zero,0x00007fff # For negative numbers, leading 1s are like leading zeros. So, for # negative numbers, more than one instruction is needed of there is a 0 somwhere in bits 15 through # 31: addi $t4,$zero,0xffff7fff addi $t5,$zero,0xfffeffff addi $t6,$zero,0xffff8000 addi $t7,$zero,0x1 # This is the positive number 0x00008000 - we'll look further at this # case below. addi $t8,$zero,0x8000 # This is all f's in hex: addi $t9,$zero,-1 # This is the smallest possible negative number in 32 bits: addi $s0,$zero,-2147483648 # is is -32,768 addi $s1,$zero,0xffff8000 addiu $t7,$zero,0x1 addiu $t8,$zero,0x8000 addiu $t9,$zero,-1 addiu $s0,$zero,-2147483648 addiu $s1,$zero,0xffff8000 addi $a3,$zero,0x8000 addiu $a3,$zero,0x8000