HP Pascal/iX Reference Manual (31502-90022)

12- 20
BEGIN
:
$CODE OFF$
:
END;
$CODE ON$
BEGIN
:
END.
CODE_OFFSETS
CODE_OFFSETS is an HP Pascal Option.
When the CODE_OFFSETS compiler option is ON (and the LIST compiler option
is ON), the compiler prints a table that contains the statement number
and offset of each executable statement that it lists.
Syntax
$CODE_OFFSETS {ON }$
{OFF}
Default OFF
Location Anywhere.
The offset is the address of the first machine instruction generated for
the statement, relative to the start of the routine or outer block. It
is in hexadecimal.
The table appears at the end of the compiler listing.
Example
0 1.000 0 $LIST ON, CODE_OFFSETS ON$
0 2.000 0 $STANDARD_LEVEL 'HP_MODCAL'$
0 3.000 0 PROGRAM x (output);
2 4.000 0 import arg;
0 5.000 0 VAR
0 6.000 0 x : integer;
1 7.000 0 y : argarrayptr;
2 8.000 0 s : string[40];
5 9.000 1 BEGIN
5 10.000 1 x := argc;
6 11.000 1 writeln('There were ',x:1,' argv elements');
7 12.000 1 writeln('Argv test');
8 13.000 1 y := argv;
9 14.000 1 FOR x := 1 TO argc-1 DO
10 15.000 2 BEGIN
10 16.000 2 setstrlen(s,0);
11 17.000 2 strmove(strmax(s), y^[x]^, 1, s, 1);
12 18.000 2 setstrlen(s, strpos(s,#0)-1);
13 19.000 2 writeln('Arg ',x:1,' = >',s,'<');
14 20.000 2 END;
14 21.000 1 writeln('Argn test');
15 22.000 1 FOR x := 0 TO argc-1 DO
16 23.000 1 writeln('Arg ',x:1,' = >',argn(x), '<');
17 24.000 1 END.
C O D E O F F S E T S
PROGRAM
STMT OFFSET STMT OFFSET STMT OFFSET STMT OFFSET STMT OFFSET
5 70 6 80 7 128 8 174 9 184
10 1B0 11 1B8 12 21C 13 274 14 390
15 3DC 16 404