I/O Utilities

Turbo Pascal contains many functions that read or write files, handle error messages and take care for compiler operation.

Loading Library

This procedure loads Turbo Pascal library (a collection of units). It adjust each unit so that it starts on a segment boundary. Actually, each compiled unit is a group of symbol tables.

Finding Files

Turbo Pascal needs to access files that may be located in different directories - located where the compiler is run or specified either in the configuration file or at the command line.

File Operations

Turbo Pascal needs to create, read from and write to files. Few simple routins take care for this.

Dealing With Source Files

For each source file Turbo Pascal keeps a record with essential data like file handle, file name, current line number, current position, conditional compilation IF level, etc.

Reading Source Lines

Source files are read into buffer from where source lines are extracted. NextLine procedure moves to the next source line. If a line was read it increments counters and returns True, otherwise if there are no more source lines NextLine returns False.

Creating Unit File

CompileUnit calls this procedure to create unit file which is in fact a collection of symbol tables. All segment addresses are cleared and symbol table data is written to the file.

Reading Unit File

This short procedure reads unit from file to symbol tables. If header is not valid it reports error.

© 2021 Turbo Pascal | Privacy Policy