SUBPROGRAM [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation
HP Pascal/iX Reference Manual
SUBPROGRAM
SUBPROGRAM is an HP Pascal Option.
The SUBPROGRAM compiler option causes the compiler to emit code for
specified level-one routines only. This includes routines nested within
those routines, but not the outer block.
Syntax
$SUBPROGRAM ['pfname[*] [,pfname[*]]...']$
Parameters
pfname Name of a level-one routine. The compiler emits code for
pfname and the routines nested within it, but not for the
outer block. If no pfnames are specified, or they are
entirely blank, the compiler compiles every routine, but
not the outer block.
* Causes the compiler to compile the immediately preceding
pfname with the LIST, CODE, and TABLES options ON.
(Subsequent LIST, CODE, and TABLES options override *.)
Default All level-one routines.
Location At front.
A compilation unit can contain more than one SUBPROGRAM option. The
following are equivalent:
$SUBPROGRAM 'Proc1,Proc2'$
and
$SUBPROGRAM 'Proc1'$
$SUBPROGRAM 'Proc2'$
The SUBPROGRAM option enables you to compile selected routines of a
program. The compiler checks the syntax and semantics of the entire
program, but generates object code for the selected routines only.
Example
0 1.000 0
0 2.000 0
0 3.000 0 $SUBPROGRAM 'proc2#, proc3#'$
0 4.000 0 PROGRAM show_subprogram (output);
0 5.000 0
0 6.000 0 PROCEDURE proc1 (p : integer);
2 7.000 1 BEGIN
2 8.000 1 writeln(p);
3 9.000 1 END;
3 10.000 0
0 11.000 0 PROCEDURE proc2 (p : integer);
2 12.000 1 BEGIN
2 13.000 1 writeln(p);
3 14.000 1 END;
3 15.000 0
I D E N T I F I E R M A P
IDENTIFIER CLASS TYPE ADDRESS/VALUE
P PARAMETER INTEGER PSP-24.0 (4.0)
LOCAL STORAGE USED = 0.0 TEMPORARY STORAGE USED = 0.0
PARAMETER STORAGE USED = 4.0 CONSTANT STORAGE USED = 0.0
0 17.000 0 PROCEDURE proc3 (p : integer);
2 18.000 1 BEGIN
2 19.000 1 writeln(p);
3 20.000 1 END;
3 21.000 0
I D E N T I F I E R M A P
IDENTIFIER CLASS TYPE ADDRESS/VALUE
P PARAMETER INTEGER PSP-24.0 (4.0)
LOCAL STORAGE USED = 0.0 TEMPORARY STORAGE USED = 0.0
PARAMETER STORAGE USED = 4.0 CONSTANT STORAGE USED = 0.0
0 22.000 1 BEGIN
0 23.000 1 END.
MPE/iX 5.0 Documentation