Question: 4. (10 points) Identify the errors in the code below and explain why they are errors and how they can be fixed. Assume the function

4. (10 points) Identify the errors in the code below and explain why they are errors and how they can be fixed. Assume the function "count" is passed an address of a string read in previously in $a0, and a character in the lowest byte of $al. It is called from main, and it returns the number of occurrences of the character in the string. count: lb $s1, 0($a0) loop: beq $sl, $0, exit bne $sl, $al, no add addi $v0, $v0, 1 no_add: addi $a0, $a0, 4 j loop exit: j main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
