2
votes

I just want to inspect the assembly code of my program to see if he is loading my data in some registers.

I tried with "make" and "build" and selection "disk" as output, but there aren't any new files, besides source and exe file.

2
So disassemble the binary (.exe) with your favourite disassembler, or run your code in a debugger. It's normal for build tools to only produce object files, unless you use extra options to produce source. (And I don't know what those are for Turbo Pascal).Peter Cordes
Hi, I tried with "ndisasm" but the output file was huge. Is that normal? is just a c = a +b pascal program.fpilee
@PeterCordes : turbo Pascal that he is running probably predate PE by quite a few years. more like MZ DOS format.Michael Petch
@PeterCordes The advantage to programs that understand the DOS MZ format is that they understand the headers and will parse them out. NDISASM blindly dumps everything. And then it won't account for the relocation entries.Michael Petch
For disassembling Turbo Pascal programs I was used to W32DASM. Not sure if the link provided points to a legitimate version (Google showed a few links) but W32DASM worked very well with MZ exes.Margaret Bloom

2 Answers

2
votes

Turbo Pascal does not generate any intermediate assembler code to inspect. And since you want to interactively examine it you need a debugger anyway.

There is program called Turbo Debugger, also for DOS and with a similar UI as Turbo Pascal, which should suit your needs. If I remember it correctly, at least some version of it has been released as freely.

1
votes

As an alternative to using Turbo Pascal, you could try Virtual Pascal, which is 99.9% compatible with BP/TP 7. It's 32 bit, so you don't need DOSBox (or, if I may suggest a better alternative, DOSBox-X) and it generates a full assembler listing if you ask it to do so. The IDE also has a CPU window that shows you the generated code and allows you to single-step though it, highlighting the changed registers.