Structure of codes

Started by doomkaiber001, November 17, 2010, 07:24:33 PM

Previous topic - Next topic

doomkaiber001

Yes... I think I understand (the money part). You're probably right. I do need a better understanding of memory.
Thanks!

doomkaiber001

#16
http://wiird.l0nk.org/forum/index.php/topic,5249.msg60636.html

Is this an example of writing values to memory, but with using ASM? I think it is.

MOD EDIT: fixed link

James0x57

Memory is an ice cube tray.
Each place for a cube is numbered.
Each of these holes are filled with different flavors.

The number of the hole is the address, the flavor is the value.


80123450 is an address that holds a value of something (health, money, color, speed, etc).



I can't look at the asm example right yet; will reply later


doomkaiber001


dcx2

Just a heads up, I'm going to move this thread out of OT board to the WGHH board...because this isn't actually an off topic discussion.  Not sure how it got here...

doomkaiber001


doomkaiber001

Well, Is it an example of memory writing?

James0x57

That url doesn't work for me.


doomkaiber001

Ok. Its 'An Introduction To Cpu Architecture and ASM'. I found it in The colective under Wii Game Hacking Guides.

dcx2

I fixed the link for you, you left off the .org part and that's why it wouldn't work.

In that link, the ASM instruction "stw" writes to memory.  Memory is represented by the box "MEM" in the pictures.

doomkaiber001

Thanks for fixing the link :) Do you follow the / a similar process in the link whenever you write a value to memory?

dcx2

The link is an explanation of what happens while a game is running on the Wii.  It's meant to give you an example of how data is flowing to and from memory, and how ASM instructions modify the values.

If you write an ASM code, then you will probably be using stw or some derivative (sth, stb, stwu, etc).  When the CPU executes your stw instruction, it will write to memory.

You don't need ASM, though.  When you use code types like the 04 code type, you are telling the code handler to do the writing for you.  If you were to follow the code handler along while it executes your 04 code, you would eventually see a stw somewhere.

doomkaiber001

So, let's see if I understand this;
0525E9C6 00000007
05 = 0000 0101
0 = ba ( Because its a Positive Number)
1 = Add to address

So...
ba (add 80000000 to address)

8125E9C6 Is the address that 7 has to be written to.

I hope thats right. It seems so.

dcx2

Yes, you're right.  One minor correction though...it's not ba because it's positive, it's ba because it's even.

doomkaiber001

Yeah sorry! I did mean that but it was late... Anyway, if you could help me with one other thing. What about multi-lined codes?

Sorry if I'm asking too much.