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/test3.asm | 0 tests/test3.bin | 0 tests/test4.asm | 12 +++++++----- tests/test4.bin | Bin 56 -> 56 bytes 4 files changed, 7 insertions(+), 5 deletions(-) mode change 100644 => 100755 tests/test3.asm mode change 100644 => 100755 tests/test3.bin mode change 100644 => 100755 tests/test4.bin (limited to 'tests') diff --git a/tests/test3.asm b/tests/test3.asm old mode 100644 new mode 100755 diff --git a/tests/test3.bin b/tests/test3.bin old mode 100644 new mode 100755 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 diff --git a/tests/test4.bin b/tests/test4.bin old mode 100644 new mode 100755 index 1c6e0bd..61cb805 Binary files a/tests/test4.bin and b/tests/test4.bin differ -- cgit v1.2.3