or you can use the TD directly and single step the code in ASM land.
TD was one of the few debuggers with which you could do source-level debugging (
if the program was compiled for it), so no need for the (frequently futile) "step-into-asm-land" games.
But then, you could already do that (and better) with the integrated debugger, so Turbo Debugger was--for me--a kind of "last resource weapon". And a very good one, in fact, to debug long assembler programs
Returning to the thread's subject ... here is how you set a breakpoint in your code (attached image):
- Go to the line in which you wish to stop
- Select the menu "Debug -> Add breakpoint
- Done!
For run-testing, you can add a
Write or
WriteLn before that same line, or after, or both.
The real problem, as jamie said, is to guess just
where you want to look.
When looking for an external error, you should find where in the code that error is being generated. Pausing (or logging) on lines that deal with it much later is of little use.
In your case, there is probably some place where something is being sent/queried to/from each module.
There is where you should concentrate your debugg¡ng efforts: Try to see exactly what is being sent and received and compare it with what the hardware specs say should be. Maybe you're forgetting to set/reset some bit? Skipping some step that must be done? Sending the wrong command or in the wrong order?
That's where I would start. YMMV, of course