Question: can someone understand this assembly code done in qtspim and just add comments to every line explaining the code. the overall point of the assignment


can someone understand this assembly code done in qtspim and just add comments to every line explaining the code. the overall point of the assignment is to prompt the user to enter two integers and store the smaller one in the first data memory word and the larger in the second data memory word. Then subtracts the smaller word from the larger word and stored result in the third data memory word. And then it prints the 3 data memory words on separate lines each labeled
text .globl main main: lui $80,0x1000 addi $a0 $80,12 #prompt for string addi $v0,$0,4 syscall addi $v0,$0,5 syscall add $t0,$0.Svo addi $a0,$50,29 #prompt for string addi $v0.$0, 4 syscall addi $v0,$0,5 syscall add $t1,$0.Svo sit $a0 St1,$t0 bne $a0,$0,bigger skip bigger: add $t2.$0 Sto add $t0,$0,$t1 #swap the numbers add $t1,$0 St2 # skip: sw $t0,($50) sw $t1,4($50) #subtract smaller from larger sub $12.501 Sto #subtract smaller from larger sub $12,$t1,$10 sw $12,8($so) addi $a0,$50.46 addi $v0,$0,4 Syscall lw $a0,4($80) addi $v0,$0,1 Syscall addi $a0,$50,64 addi $v0,$0,4 syscall lw $a0,0($50) addi $v0,$0,1 syscall addi $a0,$50,83 addi $v0,$0,4 syscall lw $a0,8($90) addi $v0,$0,1 syscall addi $v0,$0,10 syscall data Ox10000000 A: Word O B: word o C: word o input1: asciiz "First integer :'#prompt for string input2 asciiz "Second integer #prompt for string larger: asciiz " Larger Integer #prompt for string smaller: asciiz nSmaller Integei "#prompt for string difference: asciiz "nDifference: "#prompt for string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
