Question
Q) Write a MIPS assembly language that copies the behavior of the above given code? Assume A is an array of words (with precise documentation
Q) Write a MIPS assembly language that copies the behavior of the above given code? Assume A is an array of words (with precise documentation as well)
The below code is what I could do to my best of my knowledge of MIPS but unfortunately it has some issue. Plz fix it or rewrite it for me in simple basic mips instructions that is used similarly by me.
.data
array: .word 3,5,5,5,6,5
.text la $a0, array addi $t0,$0,5
li $t1,0
addi $t2,$0,6
li $t3,0
bge $t2,$t3,loop loop: lw $a0, array($t3) bne $a0,$t2,loop2 addi $t1,$t1,1 addi $t3,$t3,1 j loop loop2: addi $t3,$t3,1 j loop li $v0,10 syscall
= = 0; 6; = A- [3, 5, 5, 5, 6, 5]; NUM = 5; COUNT SIZE i 0; while (iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started