A common way of tackling this problem is to use a restart instruction as a breakpoint, so you replace the instruction you want the breakpoint at with the restart, and then in your restart routine the program counter can be popped off the stack. You will have to check the Z80 instruction set documentation because you might have to subtract one from the popped value or something, I cannot quite recall now; but you get the general idea?
On Saturday 28 March 2009 21:26:17 candida lopez rodriguez wrote: > Hello: > > 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 > > Thanks > -- Richard. PGP Key-id: 0x5AB3D350 At no time is freedom of speech more precious than when a man hits his thumb with a hammer. -- Marshall Lumsden ------------------------------------------------------------------------------ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user