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:
_copy_ident:
pushix
ldix,#0
addix,sp
ldc, 4(ix)
ldb, 5(ix)
...
0(ix) and 1(ix) should be the origina
Or one instruction shorter (and 17 T states faster):
loadhlpc:
pop hl
jp(hl)
But this returns PC for Your code because user code doesn't know about
Your loadhlpc function and doesn't call it... IMHO the only way after
breakpoint (RST or NMI break request) is to look for br
On Saturday 28 March 2009 08:25:13 pm Richard Gray wrote:
> The true "hardware debugger" is a logic analyser I suppose - that's what I
> often use. One can see all traffic on the various buses using one of these,
> and for 8-bit stuff one can pick them up quite cheaply on eBay.
>
> The other way is
The true "hardware debugger" is a logic analyser I suppose - that's what I
often use. One can see all traffic on the various buses using one of these,
and for 8-bit stuff one can pick them up quite cheaply on eBay.
The other way is an in-circuit-emulator, but that will still use an RST
instruct
On Saturday 28 March 2009 06:39:23 pm bob...@comcast.net wrote:
> - Richard Gray wrote:
> > I think this example puts the stack-pointer into HL, doesn't it?
> >
> > Sorry! (I just woke up, and there is no pepsi in the house...)
>
> But isn't this sort of a trick question??? You usually know
- bob...@comcast.net wrote:
> Now if you really want to know what the SP was when it
> hit a breakpoint (IOW, which breakpoint did you hit?), then
> the standard way to do that on z80 is to use restart inst.,
> and then look on top of stack.
Make that:
Now if you really want to know what the
- Richard Gray wrote:
> I think this example puts the stack-pointer into HL, doesn't it?
> Sorry! (I just woke up, and there is no pepsi in the house...)
But isn't this sort of a trick question??? You usually know
exactly what the PC is at every point in your program!
The stack pointer is
Hello!
> 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
Usually a programmer knows the addres
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
doc
I think this example puts the stack-pointer into HL, doesn't it?
On Saturday 28 March 2009 22:02:04 bob...@comcast.net wrote:
> - candida lopez rodriguez wrote:
> > 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 no
- candida lopez rodriguez wrote:
>
> 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 s
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
12 matches
Mail list logo