Pointers [Clay10]

What do pointer codes do exactly? Pointers read the value at an address and if the address contains a valid pointer address, it will add a value to the offset. Many of you may look at addresses in memory viewer and see values like 80721748 at 81205718. 80721748 would be the pointer, and a value would be added to that.


Simple pointer code outline using direct ram writes -

48000000 TTTTTTTT #load address T into pointer

14YYYYYY XXXXXXXX #Y = value to add to value at T. X = value to write at Y + T

E0000000 80008000 #endif


Now to compile this into a working code.


48000000 81205718 #loads 81205718 (the value at 81205718 is the pointer)

140002E9 3F800000 #adds

000002E9 to the value at 81205718 and writes 3F800000 to the result

E0000000 80008000


Most codetypes will work in the same way as the 04 codetype. You just have to add 10 to the codetype. ASM for example looks like this -


48000000 81205718 #load into pointer

D20002E9 00000001 #C2 changed to D2. Add 2E9 to the pointer at 81205718 and insert 00000001 line(s) of ASM instruction(s) to the result.

60000000 00000000 #asm nop

E0000000 80008000 #endif


To recap: pointers add a value to the pointer(value) at a given address. You can use any codetype that supports pointers, just add 10 to the codetype and go about making the code as you normally would.