I never did MIPS Assembly, so I decided to try on this simple one.
I will comment on your code mostly from performance point of view (as smac89 covered simplicity/readability variant well).
In your case I wouldn't be afraid so much of branching (and it's not trivial to lower amount of branches down), but about number of integer divisions (
rem) and also syscall outputting integers (hidden divisions).
From the limited info I was able to found about real world MIPS architecture implementation it looks like for example PIC32 MIPS32 M4K Core does use about 1 cycle for 1 bit during divide operation, maybe with some early exit optimizations, so in worst case it's about ~32 cycles for 32b/32b divide.
I tried to use MARS and it works OK, but I don't see any serious performance information except simple instruction counters, plus
syscall is not counted into the stats at all.
So outputting integer is "for free", while in real world it would hurt so much that it would be probably better to keep just string representation of
t0 and increment it as string, avoiding binary integer (at least with my code it would work, as I don't do
rem on it, so I don't need integer form of "number").
Anyway I didn't go that far, only reworked your loop to avoid divisions, and also to avoid pseudo instructions when possible, so the amount of real instructions generated is similar to the source code.
fizzstring: .asciiz "Fizz"
buzzstring: .asciiz "Buzz"
move $t0, $zero # num = 0
li $t1,1 # really handy constant 1
li $t2,100 # max_num to loop
li $t3,3 # countdown to divisible by 3 (mod 3)
li $t5,5 # countdown to divisible by 5 (mod 5)
add $t0, $t0, $t1 # ++num
move $a0, $zero # did print some text = false
sub $t3, $t3, $t1 # --mod 3 counter
sub $t5, $t5, $t1 # --mod 5 counter
bnez $t3, Mod3NotZero
# when 0 == mod 3: reset counter and output "Fizz"
li $t3, 3
la $a0, fizzstring
li $v0, 4
bnez $t5, Mod5NotZero
# when 0 == mod 5: reset counter and output "Buzz"
li $t5, 5
la $a0, buzzstring
li $v0, 4
bnez $a0, SkipNumberPrint # don't print number when text was
# print number
move $v0, $t1
move $a0, $t0
# print new line char
li $a0, 10
li $v0, 11
bne $t0, $t2, loop # loop until (num == max_num)
li $v0, 10
So... I just guess it would run faster on real HW. But at least in simulator it does use about ~60% of instructions to run (~1500 vs ~2500), to use some measurable (but almost meaningless) number.