Question: Explain and Write good report for this program code: text .globl main main: #printing name and id li $v0,4 la $a0,msg syscall #printing message 1

Explain and Write good report for this program code:

text .globl main main: #printing name and id li $v0,4 la $a0,msg syscall #printing message 1 li $v0,4 la $a0,msg1 syscall #read integer for size li $v0,5 syscall move $s0,$v0 #storing size into $s0 #printing message 2 li $v0,4 la $a0,msg2 syscall #reading numbers la $t0,array move $t1,$s0 loop: li $v0,5 syscall sw $v0,($t0) #advance $t0 so it point to next index add $t0,$t0,4 sub $t1,$t1,1 bgt $t1,0,loop #sorting array using bubble sort li $t1,0 for1: la $t0,array li $t2,1 for2: lw $t3,($t0) add $t0,$t0,4 lw $t4,($t0) blt $t3,$t4,skipswap #swap content sub $t0,$t0,4 sw $t4,($t0) add $t0,$t0,4 sw $t3,($t0) skipswap: sub $t5,$s0,$t1 add $t2,$t2,1 blt $t2,$t5,for2 add $t1,$t1,1 blt $t1,$s0,for1 #printing sorted number la $t0,array move $t1,$s0 #printing message li $v0,4 la $a0,msg3 syscall printloop: lw $a0,($t0) add $t0,$t0,4 sub $t1,$t1,1 li $v0,1 syscall #printing space li $v0,11 li $a0,32 syscall bgt $t1,0,printloop #code for exit li $v0,10 syscall .data msg: .asciiz "Name: Nabil Mohsen Alzeqri Id: 61330237 " msg1: .asciiz "Enter size:" msg2: .asciiz "Enter numbers: " msg3: .asciiz "sorted numbers: " array: .word 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!