HP 3000 Manuals

CODE_OFFSETS [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

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

Example 

     PROCEDURE outer;

        PROCEDURE inner;
        BEGIN
           .
           .
           .
        END;

     BEGIN
        .
        .
        .
     END;

                         C O D E  O F F S E T S

                             outer$4$inner

                     STMT   OFFSET   STMT   OFFSET
                        1       20      2     30

                                 outer

                     STMT   OFFSET   STMT   OFFSET
                        1       10      2       2C

Outer$4$inner is the procedure label for the level two procedure, inner,
contained in the level one procedure outer.  Statement one of inner is
offset 20 (hexadecimal) bytes from the address of inner.


NOTE This feature is intended for use with an assembly-level debugger. See the HP Pascal/iX Programmer's Guide or the HP Pascal/HP-UX Programmer's Guide for information on the debuggers. If you use optimization with this option, the offsets will not be correct.


MPE/iX 5.0 Documentation