T. Ment
2020-04-13 17:31:34 UTC
The MS-DOS Encyclopedia has a sample TSR, snap.asm. I built and ran it,
but the PC locked up. SoftICE can debug TSRs, but that's overkill if the
bug is in the transient setup part, before going resident. In that case,
tools like debug.exe will do.
In DOS Internals, Chappell says he likes symdeb.exe. I didn't know much
about it, but I wanted to learn more.
It's similar to debug.exe, but enhanced for symbolic debugging. Still
has a primitive interface, but that's good for conserving memory. Takes
less than 40k.
4.00 is the final version of symdeb.exe. It comes with MASM 4.00. But
MASM 4.00 has no /Zd switch, so you don't get debugging info in the .OBJ
file. At that point in history, symbolic debugging only worked with the
Microsoft high level language compilers.
MASM 5 has the /Zd switch, and I wondered if that would work with symdeb
4.00.
I found that mapsym won't create the .SYM file right unless you have at
least one public symbol in your .asm source. So I made the entry point a
public symbol, and then it all worked, like so:
masm /Zd snap;
link /li /m snap;
mapsym snap
symdeb snap.sym snap.exe
As for the PC lockup bug, it was in the transient part, so I was able to
find it without using SoftICE.
To avoid tedious typing, I copied SNAP.ASM from the MSLIB 1.3 CD-ROM.
But it has a nasty typo, which was corrected in the book. Seems strange
that the book is right and the disk is wrong, but that's how it is.
Now snap.exe works. No more PC lockup.
but the PC locked up. SoftICE can debug TSRs, but that's overkill if the
bug is in the transient setup part, before going resident. In that case,
tools like debug.exe will do.
In DOS Internals, Chappell says he likes symdeb.exe. I didn't know much
about it, but I wanted to learn more.
It's similar to debug.exe, but enhanced for symbolic debugging. Still
has a primitive interface, but that's good for conserving memory. Takes
less than 40k.
4.00 is the final version of symdeb.exe. It comes with MASM 4.00. But
MASM 4.00 has no /Zd switch, so you don't get debugging info in the .OBJ
file. At that point in history, symbolic debugging only worked with the
Microsoft high level language compilers.
MASM 5 has the /Zd switch, and I wondered if that would work with symdeb
4.00.
I found that mapsym won't create the .SYM file right unless you have at
least one public symbol in your .asm source. So I made the entry point a
public symbol, and then it all worked, like so:
masm /Zd snap;
link /li /m snap;
mapsym snap
symdeb snap.sym snap.exe
As for the PC lockup bug, it was in the transient part, so I was able to
find it without using SoftICE.
To avoid tedious typing, I copied SNAP.ASM from the MSLIB 1.3 CD-ROM.
But it has a nasty typo, which was corrected in the book. Seems strange
that the book is right and the disk is wrong, but that's how it is.
Now snap.exe works. No more PC lockup.