Public feed #726395

Stuff

public text v1 · immutable
Raw Edit
·published 2007-10-05 04:11 UTC
rendered paste body
.data
.globl main
.text

main:
	li 		$t0, 1			# initialize the $counter
	li		$t1, 0			# initialize $inner_counter
	li		$s0, 0			# initialize the $total
loop:
	addi	$t0, $t0, 1		# add one to our $counter
	beq		$t1, 5, subtr	# if($inner_count == 5) goto subtr
	add		$s0, $s0, $t0	# add the $counter to the $total
	j		restloop
subtr:

restloop:
	ble 	$t0, 100, loop	# if we are less than or equal to 100, jump to the start of the loop

print:
	#print the output
	move	$a0, $s0
	li		$v0, 1
	syscall

out:
	li		$v0, 10		# end it 
	syscall