Asm

Started by Panda On Smack, May 28, 2009, 02:48:36 PM

Previous topic - Next topic

Panda On Smack

Asm
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

Link

http://hpcf.nersc.gov/vendor_docs/ibm/asm/branch_mnem.htm

+ Predict branch to be taken
- Predict branch not to be taken (fall through)

Panda On Smack

#2
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

Romaap

#3
Black_Wolf made a tutorial for an ASM moonjump 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

Panda On Smack

Top banana

thanks Ro to the map

ssbbdude

hes not romap hes rommap

Romaap


ssbbdude

romaap i mean XD

dragonboy269

#8
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
If you have any requests for AC:WW/AC:CF codes, send me a message. :D