# Some help with MIPS assembly code

## Main Question or Discussion Point

Hey guys. I'm trying to practice some basic MIPS, but I can't seem to get this right. You just plug in the number and then you follow the code and you'll get obviously the end result. I can't get the result for these here. Does anybody know? I'd really appreciate help. Thank you!

1. $t0 = 0x55555555$t1= 0x12345678

And $t2,$t0, $t1 Bgtz$t2, add 1
J end
Add0: addi $t0,$t0, 0
Add1: addi $t1,$t1, 1
Add2 : addi $t2,$t2, 2

End:

Value of $t2 is needed ## Answers and Replies Related Programming and Computer Science News on Phys.org Mark44 Mentor What is this code supposed to do? Not being familiar with MIPS programming I have a couple of questions: 1. What is the "1." doing in the first line? 2. Is it valid to have "add 1" in the Bgtz instruction? Just means #1 as in problem 1, sorry for the confusion. And yes, it's valid. Just gotta plug it in and get the value of t2. Mark44 Mentor Just means #1 as in problem 1, sorry for the confusion. And yes, it's valid. Just gotta plug it in and get the value of t2. I don't understand. What do you mean "just gotta plug it in and get the value of t2." Also, what is this chunk of code intended to do? Code:$t0 = 0x55555555
$t1= 0x12345678 And$t2, $t0,$t1
Bgtz $t2, add 1 J end Add0: addi$t0, $t0, 0 Add1: addi$t1, $t1, 1 Add2 : addi$t2, \$t2, 2

End: