Writing subs for multiple line codes?
Can someone explain in simple terms how to write a sub for a multiple line code?
For example:
#Some Made up Code
0x00000004 0x00000000
0x00040000 0x00000000
0x00005000 0x00000000
0x00000050 0x00000000
I know the steps for writing a sub for a one line code...
Such as:
lui t0 $1stHalfAdd
lui t1 $1stHalfHex
lui t1, t1, $2ndHalfHex
sw t1, $2ndHalfAdd(t0)
Jr ra
And so on....
Can you show me sort of like I wrote it out above ^
How I would do this for multiple line codes?
I hope my question is easy to understand.
I basically want/need to know how to write a sub for a multiple line code.
Any help will be greatly appreciated and thanks!
----Edit----
If your answer helps me I will gladly donate some points.
----Added 24/5/2009 at 11:41 AM----
Thanks for the help!
I got it figured out.
But thanks for the help!
Re: Writing subs for multiple line codes?
lui t0 $0000
lui t1 $0000
lui t1 t1 $0000
sw t1, $0004(t0)
lui t2 $0004
lui t3 $0000
lui t3 t3 $0000
sw t2 $(t0)0000
lui t3 $0000
lui t4 $0000
lui t4 t4 $0000
sw t3 $5000(t0)
lui t4 $0000
lui t5 $0000
lui t5 t5 $0000
sw t4 $0050
Jr ra
#Some Made up Code
well here is your answer and yeah i have a different template but i use yours and i think you need a hook after you make the sub to it would work in game.
hope i help you . do those steps i did. in ps2dis
Re: Writing subs for multiple line codes?
lui t0 $0000
lui t1 $0000
lui t1 t1 $0000
sw t1, $0004(t0)
lui t2 $0004
lui t3 $0000
lui t3 t3 $0000
sw t2 $(t0)0000
lui t3 $0000
lui t4 $0000
lui t4 t4 $0000
sw t3 $5000(t0)
lui t4 $0000
lui t5 $0000
lui t5 t5 $0000
sw t4 $0050
Jr ra
those in red arent right but its just changin the t1 to a t2 to load your next set of stuff
Re: Writing subs for multiple line codes?
Re: Writing subs for multiple line codes?
mad simple an then just add more registers depenedin on how long the code is
hook
lui t0 $(First half of your address)
lui t1 $(First half of your hex)
ori t1 t1 $(Second half of your hex) OR addiu t1 t1 $(Second half of your hex)
sw t1 $(Second half of your address)(t0)
(Loading 2nd Line Of You Code)
lui t2 $(First half of your address)
lui t3 $(First half of your hex)
ori t3 t3 $(Second half of your hex) OR addiu t3 t3 $(Second half of your hex)
sw t3 $(Second half of your address)(t2)
jr ra