Trying to make this asm code G I JOE RIJP69

Started by BLU3Y, August 06, 2011, 12:42:01 PM

Previous topic - Next topic

Deathwolf

#15
Quote from: Bully@Wiiplaza on August 06, 2011, 08:12:52 PM
Quote from: Deathwolf on August 06, 2011, 08:01:08 PM
Quote00000000 does not mean free/safe.  You can't touch the registers above r13 without using a stack frame.

Volderbeek,mdmwii used registers above r13 too without any stack frame. It works for me too when I use a register which is above r13 and has the value 00000000. It's not right that you HAVE to use everytime a stack frame if you want to use a registers which is above r13.
the point is that it could crash when you use a register that has a value of 00000000 if it´s still used and just randomly zero.

However, I mean, writting an wrong ASM code and using the stack frame could crash the game too :rolleyes:
Just try some registers out.
lolz

Bully@Wiiplaza

r14-31 are free, when using the stack frame :p
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

Deathwolf

Yup, of course it's better to use a stack frame ^^
lolz

dcx2

Quote from: Deathwolf on August 06, 2011, 08:01:08 PM
Quote00000000 does not mean free/safe.  You can't touch the registers above r13 without using a stack frame.
Volderbeek,mdmwii used registers above r13 too without any stack frame. It works for me too when I use a register which is above r13 and has the value 00000000. It's not right that you HAVE to use everytime a stack frame if you want to use a registers which is above r13.
I suppose can't may be strong language.  Shouldn't would be better.

It is true that sometimes you can use non-volatile registers (r14-r31) without a stack frame.  However, unless you know what you're doing, it might still fail.  It might work, most of the time or even all of the time, but sooner or later such a strategy of using those registers without a stack frame will probably cause one of your codes to crash the game.  Then you don't know if the problem is your code or an unsafe register.

0 does not mean free/safe.  A register's safety in ASM is determined by the ASM instructions around it, not by its value.  Sometimes registers with 0 will be safe, sometimes not.  Sometimes registers with values in them will be safe, like r12 which almost always has a pointer in it, and yet 99.99% of the time it's safe to use without any consideration of the surrounding ASM.

See this post on the safety of registers.  http://wiird.l0nk.org/forum/index.php/topic,6555.0.html