# demo4.asm outputs a text message 5 times # .text .globl main main: li $s1, 1 # loop decrement amount li $s0, 5 # loop count index loop: la $a0, msg # print the text message li $v0, 4 syscall sub $s0,$s0,$s1 # decrement the index bne $s0,$zero,loop # test and repeat if needed... li $v0, 10 # terminate the program. syscall .data msg: .asciiz "hello world!\n"