From c41d9302ae9d62a2a18afc26758085d9633ab314 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Mon, 13 May 2024 13:14:11 -0400 Subject: Ignoring Comments and Encoding Jumps --- tests/test4.asm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/test4.asm') diff --git a/tests/test4.asm b/tests/test4.asm index af5dcc4..e116ac7 100755 --- a/tests/test4.asm +++ b/tests/test4.asm @@ -1,15 +1,17 @@ -addi $t0, $zero, 10 -addi $t1, $zero, 12 +# 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 -beq $zero, $zero, PrintInt +jal PrintInt nop -caller: beq $zero, $zero, Exit +j Exit # Exit the program nop PrintInt: add $a0, $t2, $zero addi $v0, $zero, 1 syscall -beq $zero, $zero, caller +jr $ra nop Exit: addi $v0, $zero, 10 -- cgit v1.2.3