Turbo Pascal Internals
Turbo Pascal compiler functions are grouped into several categories/units according to their role in the compiler. This grouping is done only to have a better overview on the individual parts of the compiler. On the other hand, functions from one group usually share common types and variables and therefore it makes sense to place them in separate units.
Basic facts about Turbo PascalUnit files in Turbo Pascal (tpu extension) are actually symbol tables that are compacted and saved as individual files. The System unit is implicitly used in every program or unit. It contains the boot-strap symbol table and compiler procedures. The definition order of these compiler procedures is important because compiler calls them by id number. To compile System unit you need bootstrap symbol table (SYSTEM.TPS).
Boot-strap symbol table contains system types like Byte, Char, Boolean, port identifiers, memory identifiers, system functions and system procedures.
Turbo Pascal library (extension tpl) is simple binary concatenation of one or more units. It is loaded at the compiler start. It should contain at least the system unit. You can create unit with console command copy: Turbo Pascal uses low-level intermediate code. Each record can contain target instruction with reference data, intermediate code instruction for subroutines or special meta instruction. Turbo Pascal relies heavily on the segment:offset architecture of the x86 family in the real mode. In many cases this is a limiting factor because many data structures are limited to 64 KB. But on the other hand this comes very convenient when dealing with addresses and offsets. |
|
|