COMTRAN Reconstruction

F28-8043 · June 1960

Page 56

PDF page 62 of 124. Download the scanned PDF

The page as scanned

The scan of PDF page 62 of F28-8043
Select the scan to open it at full size.

The text read off it

[page 56]

loaded over one which is longer, not all of the earlier procedure will be "erased." Accordingly, all overlapped procedures should have an unconditional GO TO as the last command.

The loading of an overlapped procedure does not cause its execution. The programmer must specify a transfer of control to the procedure by means of a GO TO or a DO command. Also, care should be taken to insure that a LOAD command does not appear within the procedure it obliterates. This would cause the destruction of the subsequent commands which effect transfer out of the procedure.

When a source program includes one or more OVERLAP commands, the object program will be organized as follows:

  1. The initial loading of storage will include all parts of the program not mentioned in any OVERLAP, plus the first procedure named in each OVERLAP command.
  2. Any procedures not included in the initial loading may be called in by a LOAD command.
  3. Any procedure that has been obliterated by a LOAD command may be retrieved (in its original form) by another LOAD command.

A simple example of the use of the OVERLAP and LOAD commands is as follows. The "housekeeping" portion of a program is to be executed and then overlapped by the main part of the program. Assuming that both procedures, i.e., both of these parts of the program, consist of more than one sentence, each must be treated as a section in order to apply names. The structure might be represented as follows:

HOUSEKEEPING.  BEGIN SECTION.
        ..................................................
        ..................................................
        ..................................................
        .................................., GO TO SUPERVISOR.1.
END HOUSEKEEPING.

MAIN.ROUTINE.  BEGIN SECTION.
        ..................................................
        ..................................................
        ..................................................
        ..................................................
END MAIN.ROUTINE.

SUPERVISOR.1.  LOAD MAIN.ROUTINE, GO TO MAIN.ROUTINE.

Elsewhere in the source program, probably included with the other processor commands, the programmer would write:

OVERLAP HOUSEKEEPING, MAIN.ROUTINE.

As indicated in the schematic program above, the program command, LOAD MAIN.ROUTINE, is placed outside the housekeeping routine, possibly in a short supervisory routine.

The BEGIN SECTION and END Commands

The two processor commands, BEGIN SECTION and END, perform a simple but important function. They are used to delimit sections of procedure and thus extend the range of a procedure-name. That is, they enable the programmer to give names to units of procedure that consist of more than one sentence. Unless BEGIN SECTION and END are used, a procedure-name applies only to the sentence which follows it.