about summary refs log tree commit diff
path: root/lang/mips/chapter-2/exercise-1/g.s
blob: e9d8f8f7f8d7b1bfeda5a777d2058f9364d55657 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# t8 = *a0
	.data
array:	.word	4, 20, 6, 9

	.text
main:
	la	$a0,	array		# a0 = array
	lw	$t8,	($a0)		# t8 = *a0

	li	$v0,	1		# print integer
	move	$a0,	$t8		# at t8
	syscall

	li	$v0,	11		# print character
	li	$a0,	10		# newline
	syscall

	li	$v0,	10		# terminate program run
	syscall