Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 1.83 KB

FILES.md

File metadata and controls

36 lines (20 loc) · 1.83 KB

Files in this repository

MAIN.PAS

This is the Turbo pascal program that does nothing. It is compiled with Turbo Pascal 7.01 under the DOSBOX 0.74-3 emulation environment. The purpose of this skeleton code is to make it easier to separate user-generated code from the default system library code that is linked with it.

The source is compiled using the following commands:

TPC.EXE -GS -GP -GD -$D+ MAIN

... to produce an executable named MAIN.EXE

Go to: MAIN.PAS

MAIN.MAP

Upon compilation with the above command options, a map file is generated containing the size and offsets of the segments (data, code, stack, heap), the locations of the public symbols in the system library's data segment.

Go to MAIN.MAP

MAIN.DMP

This is the disassembled code for MAIN.EXE. Using the .MAP file generated above as well as DOS's basic debugger (DEBUG.EXE), we will be annotating the compiled code generated by the Turbo Pascal compiler.

Go to: MAIN.DMP, the annotated MAIN

SYSTEM.DMP

This is the system library linked to the program above. As the main program becomes larger and more complex, this library's starting location will likely change relative to the code segment for the main program above. The MAP file also allows us to annotate the various memory addresses in the code as they usually refer to the public symbols (data) listed in the map. The rest would be trying to figure out what the code does and which BIOS or DOS services it is using.

Because of varying starting location and length, it is possible that the dump here may not be the actual assembled code. Even a slight deviation in the offset where disassembly is started, will propagate the error. Further investigation may minimize such things from happening.

Go to: SYSTEM.DMP

Go back