Discussion:
[N8VEM: 18218] Z80 single-stepping
Nikolay Dimitrov
2014-06-12 23:13:22 UTC
Permalink
Gents,

I can't find any info on single-stepping of Z80 in the manual. Should I
assume that there's no such thing for this CPU? It would be interesting
to share how do you debug programs on real HW.

Thanks in advance. Regards,
Nikolay
'Bob Grieb' via N8VEM
2014-06-12 23:34:19 UTC
Permalink
It's easy to single step the Z80 with hw.
You just pull WAITb low.   To execute one

instruction you let it go high until the next fetch
cycle comes along, then stop the CPU again
with WAITb.   This is how the front panel of

old Altair computers did single stepping.
But this hw is not built into most computers,
hence the need for something like a Z80 In-Circuit
emulator which plugs in instead of the Z80 CPU

and gives the same capability, plus allows you to
see registers inside the CPU, examine memory contents,
etc.

    Bob



________________________________
From: Nikolay Dimitrov <picmaster-***@public.gmane.org>
To: n8vem-/***@public.gmane.org
Sent: Thursday, June 12, 2014 7:13 PM
Subject: [N8VEM: 18218] Z80 single-stepping


Gents,

I can't find any info on single-stepping of Z80 in the manual. Should I
assume that there's no such thing for this CPU? It would be interesting
to share how do you debug programs on real HW.

Thanks in advance. Regards,
Nikolay
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
Frank Vanderydt
2014-06-14 18:39:00 UTC
Permalink
Post by Nikolay Dimitrov
Gents,
I can't find any info on single-stepping of Z80 in the manual. Should I
assume that there's no such thing for this CPU? It would be interesting
to share how do you debug programs on real HW.
Thanks in advance. Regards,
Nikolay
M1 gets active when starting a new instruction...
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
Ian Brown
2014-06-21 14:13:17 UTC
Permalink
<Loading Image...>

<Loading Image...>
Hi Nikolay,

Don't know if you're still looking for information on single stepping, but
here is something from Build your own Z80 computer (Steve Ciarcia).

The circuit is in the first image and a description is in the second.

Hope this helps.
Regards,
Ian.
Post by Nikolay Dimitrov
Gents,
I can't find any info on single-stepping of Z80 in the manual. Should I
assume that there's no such thing for this CPU? It would be interesting
to share how do you debug programs on real HW.
Thanks in advance. Regards,
Nikolay
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
Nikolay Dimitrov
2014-06-21 17:29:14 UTC
Permalink
This post might be inappropriate. Click to display it.
Alan Cox
2014-06-21 17:36:44 UTC
Permalink
You can also feed a switch to nmi or interrupt and hook those to a debugger
in CP/M bios space.

T80 FPGA is even better as you can 'wire' what you like to the Z80 bus!
Post by Nikolay Dimitrov
Hi Ian,
Thanks for responding. Here's an explanation of why I was looking for this
info, hope it sheds some light.
My high-level idea was to explore to what extent the N8VEM machine is
possible to be "stand-alone" (or self-hosted if you want). My
interpretation for "stand-alone" is that the machine's software & hardware
should allow to rebuild its software & hardware (which if you think for a
while is non-trivial hard task), and also to be used for any simple
entertainment & work without a support from a PC host. For the SW part the
machine should be able to create new software, which in general means
editing, compiling and debugging code on the actual target (and this
environment should be friendlier than PDP-11/40 front panel). This is why I
was looking to find a Z80 capability similar to the 8088 trap flag, which
allows single-stepping through code, and thus the ability to have a
debugger running on the target itself. So far I haven't found any info
confirming that this is possible via the Z80 instruction set. For the HW
part, I was thinking that the machine should be able to run some form of
CAD SW (even a rudimentary one), that can be used to create schematics and
PCB. I think that at least theoretically this is possible, depending on
several important factors I was thinking to explore 1 by 1.
Ian, regarding the shared schematic - it looks like a manual single-step
mechanism, and it would be nice if there's a way to allow the SW running on
the Z80 to single-step a program (just like the old-school DOS DEBUG did
that). One possible solution could be to arm and trigger a pseudo-debug
interrupt after executing 1 instruction, so the debugger can get back the
control and examine the CPU state. I know that we can (brutally) extract
the Z80 state from an FPGA implementation, but I was also wondering how
this can be done on a off-the-shelf Z80.
As usual, feel free to share ideas (even crazy ones), and also to disagree
with me.
Kind regards,
Nikolay
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
Andrew Bingham
2014-06-21 18:26:42 UTC
Permalink
The hardest part of that in my mind is the CAD/EDA part. With the
text-only output options on the SBCs themselves it seems like it is out.
And I don't know that you'll find something that will run on the Color VDU
or UPD7220 to do the job.... Maybe there is some really old MSDOS
software? I don't know.

I'm sure with the right set of tools the software part could be made to
work.
Post by Nikolay Dimitrov
Hi Ian,
Thanks for responding. Here's an explanation of why I was looking for
this info, hope it sheds some light.
My high-level idea was to explore to what extent the N8VEM machine is
possible to be "stand-alone" (or self-hosted if you want). My
interpretation for "stand-alone" is that the machine's software &
hardware should allow to rebuild its software & hardware (which if you
think for a while is non-trivial hard task), and also to be used for any
simple entertainment & work without a support from a PC host. For the SW
part the machine should be able to create new software, which in general
means editing, compiling and debugging code on the actual target (and
this environment should be friendlier than PDP-11/40 front panel). This
is why I was looking to find a Z80 capability similar to the 8088 trap
flag, which allows single-stepping through code, and thus the ability to
have a debugger running on the target itself. So far I haven't found any
info confirming that this is possible via the Z80 instruction set. For
the HW part, I was thinking that the machine should be able to run some
form of CAD SW (even a rudimentary one), that can be used to create
schematics and PCB. I think that at least theoretically this is
possible, depending on several important factors I was thinking to
explore 1 by 1.
Ian, regarding the shared schematic - it looks like a manual single-step
mechanism, and it would be nice if there's a way to allow the SW running
on the Z80 to single-step a program (just like the old-school DOS DEBUG
did that). One possible solution could be to arm and trigger a
pseudo-debug interrupt after executing 1 instruction, so the debugger
can get back the control and examine the CPU state. I know that we can
(brutally) extract the Z80 state from an FPGA implementation, but I was
also wondering how this can be done on a off-the-shelf Z80.
As usual, feel free to share ideas (even crazy ones), and also to
disagree with me.
Kind regards,
Nikolay
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
p***@public.gmane.org
2014-06-21 21:15:33 UTC
Permalink
Hi Andrew,

Check this out: http://primrosebank.net/computers/cpm/cpm_mtx_user_progs.htm

I'm sure that during the days of CP/M enough people were interesed in these machines so there's a non-zero chance that such software already exists.

Regards,
Nikolay

-------------------------------------

Страхотни мъжки дрехи на ниски цени!
Над 200 модела тениски и още много други за лятото.
Вземи отстъпка сега с промо-код FM5
www.fashionmix.eu
http://www.fashionmix.eu/?utm_source=Mail.bg&utm_medium=CPM&utm_term=CPM&utm_content=text-link&utm_campaign=mail-bg
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to n8vem-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
Loading...