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

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 (i

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!