summaryrefslogtreecommitdiff
path: root/tests/test5.asm
blob: 65c20bb4c1b110478d8b489eabd6dee927a81e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# This is a test program to test the capabilities of the assembler

addi $t0, $zero, 10		# load 10 into $t0
addi $t1, $zero, 12		# load 12 into $t1
add $t2, $t1, $t0
jal PrintInt
nop
j Exit # Exit the program
nop

PrintInt:
	add $a0, $t2, $zero
	addi $v0, $zero, 1
	syscall
	jr $ra
	nop

Exit:

	addi $v0, $zero, 10
	syscall