Next Gen Boards
 

Sponsored Links
Arcade YouTube vbBux / vbPlaza Calendar FAQ

Reply
 
Thread Tools Display Modes  
Whitey
Colonel Grade 1
 
Join Date: Apr 2007
Location: Where minutes turn into hours and days into years
Posts: 595
Rep Power: 2 Whitey is on a distinguished road Reputation: 20
Points: 59,949.60
Bank: 56,884.38
Total Points: 116,833.98
Whitey is offline
 
 
#1
06-22-2007, 10:46 PM   #1
Reply With Quote
PS2 Hacking:Saving and loading instructions tutorial

Saving and loading instructions tutorial

--------------------------------------------------------------------------------

Written by uni-terror

*Updated with Doubleword instructions and Immediates*
*Updated with Quadword instructions* - blu3

Saving and Loading instructions guide by uni-terror
It's very useful to know these. All of them load or save data data from or to the offset specified. If it's a loading instruction, they load the data stored at the offset into the first register of the instruction. If it's saving instruction, they take the first register and save it's data at the offset. These are very useful if your making your own subroutines and you need to save things across calls, or in general to understand what exactly the function is doing and why. Here's a somewhat complete list.

Ok just to clarify things on data sizes:
Word = 32 bits of data = "XXXXXXXX" = 8 digits
Halfword = 16 bits of data = "XXXX" = 4 digits
Byte = 8 bits of data = "XX" = 2 digits
DoubleWord = 64 bits of data = "XXXXXXXX, XXXXXXXX" = 16 digits
Quadword = 128 bits of data = "XXXXXXXX, XXXXXXXX, XXXXXXXX, XXXXXXXX" = 32 digits

unalligned data
ulw unalligned load word
ulh unaligned load halfword
ulhu unaligned load halfword unsigned
usw unaligned store word
ush unaligned store halfword
lwl load word left
lwr load word right
swl store word left
swr store word right

aligned data
sw save word
sh save halfword
sb save byte
lw load word
lh load halfword
lhu load halfword unsigned
lb load byte
lbu load byte unsigned

doubleword instructions
ld load doubleword
sd save doubleword

immediate instructions
li load immediate (loads an immediate value given into register)
lui load upper immediate (loads an immediate value 4 digits to the left, example "XXXX0000")

quadword instructions
lq load quadword
sq store quadword

I think that's all of them for standard registers, if anyone knows one I missed please post. I'll probably write up a little floating point instruction tutorial soon because they are far too often overlooked when they play a large role in understanding functions.


Credit:uni-terror
__________________

Socom 3/CA Clan [E]LeMeNt
R.I.P.
Dec '05-Jan '07
[img]<a href="http://www.us.playstation.com/PSN/Users/whitey111"><img src="http://pid.us.playstation.com/user/whitey111.jpg" width="235" height="149" border="0" /></a>[/img]
Report Post
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

top Go to Top All times are GMT -4. The time now is 12:19 PM.

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 Copyright ©2006 - 2008, NextGenBoards. All Rights Reserved