summaryrefslogtreecommitdiff
path: root/test/masm/hello.asm
blob: 2d64ae513da7faca1a90ec4e7720f7b92acc38ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) 2024 Freya Murphy

# file: div.asm
# test: should print hello world

.data
.align 1

hw:
	.asciiz "Hello, world!\n"

.text
.align 2
.globl main

main:
	# print hello world
	li	$v0, 1
	li	$a0, 1	# stdout
	la	$a1, hw # load string
	li	$a2, 14 # load length
	syscall

	# return 1
	li	$v0, 0
	jr	$ra