[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Faking RWTS13: Trying to figure out how to do something
On Mon, 28 Nov 2005, Michael J. Mahon wrote:
Trace it carefully, and you will see that it constructs a return address
on the stack than then RTSs to it.
Eek.
In fact, you may want to literally trace this code in an emulator.
OK.
Though, I think I see the code you're referring to:
jsr $FF58
tsx
lda $0100,x ; pick our address off the stack
pha
asl
asl
asl
asl ; get slot number * 16
sta $2B
tax
lda #$D0
pha
Relocation to another page boundary should work as long as the code at
xxD1 is not moved or the constant $D0 pushed on the stack is adjusted
appropriately.
I was very careful to load it at 8x00 where x is the slot number.
Hm.
It seems to be jumping to the wrong address for some reason, and a trace
doesn't seem to reveal why.
-uso.