.text .set noreorder .globl incrementSequence /* MIPS LSB-first o32 ABI, as it is seen on NetBSD/cobalt */ /* input: [R5:R4] */ incrementSequence: move $9,$0 addiu $8,$0,1 move $6,$5 move $7,$4 beq $4,$0,.next .loop: addiu $4,$4,-1 .rept 255 addu $9,$9,$8 .endr bne $4,$0,.loop addu $9,$9,$8 .next: addiu $10,$5,-1 bgtu $5,$10,.loop move $5,$10 srl $3,$7,24 sll $4,$6,8 sll $2,$7,8 j $31 or $3,$3,$4 /* output: MSB [R3:R2] LSB */