assign3 - CSE\/EEE230 Assignment 3 Sample Debra Calliss This program will print my name and then read in and store a maximum of 10 integers The numbers

assign3 - CSE/EEE230 Assignment 3 Sample Debra Calliss...

This preview shows page 1 - 2 out of 4 pages.

# CSE/EEE230 Assignment 3 Sample# Debra Calliss# October 25, 2010# This program will print my name, and then read in and store # a maximum of 10 integers. The numbers are then displayed # along with the difference from the floating point average# of the numbers. .datalist: .space 40 #An array to hold a maximum of 10 integersname: .asciiz "Debra Calliss\n" prompt1: .asciiz "How many values to read? "prompt2: .asciiz "Enter a number: "left: .asciiz " ("right: .asciiz ")\n".text.globl main# main# The main function will print my name and then set up the# parameters for and then call the functions readdata# and print.main:li $v0, 4#set command to print stringla $a0, name#get stringsyscall#print stringla $a0, list#get start of arrayjal readdata#call readdata functionmove $a1, $v0#copy count into parameterla $a0, list#reload start of arrayjal print#call print functionli $v0, 10#set command to stop programsyscall#halt# readdata# This function will prompt the user to enter the number# of values in the list. If the number is < 0, then the

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture