Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

as(1)

ld(1)

sdb(1)

prof(1)

monitor(3)



  pc(1)                               CLIX                               pc(1)



  NAME

    pc - Runs a Pascal compiler

  SYNOPSIS

    pc [flag ... ] file ...

  FLAGS

    -c            Suppresses the link edit phase of the compilation and force
                  an object file to be produced even if only one program is
                  compiled.

    -g            Causes the compiler to generate additional information
                  needed to use source language debuggers like sdb and forces
                  the compiler to generate frame pointers for stack traces.

    -C            Enables run-time checking of subranges and array bounds.

    -ga           Generates a frame pointer for stack traces.

    -o filename   Places the executable binary output from the link edit phase
                  in the file named filename.  If this flag is not specified,
                  the executable file will be named a.out.  This flag is
                  ignored if the -c or -S flag is present.

    -O            Optimizes the program for speed at the expense of code
                  space.  The default compiler settings cause Green Hills
                  Pascal to perform most or all optimizations that other
                  compilers perform only under the -O flag.  Experiment with
                  this flag to determine whether the additional code size and
                  compilation time are worth the execution speed gain.

    -p            Arranges for the compiler to produce code that counts the
                  number of times each routine is called; also, if link
                  editing occurs, replaces the standard startup routine with
                  one that automatically calls monitor() at the start and
                  arranges to write out a mon.out file at normal object
                  program termination.  An execution profile can then be
                  generated by using prof.

    -s            Compiles the program in ANSI-compatible mode.  Generates
                  errors when extensions to the ANSI Pascal standard are used.
                  Using this flag will change the default subrange of the set
                  type from 0-31 to 0-255, resulting in less efficient code
                  for set handling.

    -S            Compiles the named Pascal programs and leave the assembler-
                  language output on corresponding files suffixed with .s.
                  The assembler and link edit phases are suppressed.



  2/94 - Intergraph Corporation                                              1






  pc(1)                               CLIX                               pc(1)



    -v            Displays the program name and command line arguments of each
                  phase of the compilation/link process.

    -w            Suppresses warning diagnostics.

    -X n          Turns on compile-time option number n.

    -Z n          Turns off compile-time option number n.  The available
                  compile-time options are listed below.

                  9     Disables the local (peephole) optimizer.

                  18    Does not allocate programmer-defined local variables
                        to a register unless they are declared with register.

                  32    Displays the names of files as they are opened.  This
                        is useful for determining why the compiler cannot find
                        an include file.

                  37    Emits a warning when dead code is eliminated.

                  39    Does not move frequently-used procedure and data
                        addresses to registers.

                  58    Does not put an underscore in front of the names of
                        global variables and procedures.  This option is not
                        recommended because it produces symbols that are
                        incompatible with the rest of the CLIX System.

                  59    Turns off case sensitivity.

                  87    Disables the optimization that deletes all code that
                        stores in or modifies variables that are never read
                        from.

                  89    Packs structures with no space between members.
                        CAUTION: This may make the structure members
                        impossible to access.

                  156   Exports the names of variables declared in the
                        outermost scope of a Pascal main program for use in
                        other modules of a multiple-module executable program.
                        The default is for variables declared in the outer
                        scope of a Pascal main program to be static and
                        inaccessible from other modules.

                  168   Does not move invariant floating-point expressions out
                        of loops.

                  174   Appends an underscore to the names of all external
                        procedures and functions to avoid name conflicts with



  2                                              Intergraph Corporation - 2/94






  pc(1)                               CLIX                               pc(1)



                        library routines.  This option is used if -s is
                        specified.

                  190   Assumes halfword objects are not aligned.

                  191   Assumes word objects are not aligned.

                  192   Assumes single-precision objects are not aligned.

                  193   Assumes double-precision objects are not aligned.

                  194   Assumes word objects are aligned only to halfword
                        boundaries.

                  195   Assumes single-precision objects are aligned only to
                        halfword boundaries.

                  196   Assumes double-precision objects are aligned only to
                        halfword boundaries.

                  197   Assumes double-precision objects are aligned only to
                        word boundaries.

  DESCRIPTION

    The pc command is the interface to the Green Hills Pascal compiler.  Files
    ending in .p are assumed to be Pascal source files and are compiled to
    relocatable object files whose names are derived by replacing the .p
    suffix of the source filename with .o.  If no compilation errors are
    detected, pc attempts to link the relocatable objects to produce an
    executable file.  If the linking is successful, the intermediate object
    files are deleted.

    The pc command works similarly on files with a .s suffix.  In this case,
    however, the files are assumed to be assembly source and the compilation
    phase is bypassed.

    The pc command will also accept other file types or combinations of file
    types as input.  It will compile or assemble files that end in .p or .s
    and pass the results and/or other filenames to the link editor.  When
    invoking the link editor, pc will specify -lpc, -lm, and -lc on the link
    editor command line.

    An executable may be built from separately-compiled source files.
    However, only one of the source files may contain a program statement.
    Variables may be shared among source files by declaring them at the
    outermost level in the files in which they are referenced.  A function or
    procedure defined in one file may be called from another file provided the
    caller declares the function or procedure with an external declaration.
    The syntax for an external declaration is identical to the syntax of a
    forward declaration.



  2/94 - Intergraph Corporation                                              3






  pc(1)                               CLIX                               pc(1)



    Pascal object files may be linked with C and/or FORTRAN object files.
    Pascal passes parameters by value unless the var keyword is used in the
    formal parameter declaration.  In this case, parameters are passed by
    reference.  C always passes parameters by value, FORTRAN always passes by
    reference.  Note that all FORTRAN function, subroutine, and common names
    are stored in the symbol table with an underscore (_) appended.

  EXAMPLES

    1.  This example causes the Pascal compiler to compile the file mine.p
        into the object file mine.o with optimization turned on, and forces
        the compiler to generate frame pointers.

        pc -O -ga -c mine.p


    2.  This example shows the command line used to compile the files foo.p
        and baz.p with optimization turned on, and links them into the
        executable module exe.

        pc -o exe -O foo.p baz.p


  FILES

    file.p Pascal source input file.

    file.o Object file; generated or input.

    file.s Assembly-generated output.

    /usr/lib/pcom, lib/pcom
           Pascal compiler.

    /bin/as
           Assembler (as).

    /bin/ld
           Link editor (ld).

    /lib/crt[1n].o
           Run-time startup.

    /lib/mcrt[1n].o
           Profiling startup.

    /usr/lib/libpc.a
    /lib/libpc.a
           Pascal intrinsic functions and I/O library.

    /lib/libc.a



  4                                              Intergraph Corporation - 2/94






  pc(1)                               CLIX                               pc(1)



           Standard C library.  See section 3 in the Programmer's Reference
           Manual.

    /lib/libp/lib*.a
           Profiled versions of libraries.

    mon.out
           Profiling information.

  EXIT VALUES

    The exit values are not valid.

  RELATED INFORMATION

    Commands:  adb(1), as(1), ld(1), sdb(1), prof(1)

    Functions:  monitor(3)

    The Green Hills Software Users Manual Pascal-CLIPPER


































  2/94 - Intergraph Corporation                                              5




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026