HP Pascal/iX Reference Manual (31502-90022)

12- 14
END ; {nested}
$POP$
BEGIN {intnl}
{ Optimizer assumes:
{ PASCAL_POINTERS (inherited)
{ PARM_TYPES_MATCH (inherited)
{ LOCAL_GOTOS_ONLY (specified)
{ NO_SIDE_EFFECTS (known after compilation)
}
nested ;
END ; {intnl}
$POP$
BEGIN { main program }
{ Optimizer assumes:
{ PASCAL_POINTERS (implied)
{ PARM_TYPES_MATCH (implied)
}
intnl ;
999:
END .
Example 2
The following example turns on the IEEE floating-point traps. (On HP-UX,
the +FPZ option can be used instead of the call to HPENBLTRAP). This
program would have aborted on the divide by 0 if the loop invariant
expression was moved out of the loop.
$ASSUME 'FLOAT_TRAPS_ON'$ $OPTIMIZE ON$
program trap;
var
r,s : real;
i : integer;
oldmask : integer;
procedure hpenbltrap; intrinsic;
begin
hpenbltrap(hex('ffffffff'),oldmask);
s := 0.0;
r := 0.0;
for i := 0 to 10 do
begin
if r <> 0.0 then
s := 1.0 / r; { divide by zero? }
s := s + 1.0;
end;
end.
See the
Pascal/iX Programmer's Guide
or the
Pascal/HP-UX Programmer's
Guide
, depending on your implementation, for more information on +FP. See
the
Trap Handling Programmer's Guide
for more information on HPENBLTRAP.
See the
PA-RISC 1.1 Architecture and Instruction Set Reference Manual
for
more information on IEEE floating point instructions and traps.
BUILDINT
BUILDINT is an HP Pascal Option.
The BUILDINT compiler option causes the compiler to build an intrinsic
file.