Question: What will be the value of $v 0 if string was Hel . data string: . asciiz Hello!!! . text main: la $a 0 ,

What will be the value of $v0 if string was "Hel"
.data
string: .asciiz "Hello!!!"
.text
main:
la $a0, string
jal string_length
li $v0,10
syscall
string_length:
li $v0,0
count_loop:
lb $t0,0($a0)
beqz $t0, count_exit
addi $a0, $a0,1
addi $v0, $v0,1
j count_loop
count_exit:
jr $ra
8
10
5
6
None of the above

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 Programming Questions!