summaryrefslogtreecommitdiff
path: root/test/masm/hello.asm
diff options
context:
space:
mode:
Diffstat (limited to 'test/masm/hello.asm')
-rw-r--r--test/masm/hello.asm26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/masm/hello.asm b/test/masm/hello.asm
new file mode 100644
index 0000000..2d64ae5
--- /dev/null
+++ b/test/masm/hello.asm
@@ -0,0 +1,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