Start with a value at 0. Loop while value mod 6 is not equal to 0.
Each time through the loop, add 1 to the value then print it.
The loop must execute at least once.



Related tasks

   Loop over multiple arrays simultaneously
   Loops/Break
   Loops/Continue
   Loops/Do-while
   Loops/Downward for
   Loops/For
   Loops/For with a specified step
   Loops/Foreach
   Loops/Increment loop index within loop body
   Loops/Infinite
   Loops/N plus one half
   Loops/Nested
   Loops/While
   Loops/with multiple ranges
   Loops/Wrong ranges


Reference

 Do while loop Wikipedia.


 
	.text
main:	li 	$s0, 0		# start at 0. 
	li	$s1, 6 
loop:	addi	$s0, $s0, 1	# add 1 to $s0
	div	$s0, $s1	# divide $s0 by $s1. Result is in the multiplication/division registers
	mfhi	$s3		# copy the remainder from the higher multiplication register to $s3
	move	$a0, $s0	# variable must be in $a0 to print
	li	$v0, 1		# 1 must be in $v0 to tell the assembler to print an integer
	syscall			# print the integer in $a0
	bnez	$s3, loop	# if $s3 is not 0, jump to loop
 
	li	$v0, 10
	syscall			# syscall to end the program
 