From 50b71f946ce96e279e805f1e2f8c6c3c314745e3 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Mon, 17 Feb 2020 14:13:55 +0000 Subject: [PATCH] Update exit function Clean documentation --- prj1.asm | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/prj1.asm b/prj1.asm index a6b41db..4bb63d6 100644 --- a/prj1.asm +++ b/prj1.asm @@ -1,11 +1,7 @@ -# Declare main as a global function .globl main -# All program code is placed after the -# .text assembler directive .text -# The label 'main' represents the starting point main: # print user input li $v0, 4 @@ -23,16 +19,19 @@ main: li $s0, 0 # set counter to 0 jal lookup # hop to lookup function - # print newline - #li $v0, 4 - #la $a0, newline - #syscall - # print out result li $v0, 1 # print_int syscall code = 1 move $a0, $s0 # load integer into $ao syscall - j exit # exit out of program + + # print newline + li $v0, 4 + la $a0, newline + syscall + + # exit + li $v0, 10 + syscall lookup: addi $t0, $a2, 1 # store one higher value @@ -59,12 +58,7 @@ setoob: li $s0, -1 # index is oob, set to -1 jr $ra # jump back to ra in main -exit: - - -# All memory structures are placed after the -# .data assembler directive .data arr: .word 5, 2, 1, 4, 6, 3 # change array to test enter_num: .asciiz "Enter number to be found: "