• Keine Ergebnisse gefunden

CONDITIONAL MACROS: WHEN, UNLESS, EVERY AUXILIARY CONDITIONAL MACROS: AND, OR

Im Dokument SHARE System for the IBM 709 (Seite 133-143)

FAD XCA

CHAPTER 4: CONDITIONAL MACROS: WHEN, UNLESS, EVERY AUXILIARY CONDITIONAL MACROS: AND, OR

The conditional macros are a means of restricting the conditions under which modal or information macros will be executed, and thus of ensuring the relevance limiting the quantity, and controlling the form of debugging output.

A conditional macro proper (WHEN, UNLESS, and EVERY) is effective only if the condition specified by its variable field is satisfied. When effective, WHEN and EVERY permit the execution of the next macro in sequence; UNLESS prevents the execution of all subsequent macros in the set. When the condition is not

satisfied, the effect of a conditional macro is reversed. AND and OR are auxiliary to, and governed by, a preceding WHEN or UNLESS (not EVERY). They specify, respectively, an additional or an alternative condition for the WHEN or UNLESS.

AND and OR are logically a part of the preceding WHEN or UNLESS and should not be considered independent macros.

Thus, for instance, a WHEN followed by ANDs and ORs must be considered a WHEN with a complex condition, and the "next macro in sequence" would then be the UNLESS, EVERY, modal or information macros immediately following the last AND or OR attached to the WHEN.

The control exercised by a conditional macro extends to the end of the continuous set of debugging macros in which it occurs. The control is terminated by any instruction which is not a debugging macro.

The condition specified by the variable field may be a simple count expressed by a decimal number. This number is compared with the contents of a counter which is maintained for each macro and incremented on each execution of the macro. The interpretation of the result of this comparison depends on the macro concerned and is discussed below under the heading for the particular macro.

A second form of the variable field is provided for all conditional macros except EVERY. This form uses five subfields to specify two values and the relationship which must exist between them in order for the macro to be effective.

This second form is:

COMP1, R, COMP2, IT1, IT2 The variable subfields are interpreted:

06.04.01 3 (1/61)

COMP1 and COMP2

R

IT1 and IT2

These fields designate the items to be compared. The description which follows for COMP1 applies equally to COMP2.

1. If COMP1 is zero or is omitted, or is a symbol whose value is zero, and IT1 is omitted, the designated value is +0.

2. If COMP1 is any number from 1 to 7, or a symbol with such a value, and IT1 is omitted, then the designated value is obtained from the index register(s) specified. "or'" of index registers is possible. The contents of the index register is treated, for purposes of comparison, as a positive 36-bit fixed-point number less than 215.

3. If neither of the two conditions above are met, then COMP1 denotes the location in memory from which the value is to be obtained, and this sub field is subj ect to conventional address modification by the subfield IT1.

This field states the relationship which must exist between the values specified by COMP1 and COMP2 in order for the condition to be satisfied.

This subfield is coded:

L - less than E - equal to G - greater than LL - logically less than LE - logically equal to LG - logically greater than

These subfields apply to COMP1 and COMP2, respectively. I may be coded before or after T, and either, or both, may be omitted.

T1 is coded as a number from 1 to 7 and denotes the index register modifying the address shown in COMP1, and I, coded simply as I, causes indirect addressing.

In the examples below, C signifies "the contents of" and IC "the indirect contents of." Thus, IC(X,2) is that number obtained in the accumulator by the execution of the instruction CLA* X,2 (or CAL* X,2 for a logical comparison).

06.04.02 3 (1/61)

1. 4,E,

The condition is: C(ffi4) equal to zero.

2. 2, L, 2, I

The condition is: 1C(2) less than C(ffi2)

3. A, LO, B, 2,41

The condition is: C(A,2) logically greater than 1C(B, 4)

4. 1000, E, X, ,4

The condition is:

06.04.03 3 (1/61)

C(1750S) equal to C(X, 4)

WHEN

A WHEN specifies a condition which must be satisfied to allow execution of sub-sequent macros. Thus, WHEN (Cl) may be read as "proceed to execute the next macro when the condition (Cl) is satisfied but not otherwise. I I In other words, if the condition is satisfied, the WHEN is effective and the next macro in

sequence is executed; otherwise all subsequent macros in the set are bypassed.

WHEN n where n is a decimal number

The condition is satisfied, and the WHEN is effective (in the absence of qualifying ANDs and ORs), on the nth execution of the WHEN and on every execution thereafter.

WHEN COMPl, R, COMP2, IT!, IT2

If the condition is satisfied, as described on page 06. 04. 02, then (in the absence of qualifying ANDs and ORs) the WHEN is effective.

06.04.04 3 (1/61)

UNLESS

An UNLESS specifies a condition which must be Wlsatisfied to allow execution of subsequent macros. Thus, UNLESS (Cl) may be read as "proceed to execute the next macro Wlless condition (Cl) is satisfied. "

In other words, if the condition is satisfied, the UNLESS is effective and all subsequent macros in the set are bypassed; otherwise, the next macro in sequence is executed.

UNLESS n where n is a decimal number

The COWlt for the UNLESS is increased by one each time ONE of the set of information macros following it is executed. When the count reaches n, the set of information macros then being executed is completed, and the UNLESS becomes effective.

UNLESS COMPl, R, COMP2, ITl, IT2

If the condition is satisfied, then (in the absence of qualifying ANDs and ORs) the UNLESS is effective.

06.04.05 5 (6/61)

AND

An AND specifies a condition, in addition to all previous conditions for the governing WHEN or UNLESS, which must be satisfied before the governing macro becomes effective.

AND n where n is a decimal number

The condition is tested according to the rule for the governing macro (WHEN, UNLESS). Thus, for instance, the condition specified by an AND n following a WHEN is satisfied on the nth execution of the WHEN and on all subsequent executions.

AND COMP1, R, COMP2, ITl, IT2

The condition is tested as described on page 06. 04. 02.

If the condition specified by an AND is satisfied and, in addition, the governing macro is effective in the absence of the AND, then the governing macro remains effective. In all other cases, the governing macro is ineffective.

06.04.06 5 (6/61)

OR

An OR specifies a condition which is alternative to all conditions previously specified for the governing WHEN or UNLESS. The satisfaction of the OR makes the governing macro effective, whatever its previous status.

OR n where n is a decimal number

The condition is tested according to the rule for the governing macro.

OR COMP1, R, COMP2, IT1, IT2

The condition is tested as described on page 06. 04. 02.

If the condition specified by an OR is not satisfied, and, in addition, the governing macro is ineffective in the absence of OR, then the governing macro remains ineffective. In all other cases the governing macro is effective.

06.04.07 3 (1/61)

EVERY

The variable field of EVERY has only one form. The macro provides a means of preventing output, or modal control, except at predetermined intervals.

EVERY n where n is a decimal number

The condition is satisfied, the EVE·RY is effective, and the next macro in sequence is executed, only on the first execution of the EVERY and on every nth execution thereafter; that is, on the 1st, (n+1)th, (2n+1)th, etc.

On all other executions, all subsequent macros in the set are bypassed.

06.04.08 3 (1/61)

COMBINATIONS OF CONDITIONAL MACROS

1. An UNLESS may precede or follow a WHEN (in fact, pairs of these macros may be interchanged without affecting output), but no conditional macro may follow an EVERY.

2. The counter for a macro is incremented on every execution of that macro (except as noted for the case of an UNLESS macro), and not necessarily on every entry to the set of macros.

3. Any number of ANDs and ORs may follow WHEN or UNLESS. Every time the governing WHEN or UNLESS is executed all the conditions thus specified are tested, in sequence, and the "effective" status of the governing macro is modified continually in accordance with the results of the tests. For example, consider the sequence:

It will be seen that the limitations of the language prevent the representation of certain combinations of conditions; for instance (Cl AND C2) OR (C3 AND C4).

Examples of combinations of conditional macros.

1.

3.

The contents of location A are always printed. On the first five times condition (C1) is satisfied, format (F2) is used; on all other occasions (C3) and either condition (Cl) or condition (C2) are satisfied.

UNLESS

The PANEL is executed every time, after the third, that neither condition (C3) nor both conditions (Cl) and (C2) are satisfied.

The CORE macros are executed on the first, second, and third entries to the sequence.

06.04.10 5 (6/61)

Im Dokument SHARE System for the IBM 709 (Seite 133-143)