• Aucun résultat trouvé

ADDITIONAL FEATURES

Dans le document IBM System/360 (Page 92-95)

The additional features of the assembler language allow the programmer to:

1. Terminate processing of a macro-definition.

2. Generate error messages.

3. Define global SET symbols.

4. Define subscripted SET symbols.

5. Use system variable symbols.

6. Prepare keyword and mixed-mode macro-definitions and write keyword and mixed-mode macro-instructions.

MEXIT -- MACRO-DEFINITION EXIT

The MEXIT instruction is used to indicate to the assembler that i t should terminate processing of a macro-definition. The typical form of this instruction is:

r---T---~---,

I Name IOperation I Operand I

~---+---+---~

IA sequence IMEXIT INot used, I I symbol or I I must not be· I

I not used I I present I

L ____________ ~ ___________ i -_______________ J

The MEXIT instruction may only be used in a macro-definition.

If the assembler processes an MEXIT instruction that is in a macro-definition corresponding to an outer

macro-instruction, the next statement processed by the assembler is the next statement outside macro-definitions.

If the assembler processes an MEXIT instruction that is in a macro-definition corresponding to a second or third level macrO-instruction, the next statement proc-essed by the assembler is the next state-ment after the second or third level macro-instruction in the macro-definition,

respectively.

MEXIT should not be confused with MEND.

MEND indicates the end of a macro-definition. MEND must be the last statement of every macro-definition, including those that contain one or more MEXIT instructions.

The following example illustrates the use of the MEXIT instruction.

I~

r---T---j---,

IName I Operation I Operand I

~---+---+---~

I I MACRO I I

I&NAME I MOVE I&T,&F I 1 I IAIF I (T'&T EQ 'F').OK I

2 I IMEXIT I I

3 I.OK IANOP I I

I&NAME 1ST 12,SAVEAREA I

I IL 12,&F I

l iST 12,&T I

I IL 12,SAVEAREA I

I I MEND I I

L _______ i -__________ ~ ___________________ J

Statement 1 is used to determine if the type attribute of the first

macro-instruction operand is the letter F. If the type attribute is the letter F, the assembler processes the remainder of the macro-definition starting with statement 3.

If the type attribute is not the letter F, the next statement processed by the

assembler is statement 2. Statement 2 indicates to the assembler that i t is to

",-_,J'

terminate processing of the macro- ~

definition. ~ ,

MNOTE STATEMENT

The MNOTE instruction may be used to generate a message and to indicate what error severity code, if any, is to be associated with the message. The severity code is for the programmer's information only and is not used by the DOS assembler or control pro-gram. The typical form of this instruction is:

r---~---T---,

I Name IOperationlOperand I

r---+---+---~

IA sequencelMNOTE I See examples below. I

Isymbol or I I I

Inotused L-________ ~ I ________ ~ I ____________________ J I The operand entry of the MNOTE

assembler-instruction may be written in one of the follOwing forms:

1. severity-code, 'message' 2. ,. message'

3. 'message'

For 2 and 3 above, the severity code is assumed to be one.

" ' ....

_

.. /

.J operation code, the severity code indicator, and the message.

The resulting severity code indicator may be a decimal integer 0 to 255, blank, with substitution using variable symbols.

The MNOTE statement appears in the single apostrophe. Any variable symbols used in the message operand are replaced by values assigned to them. Two ampersands must be used to represent a single amper-sand that is not part of a variable symbol.

The following example illustrates the use of the MNOTE instruction.

L _____ ~ ________________________________ _

Statement 1 is used to determine i f the type attributes of both macro instruction operands are the same. If they are,

1. Symbolic parameters.

2. Local SET symbols.

Global SET symbols may communicate values between statements in one or more macro definitions and statements outside macro definitions. However, local SET symbols communicate values between state-ments in the same macro definition, or between statements outside macro defini-tions.

If a local SET symbol is defined in two or more macro definitions, or in a macro definition and outside macro definitions, the SET symbol is considered to be a global SET symbol outside macro defini-tions, i f i t is to be used as a global SET symbol outside macro definitions.

If the same SET symbol is defined as a global SET symbol in one or more places, and as a local SET symbol elsewhere, i t is considered the same symbol wherever i t is

defined as a global SET symbol, and a LCLB, or LCLC instruction. These instruc-tions are discussed in S'e"ction 9 under D"efi"n"inq SET SymhoTs.

Global SET symbols are defined when immediately follow the prototype statement, or another GBLA, GBLB, or GBLC instruction.

GBLA, GBLB, and GBLC instructions outside macro definitions must appear after all macro definitions in the source program, before all conditional assembly instruc~

tions and PUNCH and REPRO statements instructions outside macro definitions must appear before all LCLA, LCLB, and LCLC instructions outside macro definitions.

Using Global and Local SET Symbols

The following examples illustrate the use of global and local SET symbols. Each values between statements outside macro definitions.

L _______ ! ____________ L ________________ ~

&A is defined as a local SETA symbol in a macro definition (statement 1) and out-side macro definitions (statement 4).

&A is used twice within macro definition (statements 2 and 3) and twice outside macro definitions (statements 5 and 6).

Since &A is a local SETA symbol in the macro definition and outside macro defi-nitions, i t is one SETA symbol in the macro definition, and another SETA symbol outside macro definitions. Therefore, statement 3

(which is in t"he macro definition) does a macro definition and statements outside macro definitions.

I,

r---T---T---,

out-side macro-definitions (statement 4). &A is used twice within the macrO-definition

(statements 2 and 3) and twice outside macro-definitions (statements 5 and 6).

Since &A is a global SETA symbol in the definition and outside

macro-definitions, i t is the same SETA symbol in both cases. Therefore, statement 3 (which is in the macro-definition) affects the value used for &A in statements 5 and 6 (which are outside macro-definitions).

Example 3: This example illustrates how the same SET symbol can be used to

communicate: (1) values between statements in one macro-definition, and (2) different values between statements in a.different macro-definition.

&A is defined as a local SETA symbol in two different macro-definitions (statements 1 and 4). &A is used twice within each macro-definition (statements 2,3,5 and 6).

Since &A is a local SETA symbol in each macro-definition, i t is one SETA symbol in one macro-definition, and another SETA symbol in the other macro-definition.

Therefore, statement 3 (which is in one macro-definition) does not affect the value used for &A in statement 5 (which is in the other macro-definition). Similarly, state-ment 6 does not affect the value used for

L _______ .L-_________ ~ __________________ J

Example 4: This example illustrates how a SET symbol can be used to communicate values between statements that are part of two different macro-definitions.

r---~---,.---,

Dans le document IBM System/360 (Page 92-95)