Discussion:
TF
(too old to reply)
Paul Edwards
2022-11-19 19:09:42 UTC
Permalink
I have implemented TF (trap flag) for the 8086.

But when I looked up RBIL, it doesn't say that TF
also works for the 80386. INT 1 is complicated
instead.

So can I single-step an 80386 program?

It looks like x'cc' still works on an 80386, invoking
INT 3 (from my reading of RBIL).

Anyone know for sure?

Thanks. Paul.
Alexei A. Frounze
2022-11-19 22:09:30 UTC
Permalink
Post by Paul Edwards
I have implemented TF (trap flag) for the 8086.
But when I looked up RBIL,
Why not read the intel or AMD documentation?
Post by Paul Edwards
it doesn't say that TF
also works for the 80386.
It does, all the way through Pentium.

Alex
George Neuner
2022-11-19 22:32:09 UTC
Permalink
On Sat, 19 Nov 2022 11:09:42 -0800 (PST), Paul Edwards
Post by Paul Edwards
I have implemented TF (trap flag) for the 8086.
But when I looked up RBIL, it doesn't say that TF
also works for the 80386. INT 1 is complicated
instead.
So can I single-step an 80386 program?
It looks like x'cc' still works on an 80386, invoking
INT 3 (from my reading of RBIL).
Anyone know for sure?
Thanks. Paul.
INT 3 works on all x86 processors, but the response differs depending
on whether you are in real mode or protected mode.
wolfgang kern
2022-11-21 15:32:49 UTC
Permalink
Post by Paul Edwards
I have implemented TF (trap flag) for the 8086.
But when I looked up RBIL, it doesn't say that TF
also works for the 80386. INT 1 is complicated
instead.
So can I single-step an 80386 program?
It looks like x'cc' still works on an 80386, invoking
INT 3 (from my reading of RBIL).
Anyone know for sure?
yes, CC work on all x86.
but any decent debugger use Traps instead:
a) by setting TF to single step one instruction w/o
the need for replace/insert a byte there.
b) by setting breakpoints [DATA or CODE or I/O] to
trap at occurrence (reason for debug-registers).
note: CC work different to the avoidable CD03.
__
wolfgang
Paul Edwards
2022-11-21 22:27:41 UTC
Permalink
Post by wolfgang kern
Post by Paul Edwards
I have implemented TF (trap flag) for the 8086.
But when I looked up RBIL, it doesn't say that TF
also works for the 80386. INT 1 is complicated
instead.
So can I single-step an 80386 program?
It looks like x'cc' still works on an 80386, invoking
INT 3 (from my reading of RBIL).
Anyone know for sure?
yes, CC work on all x86.
a) by setting TF to single step one instruction w/o
the need for replace/insert a byte there.
b) by setting breakpoints [DATA or CODE or I/O] to
trap at occurrence (reason for debug-registers).
note: CC work different to the avoidable CD03.
Ok, thanks for that information.

I am interested in restricting myself to the same tools
that Tim Paterson had when creating the precursor
to MSDOS, with the difference that I am
doing 32-bit C programming instead of 16-bit
assembler programming, so when I debug at the
assembler level, it is almost all generated code.

BFN. Paul.
a***@nospicedham.math.uni.wroc.pl
2022-11-28 20:53:27 UTC
Permalink
Post by Paul Edwards
Post by wolfgang kern
Post by Paul Edwards
I have implemented TF (trap flag) for the 8086.
But when I looked up RBIL, it doesn't say that TF
also works for the 80386. INT 1 is complicated
instead.
So can I single-step an 80386 program?
It looks like x'cc' still works on an 80386, invoking
INT 3 (from my reading of RBIL).
Anyone know for sure?
yes, CC work on all x86.
a) by setting TF to single step one instruction w/o
the need for replace/insert a byte there.
b) by setting breakpoints [DATA or CODE or I/O] to
trap at occurrence (reason for debug-registers).
note: CC work different to the avoidable CD03.
Ok, thanks for that information.
I am interested in restricting myself to the same tools
that Tim Paterson had when creating the precursor
to MSDOS, with the difference that I am
doing 32-bit C programming instead of 16-bit
assembler programming, so when I debug at the
assembler level, it is almost all generated code.
AFAIK CP-M was originally written in PL-M. Then, to improve
performance it was routine-by-routine rewritten in assembly.

Concerning debugging, integrated debug support is relatively
late, but there were external circuits that could single
step the processor, stop it on access to some specific
address and similar. High-end systems on this sort were
expensive, but established company could easily afford
them.
--
Waldek Hebisch
Paul Edwards
2022-12-04 11:28:17 UTC
Permalink
Post by a***@nospicedham.math.uni.wroc.pl
Concerning debugging, integrated debug support is relatively
late, but there were external circuits that could single
step the processor, stop it on access to some specific
address and similar. High-end systems on this sort were
expensive, but established company could easily afford
them.
By "integrated debug" I assume you mean things like
the TF triggering an interrupt. That doesn't sound like
something complicated. Is there a reason for it to be
"relatively late"?

Thanks. Paul.
George Neuner
2022-12-05 17:40:59 UTC
Permalink
On Sun, 4 Dec 2022 03:28:17 -0800 (PST), Paul Edwards
Post by Paul Edwards
Post by a***@nospicedham.math.uni.wroc.pl
Concerning debugging, integrated debug support is relatively
late, but there were external circuits that could single
step the processor, stop it on access to some specific
address and similar. High-end systems on this sort were
expensive, but established company could easily afford
them.
By "integrated debug" I assume you mean things like
the TF triggering an interrupt. That doesn't sound like
something complicated. Is there a reason for it to be
"relatively late"?
Thanks. Paul.
I assume (perhaps wrongly) that the poster is referring to JTAG.

JTAG was developed originally in the 1980's, but it was not widespread
or really affordable to small developers really the mid/late 2000's.

Some people do consider ~15 years ago to be 'recent'.

George
a***@nospicedham.math.uni.wroc.pl
2022-12-05 19:18:23 UTC
Permalink
Post by Paul Edwards
Post by a***@nospicedham.math.uni.wroc.pl
Concerning debugging, integrated debug support is relatively
late, but there were external circuits that could single
step the processor, stop it on access to some specific
address and similar. High-end systems on this sort were
expensive, but established company could easily afford
them.
By "integrated debug" I assume you mean things like
the TF triggering an interrupt. That doesn't sound like
something complicated. Is there a reason for it to be
"relatively late"?
One thing is debug registers. IIUC they were first in 386 and were
improved later. Now it seems that $0.4 processors contain
equivalent or better functionality. In 1975 typical
microprocessor needed external support chips, so there was
understandable resistance to putting something which was
not essential to running programs in processor chip.
And once we speak about external chips, folks who wanted
could add equivalent of debug registers using external
chips. Mass produces machines skipped debugging support
for cost reasons.

Another is view of "internal" state of "processor". In now
we have things like JTAG for this purpose. I early days
this was less important because signals that are internal
now were visible on processors bus and could be seen/manipulated
by external chips. Mainframes and minis typically contained
"operator console" which allowed view and modifications to
system bus and memory. Apparently home computers mostly
skipped this for cost reasons, but "developement systems"
had them.
--
Waldek Hebisch
Paul Edwards
2022-12-05 19:53:59 UTC
Permalink
equivalent or better functionality. In 1975 typical
microprocessor needed external support chips, so there was
understandable resistance to putting something which was
not essential to running programs in processor chip.
But was this more of a philosophical thing? I think
even cheap CPUs in 1975 have flag registers, so
adding a TF to trigger int 1 seems like not a lot of
effort. Would it have increased the price of a CPU
by more than 0.1%?

And why does the 8086 have that when other processors
didn't for whatever reason?
And once we speak about external chips, folks who wanted
could add equivalent of debug registers using external
chips. Mass produces machines skipped debugging support
for cost reasons.
And this is the problem I would like to avoid. At least with
the benefit of hindsight, we know that programmers are
going to lose decent debug support if you don't put the
basic (breakpoints and TF) debug support into the CPU
itself.

BTW, I only learnt about this INT 1 and 3 mechanism
about a year ago.

I can't remember if I mentioned it, but PDOS/86 and
PDOS/386 (from pdos.org) now support a "monitor"
that uses those two facilities.

BFN. Paul.

Loading...