.data a: .word -1 b: .word -2 x: .word 0 .globl start .ent start start: lw $8, a lw $9, b lw $10, x slt $11, $8, $0 // a >= 0 beq $11, $0, L1 j L3 L1: // se a >= 0 slt $11, $8, $9 // a < b bne $11, $0, L2 j L3 L2: addi $10, $10, 1 // x = x + 1 j Exit L3: // else if (a < 0 && a > b) slt $11, $8, $0 // a < 0 bne $11, $0, L4 j L5 L4: // ver se a > b slt $11, $9, $8 // b < a beq $11, $0, L5 // vendo se b < a beq $8, $9, L5 // vendo se b = a addi $10, $10, 2 // x = x + 2 j Exit L5: addi $10, $10, 3 // x = x + 3 j Exit Exit: sw $10, x .end start