Posts: 528
Threads: 85
Joined: Jul 2005
The trick is that you are calling this address as a subroutine, so the return address is pushed on the stack when executing ?NC XG 0097.
With the target address in C, your program jumps to the GOTO ADR function it finds at 0097, and will then immediately jump to your desired address, with the stack loaded with your return address (the line after your ?NC XQ 0097)
Meindert
Posts: 297
Threads: 25
Joined: Nov 2006
The address is correct. The GOTOC at this address immediately
jumps to C[6:3], which is the entry to your subroutine. The
fact that the next in-line instruction is the first in the
RSTKB routine has nothing to do with anything. This is just
a convenient, known address that contains a GOTOC. Think of
it as a waypoint that you have to go through to get to your
final destination. Getting to the waypoint via a subroutine
call takes care of getting the return address on the stack.
Monte