WiiRd forum

Wii & Gamecube Hacking => WiiRD Remote Debugger => Topic started by: Panda On Smack on May 28, 2009, 02:48:36 PM

Title: Asm
Post by: Panda On Smack on May 28, 2009, 02:48:36 PM
Just trying to work out how you compare a value in a register with an actual value

r0  : 00000DBE

How would I compare r0 with DBE?

cmpwi r0,DBE

I can then use bne to jump past the next few lines if it's not equal? whats different with bne- and bne+ ?

also is each line the value of 4 in hex? I have some ASM guides but they explain it as if you understand it already :(

ta


I think i sussed it:

cmpwi r0,3518
bne- 0x8
li r6,15
stbx r6,r7,r0
Title: Re: Asm
Post by: Link on May 28, 2009, 03:01:44 PM
http://hpcf.nersc.gov/vendor_docs/ibm/asm/branch_mnem.htm (http://hpcf.nersc.gov/vendor_docs/ibm/asm/branch_mnem.htm)

+ Predict branch to be taken
- Predict branch not to be taken (fall through)
Title: Re: Asm
Post by: Panda On Smack on May 28, 2009, 03:02:12 PM
Thanks Link

Is there a tutorial anywhere about a button activator code via asm?

When my C2 code runs i want to load the value at an address (8014E110) into a register and compare that to certain values and do things accordingly

ta
Title: Re: Asm
Post by: Romaap on May 28, 2009, 07:08:57 PM
Black_Wolf made a tutorial for an ASM moonjump (http://wiird.l0nk.org/forum/index.php/topic,1454.0.html) code with button activator.

but what you have to do is just:
lis rA,0x8014
ori rA,rA,0xE110
lwz rB,(rA)
cmpi rB,value
Title: Re: Asm
Post by: Panda On Smack on May 28, 2009, 07:22:15 PM
Top banana

thanks Ro to the map
Title: Re: Asm
Post by: ssbbdude on May 28, 2009, 07:24:12 PM
hes not romap hes rommap
Title: Re: Asm
Post by: Romaap on May 28, 2009, 07:39:07 PM
Quote from: Panda On Smack on May 28, 2009, 07:22:15 PM
Top banana

thanks Ro to the map
Quote from: ssbbdude on May 28, 2009, 07:24:12 PM
hes not romap hes rommap
...
Title: Re: Asm
Post by: ssbbdude on May 28, 2009, 08:18:43 PM
romaap i mean XD
Title: Re: Asm
Post by: dragonboy269 on May 28, 2009, 11:45:30 PM
for example (with random registers and random values)

lis r5,0x5222
lwz r4,0x1222(r5)
#r4 now holds the value at 52221222 (random location, but just an example)
cmpwi r4,0x5555
bne skip
#put the code you wanna skip over here, for example:
addi r4,0x2
skip:
#continues here
addi r4,0x5