7.5. Interfacing to Borland Pascal Programs
===========================================
Interfacing to Borland Pascal programs is similar in concept to
interfacing to 16-bit C programs. The differences are:
* The leading underscore required for interfacing to C programs is
not required for Pascal.
* The memory model is always large: functions are far, data pointers
are far, and no data item can be more than 64K long. (Actually,
some functions are near, but only those functions that are local
to a Pascal unit and never called from outside it. All assembly
functions that Pascal calls, and all Pascal functions that
assembly routines are able to call, are far.) However, all static
data declared in a Pascal program goes into the default data
segment, which is the one whose segment address will be in `DS'
when control is passed to your assembly code. The only things that
do not live in the default data segment are local variables (they
live in the stack segment) and dynamically allocated variables.
All data _pointers_, however, are far.
* The function calling convention is different - described below.
* Some data types, such as strings, are stored differently.
* There are restrictions on the segment names you are allowed to use
- Borland Pascal will ignore code or data declared in a segment it
doesn't like the name of. The restrictions are described below.