assign5.asm - #Programer Tan Dao#Csc 230 ID 73942 Assigment...

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

#Programer: Tan Dao #Csc 230 ID: 73942# Assigment 4#professor: Debra Callis #Octrober, 8,2019.data.asciiz "Enter a number " #0.asciiz "\n" #16.asciiz "Tan Dao\n" #18.asciiz "please print".text.globl main main: # set up all the parameter lui $s7,0x1001# set the location 0x1001 at s7lui $s0,0x1001 # save the array in location 0x1001addi $s0, $s0,0x60# set location of $s0 start at 0x10010060add $a0,$0,$s0# set location s0 to a0#-------------------------------------------------------------------add $a0,$0,$s7# set location s7 to a0addi $a0,$a0,18# call the location to a0 (Tan Dao)addi $v0,$0,4# command print Stringsyscalladdi $a0,$s0,0# set a0 is parameter for funtion readvals jal readvals add $a0,$0,$s7# set location s7 to a0addi $a0,$a0,16# call the location to a0 (\n)addi $v0,$0,4# command print Stringsyscalladdi $a0,$s0,0# set a0 is parameter for funtion printjal print# call function print sumend:ori $v0, $0, 10# set command to stop program,syscall# end program# function askes user to enter 10 number and store in the array 0x10010060readvals:#addi $t0,$t0,0# count variable #lui $s0,0x1001 # save the array in location 0x1001#addi $s0, $s0,0x60# set location of $s0 start at 0x10010060add $a0,$0,$s0

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture