Advertising (This ad goes away for registered users. You can Login or Register)

beqz vs beqzl in mips

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Locked
thecobra
HBL Collaborator
Posts: 167
Joined: Thu Feb 24, 2011 7:50 pm

beqz vs beqzl in mips

Post by thecobra »

Hi,

I know in mips assembly, Beqz = Branch to address/location if the variable = 0 but what is the diffrence from this one vs the Beqzl ?

Online i found it to mean Branch on Equal to Zero Likely but no reall programming mean of what this mean. Can anyone inlight me please because i saw this several time in prx i been looking at and there a part that doesn make sense if they do the same.


it something like this:

Code: Select all

location_0001:
....
beqz $t0, location_0002
lw $a0, 0($s1)
....

location_0002:
beqzl $t0, location_0001
lw $s0, 0($s1)
....
I get what it doing( to best of my understanding) but i still find it redolent.

Thanks
Advertising
Image
Cheap & Fast VPS Server from DigitalOcean
PSVita 3.xx eCFW <Thank to wololo Community>
PSVita 1.67 vHBL Dead :(
PSP FAT 6.60 - CFW pro
some1
HBL Collaborator
Posts: 139
Joined: Sun Dec 12, 2010 4:19 am

Re: beqz vs beqzl in mips

Post by some1 »

It means that the delay slot is only executed if the branch is true.
Advertising
way to keep a secret malloxis...erm jeerum
Hmm, a demo user mode exploit doesn't seem as important anymore, I wonder why... xP
thecobra
HBL Collaborator
Posts: 167
Joined: Thu Feb 24, 2011 7:50 pm

Re: beqz vs beqzl in mips

Post by thecobra »

some1 wrote:It means that the delay slot is only executed if the branch is true.

oh so that means that if branch is false then the next instruction is skip over and it execute the third instruction?

so in other word:

Code: Select all

beqzl $t0, local_random
sw $t1, 0($t1)
lw  $a0, 0($t1)
So in this example. If $t0 == 0 then it execute the sw instruction and then branch else it go straight to lw?

while in if beqzl was beqz, it will execute the next instruction even without the branch being true?
Image
Cheap & Fast VPS Server from DigitalOcean
PSVita 3.xx eCFW <Thank to wololo Community>
PSVita 1.67 vHBL Dead :(
PSP FAT 6.60 - CFW pro
FrEdDy
HBL Collaborator
Posts: 243
Joined: Mon Sep 27, 2010 7:08 pm
Contact:

Re: beqz vs beqzl in mips

Post by FrEdDy »

Exactly.
Non-likely branch instructions execute the instruction in the delay slot no matter what.
https://github.com/freddy-156
<@n00b81> FREDDY CUTTIES
thecobra
HBL Collaborator
Posts: 167
Joined: Thu Feb 24, 2011 7:50 pm

Re: beqz vs beqzl in mips

Post by thecobra »

OK thanks guys
Image
Cheap & Fast VPS Server from DigitalOcean
PSVita 3.xx eCFW <Thank to wololo Community>
PSVita 1.67 vHBL Dead :(
PSP FAT 6.60 - CFW pro
Locked

Return to “Programming and Security”