If you do a function call, the called routine can examine the stack and find the PC of where it was called from.  With a function entry like:
    push    ix
    ld        ix,#0
    add        ix,sp
    ld        c, 4(ix)
    ld        b, 5(ix)

0(ix) and 1(ix) should be the original value of IX, 2(ix) and 3(ix) should be the PC. 

- Guy

On Sat, Mar 28, 2009 at 2:26 PM, candida lopez rodriguez <c.rodrigu@rcn.com> wrote:

I have a question that I hope somebody can help me. I want to create a
hardware debugger, this  debugger consists of a  z80 board with a CTC and a
UART. The board is connected to an STD bus. I have several other boards that
I do not know if they work, so my idea is to use the board that I know to
work to toggle addresses and such to examine the boards.

Well the problem:

I need to obtain the PC address (one of the commands that I want to have is
dump the registers). My problem is that I can not see a way to obtain the PC,
I can set it using HL but I do not have a way to obtain its value. There is a
way to do so


Sdcc-user mailing list