• Aucun résultat trouvé

RUNNING PASCAL/VS PROGRAMS

Dans le document Pascal in MTS (Page 64-67)

COMPILING & EXECUTING PASCAL/VS PROGRAMS

RUNNING PASCAL/VS PROGRAMS

When the Pascal/VS program successfully compiles, an object module is produced. To run that program, a $RUN command of the following form is used:

$RUN program [mts-par] [PAR=[pascal-par/][program-par]]

where “program”

is the name of the file or device containing the object module to be run.

“mts-par”

consists of logical I/O unit assignments, time and page limits, and other parameters which can be specified on an MTS $RUN command (see MTS Volume 1,The Michigan Terminal System, for a description of the $RUN command).

“pascal-par”

is a list of Pascal/VS run-time system options (see the section, “Run-Time Options,” for a complete list.)

and “program-par”

is the program-specific parameter list for “program”, and the predefined function PARMS returns this string as value, at execution time.

Some examples of running Pascal/VS produced programs:

$RUN -obj SCARDS=mydata T=3

$RUN -obj 1=-inp1 2=-inp2 SPRINT=*PRINT* T=2 PAR=COUNT/full

$RUN wabc:bigfile SCARDS=-data T=4 PAR=debug/

$RUN object T=3 PAR=program parameter string

$RUN -obj1+-obj2+-obj3 SCARDS=data T=3 PAR=/find/words/

Note that if <prog-par> contains “/”, <pas-par> must be given, although it may be null.

Run-Time Options

Features within the Pascal/VS run-time environment may be enabled or disabled by passing options to the Pascal/VS run-time system. These options are passed to a Pascal/VS program through the PAR field. To distinguish run-time options from the parameter string intended to be processed by the program, the options must precede the parameter string (if any) and be terminated with a slash “/”.

The following is a list of supported run-time options:

64 Pascal/VS: Compiling & Executing Pascal/VS Programs

________________________________________________________

The COUNT option specifies that instruction frequency information is to be collected during program execution. After the program is completed, the information is written to the predefined file variable Output. This option will have an effect only if the program was compiled with the DEBUG option.

DEBUG

The DEBUG option specifies that the interactive debugger is to gain initial control when the program is invoked. Note: This option is valid only if the object module was generated with the DEBUG option. The DEBUG option causes the SETMEM option to become effective.

ERRCOUNT=n

The ERRCOUNT option puts an upper limit on the number of nonfatal run-time errors that can occur. After “n” errors have occurred, execution is terminated.

HEAP=k

The HEAP keyword specifies the minimum number of kilobytes (1024 bytes) by which the heap is to be “extended” each time the heap overflows. The heap is where memory is allocated when the procedure NEW is called. When the end of the heap is reached, the MTS GETSPACE procedure is invoked to allocate more memory for the heap. An integral number of pages (4096 bytes) is always allocated. The fewest pages not less than the space required by NEW and “k”

kilobytes is allocated each time the heap is extended.

There is a significant overhead penalty for each invocation of GETSPACE. If “k” is too small, GETSPACE will be invoked frequently and the execution speed of the program will be affected.

If “k” is too large, the heap will occupy memory that is never used.

MAINT

The MAINT option specifies that when a run-time error occurs, the traceback is to list active run-time support routines. These routines begin with an AMP prefix and are normally suppressed from the traceback listing. This option is used to locate bugs within the run-time environment.

Pascal/VS: Compiling & Executing Pascal/VS Programs 65

NOCHECK

The NOCHECK option specifies that any checking errors detected within the program are to be ignored.

NOSPIE

The NOSPIE option specifies that the Pascal/VS run-time environment is not to intercept program interrupts.

SETMEM

The SETMEM option specifies that upon entry to each Pascal/VS routine, each byte of memory in which the routine’s local variables are allocated will be set to a specific value, namely FE (hexadecimal). This option aids in locating the source of intermittent errors that occur because of the use of uninitialized variables. This option becomes effective automatically if the DEBUG option is specified.

STACK=k

The STACK keyword specifies the minimum number of kilobytes (1024 bytes) by which the run-time stack is to be “extended” each time the stack overflows. The run-time stack is where the dynamic storage areas (DSA) of routines are allocated when the routines are invoked.

When the end of the stack is reached, the MTS GETSPACE procedure is invoked to allocate more memory for the stack. An integral number of pages (4096 bytes) is always allocated. The fewest pages not less than the DSA size and “k” kilobytes is allocated each time the stack is extended.

There is a significant overhead penalty for each invocation of GETSPACE. If “k” is too small, GETSPACE will be invoked frequently and the execution speed of the program will be affected.

If “k” is too large, the stack will occupy more memory than is necessary.

66 Pascal/VS: Compiling & Executing Pascal/VS Programs

Dans le document Pascal in MTS (Page 64-67)