Next: 12.2 Functions and Procedures
Up: 12. The system unit
Previous: 12. The system unit
Subsections
The following integer types are defined in the System unit:
shortint = -128..127;
Longint = $80000000..$7fffffff;
integer = -32768..32767;
byte = 0..255;
word = 0..65535;
And the following pointer types:
PChar = ^char;
pPChar = ^PChar;
For the SetJmp and LongJmp calls, the following jump bufer
type is defined (for the I386 processor):
jmp_buf = record
ebx,esi,edi : Longint;
bp,sp,pc : Pointer;
end;
PJmp_buf = ^jmp_buf;
The following constants for file-handling are defined in the system unit:
Const
fmclosed = $D7B0;
fminput = $D7B1;
fmoutput = $D7B2;
fminout = $D7B3;
fmappend = $D7B4;
filemode : byte = 2;
Further, the following non processor specific general-purpose constants
are also defined:
Remark: Processor specific global constants are named Testxxxx
where xxxx represents the processor number (such as Test8086, Test68000),
and are used to determine on what generation of processor the program
is running on.
The following variables are defined and initialized in the system unit:
var
output,input,stderr : text;
exitproc : pointer;
exitcode : word;
stackbottom : Longint;
loweststack : Longint;
The variables ExitProc, exitcode are used in the Free Pascal exit
scheme. It works similarly to the on in Turbo Pascal:
When a program halts (be it through the call of the Halt function or
Exit or through a run-time error), the exit mechanism checks the value
of ExitProc. If this one is non-Nil, it is set to Nil, and
the procedure is called. If the exit procedure exits, the value of ExitProc
is checked again. If it is non-Nil then the above steps are repeated.
So if you want to install your exit procedure, you should save the old value
of ExitProc (may be non-Nil, since other units could have set it before
you did). In your exit procedure you then restore the value of
ExitProc, such that if it was non-Nil the exit-procedure can be
called.
The ErrorAddr and ExitCode can be used to check for
error-conditions. If ErrorAddr is non-Nil, a run-time error has
occurred. If so, ExitCode contains the error code. If ErrorAddr is
Nil, then ExitCode contains the argument to Halt or 0 if the
program terminated normally.
ExitCode is always passed to the operating system as the exit-code of
your process.
Under GO32, the following constants are also defined :
const
seg0040 = $0040;
segA000 = $A000;
segB000 = $B000;
segB800 = $B800;
These constants allow easy access to the bios/screen segment via mem/absolute.
root
1999-06-10