[Next] [Up] [Previous]

The JUMP Statement

A JUMP statement has the form

       JUMP address-expression, {alt-1, alt-2, alt-3...}

and transfers control to the address which is the value of the address-expression. This address may be represented in a hardware-specific notation, and thus address arithmetic need not have defined results. Also, the target address of a JUMP may be required to be within the same program module as the JUMP for it to work by some implementations.

Only the first argument of this statement is required; alt-1, alt-2, and so on may only be line numbers, and, if they are provided, are to be the possible destinations of the JUMP. It is intended that they are to be used, if provided, to facilitate program optimization.

The only use of the JUMP statement that must be supported by all implementations is that illustrated by the following example:

       . IVEC=%25
(intervening statements)
       JUMP IVEC

the JUMP statement is to have the same result as

       GO_TO 25

as %25 is a constant with the address of program line 25 as its value.

Thus, the JUMP statement acts as a FORTRAN assigned GO TO statement. Its purpose is to allow a highly efficient transfer of control to one of several alternatives where the alternative is selected in advance, but many transfers to that specific alternative are made.

Variables declared INTEGER instead of ADDRESS will be usable in most implementations, particularly on mainframes, but the possibility that they may not be allowed in this use must be considered. It is also possible that an implementation may permit use of INTEGER variables only when the list of possible addresses is provided, and that a subset implementation of this type may furthermore not have an ADDRESS type.

[Next] [Up] [Previous]