BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the community, you simply need to register an account or log into an existing one.

Be sure to check out disposable e-mail services, in case you prefer using one for this site instead of your legit address: http://10minutemail.com/10MinuteMail/

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can see and download all content provided for regular members even without an account!

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Search
 
 

Display results as :
 


Rechercher Advanced Search

February 2018
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728    

Calendar Calendar

Country Statistics
Free counters!
LaTeX Generator


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Please help with ASM Assembly on 8/26/2013, 2:16 am

jaeremix10

avatar
Code Creator
So bully, after a while of trying out your PPC helper, ive noticed that all it does is write a value using li and ori, and then stores it.

That's helpful, but what about codes you have made that involve writes like 2C0C02B3.

I wanted to ask how you do this before attempting it myself to not look like a n00b. Please help me. I want to code better in ASM. Smile

2 Re: Please help with ASM Assembly on 8/26/2013, 11:43 pm

Bully@WiiPlaza

avatar
 
 
The program only helps you with storing a single value to the memory. That is good enough most of the time, but obviously there's way more you can do such as conditional code.
Spoiler:

Code:
lis r12, 0x8134
ori r12, r12, 0x5678
lwz r12, 0 (r12)

li r11, 0

cmpw r12, r11

beq- END

#No match#

END:

#No matter what#
This reads the value from address 0x81345678 into r12. Then puts value 0x00000000 into r11. Compares if those two match. If they do match, the branch is taken (branch if equal = beq). Code #No matter what# is executed. However if they don't match, #No match# is executed and *then* #No matter what#.

If you want to do something like if and else you require to skip the button part by branching over if you reach the #No match# part.
Spoiler:

Code:
lis r12, 0x8134
ori r12, r12, 0x5678
lwz r12, 0 (r12)

li r11, 0

cmpw r12, r11

beq- END

#No match#
b IFTAKEN

END:

#No matter what#

IFTAKEN:
The branch labels can be named however you want. The destination must end with ":". Label names can not be the same to prevent ambiguous codes:
Spoiler:

Code:
lis r12, 0x8134
ori r12, r12, 0x5678
lwz r12, 0 (r12)

li r11, 0

cmpw r12, r11

beq- END

#No match#
b END

END:

#No matter what#

END:
By the way, # ... # is a comment which can be inserted into the code without causing compiling issues.


_________________

3 Re: Please help with ASM Assembly on 8/27/2013, 2:10 am

jaeremix10

avatar
Code Creator
Oh! Now THIS is juicy meat. What do the r registers mean? Does it depend on the breakpoint?


_________________
All the "Official" coders hate me. That's what keeps me coding! Cool 

4 Re: Please help with ASM Assembly on 8/27/2013, 2:17 am

jaeremix10

avatar
Code Creator
Why did u choose r12 and r11. Does it have to be those 2?


_________________
All the "Official" coders hate me. That's what keeps me coding! Cool 

5 Re: Please help with ASM Assembly on 8/27/2013, 3:04 am

Bully@WiiPlaza

avatar
 
 
r12 is the safest register to write stuff to. Work your way down the more registers you need. If you do a bad pick your game could just crash.

Depending on the breakpoint you may want to write a value to the register it loads into or stores from.



Last edited by Bully@WiiPlaza on 8/27/2013, 3:19 am; edited 1 time in total


_________________

6 Re: Please help with ASM Assembly on 8/27/2013, 3:12 am

jaeremix10

avatar
Code Creator
Oh ok. You dont write #no match# in asmwiird right?


_________________
All the "Official" coders hate me. That's what keeps me coding! Cool 

7 Re: Please help with ASM Assembly on 8/27/2013, 3:19 am

Bully@WiiPlaza

avatar
 
 
This was just a comment to show you where to put code to execute when it doesn't match the comparison.


_________________

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum