###################################################################################### # Final Project - Written by Jon Radke for Computer Organization # # Program takes in 10 positive numbers - It then calculates and displays # # the total and average of the numbers, printed out in decimal form # ###################################################################################### .data startingPrompt: .asciiz "This program takes 10 positive integers, adds them and finds the average" prompt: .asciiz "\n\n Please enter a positive number: " totalPrompt: .asciiz "\n Total of nubmers is: " averagePrompt: .asciiz "\n Average of numbers is: " endPrompt: .asciiz "\n Thank you - For all questions or inquiries, please email jonra@netins.net" .globl main .text main: li $t0, 10 li $v0, 4 la $a0, startingPrompt syscall loadLoop: li $v0, 4 la $a0, prompt syscall li $v0, 5 syscall addi $t0, $t0, -1 #Decrements counter from 10 bgtz $t0, loadLoop #Goes back to prompting for numbers while t0 > 0 calc: #Mainly a label for organization purposes - no functionality to this label at this time end: li $v0, 4 la $a0, endPrompt syscall