Users browsing this thread: 1 Guest(s)
JSR Returning to wrong place in code
Man, I did a whole stream on this subject. But the I had to stop/start the stream a few times changing resolution cause my internet was dumb... otherwise I'd have it on youtube.
Basically, when you JSR it pushes your current location to the stack so that the RTS knows where to come back to. RTS takes the last 2 bytes on the stack (pushed from your JSR) as a return address then adds 1 to get to the next byte of code. This is why as a general rule, you don't f*** with the stack. however, if you know where you are in the stack its all usable.
Keep an eye out for maybe a push or pull inside a conditional that may be skipped due to a branch. That's the place I most often screw up the stack.
Basically, when you JSR it pushes your current location to the stack so that the RTS knows where to come back to. RTS takes the last 2 bytes on the stack (pushed from your JSR) as a return address then adds 1 to get to the next byte of code. This is why as a general rule, you don't f*** with the stack. however, if you know where you are in the stack its all usable.
Keep an eye out for maybe a push or pull inside a conditional that may be skipped due to a branch. That's the place I most often screw up the stack.
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)