assign3.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 3#professor: Debra Callis #September,16,2019.data.word 0.word 0.word 0.asciiz "Tan Dao ".asciiz "Enter a number ".asciiz "\n".globl main .textmain: #deterine location of the string lui $s0,0x1001 # set the location 0x1001 at s0#---------------------------------------------------------------------------add $a0,$0,$s0 #set location s0 to a0addi $a0,$a0,21 # call the location to a0 (Enter a number)addi $v0,$0,4 # command print Stringsyscalladdi $a0,$s0,0 # reset a0 back to location 1001#prompt user to enter a number at location 0x10010000addi $v0,$0,5 # use commant 5 to read intergersyscall add $t0,$v0,$0 # save input to t0sw $t0,($s0) # save value at locatoin 0x10010000#-----------------------------------------------------------------------------#---------------------------------------------------------------------------add $a0,$0,$s0 #set location s0 to a0addi $a0,$a0,21 # call the location to a0 (Enter a number)addi $v0,$0,4 # command print Stringsyscalladdi $a0,$s0,0 # reset a0 back to location 1001# prompt user to enter a number at location 0x10010004addi $v0,$0,5 # use commant 5 to read intergersyscall add $t1,$v0,$0 # save input to t0sw $t1,4($s0) # save value at locatoin 0x10010004#---------------------------------------------------------------------------#---------------------------------------------------------------------------#compare two number and save larger value at location 0x10010008slt $s1,$t1,$t0 # compare t0 and t1 if t0<t1 s1=1; t0>t1 s1=0

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture