


Code:
#Define text section
.text
#Define main method
main: la $t1, str
#Define next method
next: lb $t0,($t1)
#Check if equal
beqz $t0,off
#Sub
sub $sp,$sp,4
#Store value
sw $t0,($sp)
#Add instruction
addi $t1,$t1,1
#Add instruction
addi $t2,$t2,1
#Jump to label
j next
#Define off procedure
off: sub $t1,$t1,1
#Define cap procedure
cap: lw $t0,($sp)
#Add instruction
addi $sp,$sp,4
#Branch if less than
blt $t0,0x61,getlet
#Branch if greater than
bgt $t0,0x7a,getlet
#sub instruction
sub $t0,$t0,0x20
#Define getlet procedure
getlet: sb $t0,0($t1)
#Sub instruction
sub $t1,$t1,1
#Sub instruction
sub $t2,$t2,1
#Branch if matches
beqz $t2,over
#Jump to label
j cap
#Define procedure over
over: la $a0,str
#Load
li $v0,4
#Syscall
syscall
#Load
li $v0,10
#System call
syscall
#Data
.data
#Display string
str: .asciiz "hello world \n"
Solve the problems as directed. Each problem worth 15 points. Use the data declaration on the...
QT
Spim question. Program and answer already given please explaine it.
Please explain the reason why each instruction was used
throughout the program step by step given the prompt, what is its
purpose to achive the goal asked in the prompt, why is written in
that order.
Please not just write to the side what each instruction means
in words like load $t0 to $t1. I want to understand the program
thoroughly.
Thanks in advance
Previous information needed to solve...