Welcome to the world of Pascal/MT+. This document describes a professional tool which is being used at thousands of installations, worldwide. Pascal/MT+ supports the entire International Standards Organization (ISO) standard, DPS/7185 including variant records, sets, typed and text files, passing procedures and functions as parameters, GOTO out of a procedure, conformant arrays, and program parameters. The following is a list of additions to the standard supported by Pascal/MT+.
Pascal/MT+ is designed both for data processing applications (compilers, editors, linkers, and business packages) and real-time control applications (measurment Systems, communications processors, video tape controllers, etc.). All Pascal/MT+ software is suitable for using in a ROM-based environment and is designed to operate with or without an operating system. Various software manufacturers make Pascal/MT+ compatible software such as data base access methods.
The purpose of this chapter is to present an overview of the contents of the manual, a system overview, host system requirements and run-time system requirements, and to describe the files on the distribution disk as well as the minimum set needed to compile a program.
Because of the complex nature of Pascal as a language, and the availability of many textbooks, we are not providing tutorial documentation but rather a reference chapter and a detailed description of extensions and additions which make Pascal/MT+ unique. However, Appendix A contains a tutorial on files in the Pascal/MT+ system. Please refer to the bibliography and choose a textbook if you do not know the Pascal language.
MT MicroSYSTEMS has endeavored to produce a complete, integrated package of software tools and we are presently creating additional tools for use with this package. If you have suggestions for improving any MT MicroSYSTEMS' product, please WRITE US A LETTER. We evalutate, and often implement, user suggestions and comments. All suggestions become the property of MT MicroSYSTEMS, Inc.
The Pascal/MT+ system contains a compiler, linker, disassembler, debugger, run-time subroutine library, and optional editor package. Figure 1 shows a diagram of the relationships among these programs.
(any CP/M compatible editor may be used including our SpeedProgramming (tm) editor, which includes a syntax scanner).
+--------+ | editor | +--------+ | (temporary file created and deleted by the compiler) V / +----------+ | compiler |<---- error message text file +----------++ | | V +-> relocatable file [run-time-library] listing | | | also [other user modules] file | V V | | +--------+ | | | linker |<---- [optional debugger] | | +--------+ | | | | | V | | executable program | | (optional symbol table) V V +----------------------+ + disassembler +---> intermixed source and assembly code +----------------------+
The user executes the compiler to translate source programs into relocatable machine code. Then the user links this machine code with the run-time subroutine library to produce an executable object program. If desired, a "listing" file from the compiler and the relocatable file may be combined into a intermixed file of source code and assembly code using the disassembler. The user may also inform the compiler that use of the symbolic debugger is desired. The compiler and linker will then output an executable object module with the symbolic debugger included. Facilities such as variable display, breakpoints and tracing are available using the symbolic debugging package.
The Pascal/MT+ system requires an 8080, 8085, or Z80 CPU running the CP/M operating system (release 1.4 or later) in which to operate. Other operating systems which claim to be CP/M compatible may be used but the responsibility for compatibility lies with the user.
In a CP/M environment, the compiler requires 92K of simultaneous on-line storage. The Pascal/MT+ compiler requires 36K bytes of memory in which to reside. The compiler symbols occupy 4K bytes of symbol table space (this number may be changed using $K toggles to eliminate unused symbols) and still more space is needed for user symbols. For example, the largest module of the Pascal/MT+ compiler requires 17K of symbol table space. This means that a minimum recommended TPA (transient program area) of 43K is needed to compile small programs (allowing 3K for user symbols). A 48K CP/M system, in most cases, provides this minimum TPA If the entry to the BDOS is higher than ABFF you have enough room to compile small programs. However, a 48K TPA is recommended as a minimum working environment. Additional memory, if present, will automatically be used.
The linker requires only 11K bytes of disk and memory space. Because it uses memory for linking programs and run-time routines, the amount of available memory limits the program size which can be linked. A 59K TPA (maximum available memory for a minimum configuration 64K CP/M) has approximately 49K bytes of work space after the linker and linker data is loaded. This work space must contain the symbol table and the object code. In addition, if the /D switch is not used it must also contain the data area. Overlays can be used when the program becomes to large to link in one step.
The Pascal/MT+ system generates programs which utilize a variety of run-time support subroutines which are extracted from PASLIB, the run-time library, and other relocatable modules. These run-time routines handle such needs as "multiply" and "divide" and file input and output interface to the operating system. CP/M 2.0 or a later release is required to use random access files.
For programs which are run under the CP/M operating system the minimum run-time overhead is typically in the 2K- to 6K-byte range. This includes support routines and text file I/O routines for integer, characters and strings. Additional modules will be included for routines which utilize REAL numbers, non-text file I/O, transcendental routines, etc. Below are the current approximate sizes (in 1024 byte units) of the run-time libraries and support modules. These numbers are subject to change without notice. If you need a very accurate view of run-time overhead, link the individual file, ignore the undefined references, and note the code and data size at the end of the link.
File | Code | Data | Total |
---|---|---|---|
PASLIB* | 16.8 | 2.3 | 19.1* |
FPREALS** | 6.1 | 0.5 | 6.6 |
TRANCEND | 2.5 | 0.3 | 2.8 |
BCDREALS** | 2.3 | 0.1 | 2.4 |
FULLHEAP*** | 1.8 | 0.1 | 1.9 |
RANDOMIO | 2.1 | 0.1 | 2.2 |
DEBUGGER+ | 7.9 | 1.2 | 9.1 |
REALIO++ | 4.0 | 0.4 | 4.4 |
FPRTNS+++ | 0.8 | 0.1 | 0.9 |
TRAN9511+++ | 0.4 | 0.1 | 0.5 |
* | normally only the referenced routines are linked using only 2 to 6 K bytes |
** | only one of these are used for software real number support. FPREALS is searchable, BCDREALS is not searchable |
*** | used for ISO heap management; PASLIB contains a smaller version for UCSD style heap management |
+ | when used, compiler generates extra code; never contained in final version of program |
++ | counted in FPREALS already, used only for AMD9511 support |
+++ | used only for AMD9511 support |
The Pascal/MT+ software package is distributed on media compatible with your computer (tape, diskette, etc.) The package consists of a number of CP/M files containing object, source and relocatable files. Listed below are the names of all of these files, a brief description of their contents and a list of which files are required to configure a minimum operational disk. These files are subject to change without notice as later releases of the software become available and the contents of the distribution disks change.
FILE | CONTENTS |
---|---|
MTPLUS.COM | Pascal/MT+ compiler, executable CP/M file (Phase 0) Syntax scanner and listing file generator also generates PASTEMP.TOK temporary file which is approximately 1/3 the size of the source code file. Also uses MTERRS.TXT for error message text. |
MTERRS.TXT | Ascii text for error messages used by MTPLUS.COM |
MTPLUS.000 | Root program (a .COM file renamed so that it cannot be executed directly) which calls the overlays .001 through .006. |
MTPLUS.001 | Built-in symbol table initialization. |
MTPLUS.002 | User Symbol table construction (Phase 1) |
MTPLUS.003 | Code generator initialization |
MTPLUS.004 | Object code generator pass (Phase 2) |
MTPLUS.005 | Code generator termination and external reference output |
MTPLUS.006 | Debugger symbol table output routine (actually executed between .002 and .003 overlays) |
LINKMT.COM | Pascal/MT+ linker, takes .ERL and .CMD files as input and optionally creates .COM, HEX SYM and SYP files |
PASLIB.ERL | Searchable run-time subroutine library in relocatable form. Always linked last. |
FPREALS.ERL | Software floating point support routines. This is a library which contains software floating point routines and REALIO.ERL. Searchable and must be linked just before PASLIB. |
TRANCEND.ERL | Transcendental function support (for software floating point only). |
BCDREALS.ERL | Business arithmetic support routines (does not include square root or trancendentals). |
DEBUGGER.ERL | Relocatable code for symbolic debugger (linked as main program when used). |
DEBUGHELP.TXT | Contains a summary of debugger commands. |
DIS8080.COM | Disassembler program. Takes .PRN and .ERL files as input and outputs intermixed listing file to file, console or printer. Also handles Z80 instructions generated by the compiler. Only usable for Pascal programs, not a general purpose disassembler. |
LIBMT.COM | Librarian program which inputs .BLD and .ERL files to create searchable libraries OR L80 compatible modules. |
FULLHEAP.ERL | Complete new and dispose, with garbage collection and heap management routines in relocatable form. PASLIB contains UCSD-style stack heap routines. This module must be linked before PASLIB to use these routines. |
ROVLMGR.ERL | Overlay manager assembled with the RELOAD option TRUE. |
CALC.SRC | Sample program for testing floating point. Useful when using AMD9511 hardware to insure proper operation of the 9511. |
REALIO.ERL | Read and Write real routines for floating point necessary only when using AMD9511 hardware floating point routines. |
AMDIO.SRC | Module containing routines which interface to the AMD9511. User must edit and recompile to customize for specific hardware requirements. |
FPRTNS.ERL | Support routines for AMD9511 hardware floating point |
TRAN9511.ERL | Module containing 9511 drivers for transcendental functions only for use with hardware floating point |
AMD9511.CMD | Linker command file including AMDIO, FPRTNS, REALIO and TRAN9511 |
AMD9511X.CMD | Linker command file including just AMDIO and FPRTNS |
UTILMOD.ERL | Module which contains KEYPRESSED, RENAME and EXTRACT utility subroutines. |
RANDOMIO.ERL | Random I/O routines which are compatible with sequential files. |
The following run-time library subroutines are provided in source code form. Some of these are supplied to allow users who are running without an operating system, e.g., without CP/M, to properly interface to their hardware. Others are provided so that the user may change the action of the routines as they are performed in PASLIB. These routines are identical or functionally compatible with the routines in PASLIB.ERL. Nearly all are supplied in Pascal module form so that users will not require an assembler to implement ROM based programs in most cases.
PINI.SRC | Initialization routine |
CPMRD.SRC | Used by Read string routine (@RST) Included because it uses CP/M direct BDOS call. |
HLT.SRC | "halt" routine. Current routine calls CP/M. |
CHN.MAC | Chaining routine. May be changed to do bank switching, etc. as desired in a non-CP/M environment. As this is fairly special it is supplied in assembly code. NOTE: MOST ROM BASED SYSTEMS WILL NOT USE CHAIN AND THEREFORE THE USER NEED NOT HAVE AN ASSEMBLER TO CREATE A ROM BASED SYSTEM! |
RNC.SRC | Contains read next character routine. |
WNC.SRC | Contains write next character routine. |
DIVMOD.MAC | Source for DIV and MOD routines which include a direct call to CP/M for divide by 0 error message. |
FIBDEF.LIB | Include file for PINI, RNC and WNC. Definition of the file control block. |
OVLMGR.MAC | Overlay manager. User selectable options to allow more overlays or to allow overlays to call overlays. Unmodified version already in PASLIB. |
IOERR.SRC | Sample routine for user-handled I/O errors. |
XBDOS.SRC | BDOS routine which contains calls to IOERR. |
IOCHK.BLD | File to be used to create I/O error library. |
RST.MAC | Read string routine. |
CWT.MAC | Wait for end-of-line routine. |
GET.SRC | Low level input routine. |
PUT.SRC | Low level output routine. |
@RNB.SRC | Read next byte routine. |
@WNB.SRC | Write next byte routine. |
The files listed below are the absolute minimum required to operate the Pascal/MT+ compiler. They need not all be present on the same disk but all need to be on-line. Additional files such as the linker and libraries may be on the same disk but are not necessary to operate the compiler. The MTPLUS.006 overlay is only necessary to use the debugger and otherwise need not be on-line.
FILE | SIZE | ||
---|---|---|---|
MTPLUS.COM | 35k | executable compiler | |
MTPLUS.000 | 13k | root program, calls overlays | |
MTPLUS.001 | 11k | } | |
MTPLUS.002 | 7k | } | |
MTPLUS.003 | 8k | } | overlays for compiler |
MTPLUS.004 | 17k | } | (always required) |
MTPLUS.005 | 8k | } | |
MTPLUS.006 | 6k | only necessary if debugger requested |
The total size required is 92k, or 86k if debugger is not requested. These numbers are subject to change without notice. If you cannot fit all of the above files onto one disk there is a method by which the root and overlay files may reside on another on-line disk. This is done by using a compiler command switch which informs the compiler that the root and overlays are on a different drive. See Section 2.2.2.
The minimum files required to link a program are:
LINKMT.COM | 11k | linker |
PASLIB.ERL | 19k | Run-time support library |
Other .ERL files may be required if calls are made to them from a Pascal program. See Section 2.3 on the linker which contains the list of .ERL files supplied and which ones are required to be linked into your program to resolve references.
If you have room, the ideal configuration is to place all of the above files plus MTERRS.TXT (the error message text file) on one disk. The data can be on the same disk if there is room, or on a second online disk.