16) The ollowing is a MIPS Assembly Language program. The program loops through
ID: 3596662 • Letter: 1
Question
16) The ollowing is a MIPS Assembly Language program. The program loops through an array of and muliplies each array element by four by means of shifting. Here is the program. Fill in the 3 blank spaces in the program in order to complete it. The second blank may need more than one line of code. You fill in this blank with an assembler directive (3 pts) word 4-6, 34,-78, 44 Amay Size: message: delimiter: word S "asiiz "Modified array: ” asciiz".” text globl main lw Sto, Array Size #Fetch array size into a register la Stl,AA # loop for modifying the array main: # Fetch array address into St1 loop You fill in code to replace each array element with a number 4 times as large. May take multiple lines of code. (7 pts) addi addi Stl, Stl, 4 StO, StO,-1 You fill in the appropriate branch instruction (with operands) here. (5 pts) done (etc.)Explanation / Answer
BLANK 1:
.data #assembler directive
BLANK 2:
lw $t2,($t1) #loop for modifying the array
sll $t2,$t2,2
sw $t2,($t1)
BLANK 3:
bne $t0,0,loop # branch instruction
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.