summaryrefslogtreecommitdiff
path: root/tests/test4.asm
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2024-05-10 18:13:49 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2024-05-10 18:13:49 -0400
commitf7b17ef5b489d7bdeeda7e7f4b073727b0de29f9 (patch)
tree1bc1bd191780ef469bee6adcf137f9da35200cf7 /tests/test4.asm
parent532f8276fb76f9dd0bbdfefc2bf970fb42858a7d (diff)
Initial Implementation of Labels
Diffstat (limited to 'tests/test4.asm')
-rwxr-xr-xtests/test4.asm16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test4.asm b/tests/test4.asm
new file mode 100755
index 0000000..af5dcc4
--- /dev/null
+++ b/tests/test4.asm
@@ -0,0 +1,16 @@
+addi $t0, $zero, 10
+addi $t1, $zero, 12
+add $t2, $t1, $t0
+beq $zero, $zero, PrintInt
+nop
+caller: beq $zero, $zero, Exit
+nop
+
+PrintInt: add $a0, $t2, $zero
+addi $v0, $zero, 1
+syscall
+beq $zero, $zero, caller
+nop
+
+Exit: addi $v0, $zero, 10
+syscall