I have following asm MIPS code:
80031DB8 bnez $v0, loc_80031F58
80031DBC move $v0, $zero
as far as I understand “branch not equal zero” will never jump to loc_80031F58, because v0 = 0, is that right?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. At the time of comparison,
$v0has whatever value prior to execution of80031DB8. After the comparison, when the delay slot executes and the jump is beginning to be taken,$v0is written with the value0.Once the branch is either taken or not taken,
$v0has the value zero. That is, at the start of execution of either80031F58(when the branch is taken) or 80031DC0 (when the branch is not taken),$v0will be0, although if the branch is taken, it must have had a non-zero value previously.