HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

Prototype Statement Macros that are defined inline may use any ordinary symbol, up to 63 characters in length, for the operation field. However, operating system rules may prevent some of these macros from being stored as member names. The assembler requires that the library member name and macro name be the same; otherwise error diagnostic message ASMA126S Library macro name incorrect is issued. symbolic_parameter The symbolic parameters are used in the macro definition to represent the operands of the corresponding macro instruction. A description of symbolic parameters appears under “Symbolic Parameters” on page 253. The operand field in a prototype statement lets you specify positional or keyword parameters. These parameters represent the values you can pass from the calling macro instruction to the statements within the body of a macro definition. The operand field of the macro prototype statement must contain 0 to 32000 symbolic parameters separated by commas. They can be positional parameters or keyword parameters, or both. If no parameters are specified in the operand field and if the absence of the operand entry is indicated by a comma preceded and followed by one or more spaces, remarks are allowed. The following is an example of a prototype statement: &NAME MOVE &TO,&FROM Alternative Formats for the Prototype Statement The prototype statement can be specified in one of the following three ways: The normal way, with all the symbolic parameters preceding any remarks An alternative way, allowing remarks for each parameter A combination of the first two ways The continuation rules for macro instructions are different from those for machine or assembler instruction statements. This difference is important for those who write macros that override a machine/assembler mnemonic. The following examples show the normal statement format (&NAME1), the alternative statement format (&NAME2), and a combination of both statement formats (&NAME3): Opera- Name tion Operand Comment Cont. &NAME1 OP1 &OPERAND1,&OPERAND2,&OPERAND3 This is the normal X statement format &NAME2 OP2 &OPERAND1, This is the alter- X &OPERAND2 native statement format &NAME3 OP3 &OPERAND1, This is a combination X &OPERAND2,&OPERAND3, of both X &OPERAND4 246 HLASM V1R5 Language Reference

Body of a Macro Definition Notes: 1. Any number of continuation lines is allowed. However, each continuation line must be indicated by a non-space character in the column after the end column on the preceding line. 2. For each continuation line, the operand field entries (symbolic parameters) must begin in the continue column; otherwise, the whole line and any lines that follow are considered to contain remarks. No error diagnostic message is issued to indicate that operands are treated as remarks in this situation. However, the FLAG(CONT) assembler option can be specified so that the assembler issues warning messages if it suspects an error in a continuation line. 3. The standard value for the continue column is 16 and the standard value for the end column is 71. 4. A comma is required after each parameter except the last. If you code excess commas between parameters, they are considered null positional parameters. No error diagnostic message is issued. 5. One or more spaces is required between the operand and the remarks. 6. If the DBCS assembler option is specified, the continuation features outlined in “Continuation of double-byte data” on page 16 apply to continuation in the macro language. Extended continuation may be useful if a macro keyword parameter contains double-byte data. Body of a Macro Definition The body of a macro definition contains the sequence of statements that constitutes the working part of a macro. You can specify: Model statements to be generated Processing statements that, for example, can alter the content and sequence of the statements generated or issue error messages Comment statements, some that are generated and others that are not Conditional assembly instructions to compute results to be displayed in the message created by the MNOTE instruction, without causing any assembler language statements to be generated The statements in the body of a macro definition must appear between the macro prototype statement and the MEND statement of the definition. The body of a macro definition can be empty, that is, contain no statements. Nesting Macros: You can include macro definitions in the body of a macro definition. Model Statements Model statements are statements from which assembler language statements are generated during conditional assembly. They let you determine the form of the statements to be generated. By specifying variable symbols as points of substitution in a model statement, you can vary the contents of the statements Chapter 7. How to Specify Macro Definitions 247

Body of a Macro Definition<br />

Notes:<br />

1. Any number of continuation lines is allowed. However, each continuation line<br />

must be indicated by a non-space character in the column after the end column<br />

on the preceding line.<br />

2. For each continuation line, the operand field entries (symbolic parameters) must<br />

begin in the continue column; otherwise, the whole line and any lines that<br />

follow are considered to contain remarks.<br />

No error diagnostic message is issued to indicate that operands are<br />

treated as remarks in this situation. However, the FLAG(CONT) assembler<br />

option can be specified so that the assembler issues warning messages if<br />

it suspects an error in a continuation line.<br />

3. The standard value for the continue column is 16 and the standard value for<br />

the end column is 71.<br />

4. A comma is required after each parameter except the last. If you code excess<br />

commas between parameters, they are considered null positional parameters.<br />

No error diagnostic message is issued.<br />

5. One or more spaces is required between the operand and the remarks.<br />

6. If the DBCS assembler option is specified, the continuation features outlined in<br />

“Continuation of double-byte data” on page 16 apply to continuation in the<br />

macro language. Extended continuation may be useful if a macro keyword<br />

parameter contains double-byte data.<br />

Body of a Macro Definition<br />

The body of a macro definition contains the sequence of statements that constitutes<br />

the working part of a macro. You can specify:<br />

Model statements to be generated<br />

Processing statements that, for example, can alter the content and sequence of<br />

the statements generated or issue error messages<br />

Comment statements, some that are generated and others that are not<br />

Conditional assembly instructions to compute results to be displayed in the<br />

message created by the MNOTE instruction, without causing any assembler<br />

language statements to be generated<br />

The statements in the body of a macro definition must appear between the macro<br />

prototype statement and the MEND statement of the definition. The body of a<br />

macro definition can be empty, that is, contain no statements.<br />

Nesting Macros: You can include macro definitions in the body of a macro<br />

definition.<br />

Model Statements<br />

Model statements are statements from which assembler language statements are<br />

generated during conditional assembly. They let you determine the form of the<br />

statements to be generated. By specifying variable symbols as points of<br />

substitution in a model statement, you can vary the contents of the statements<br />

Chapter 7. How to Specify Macro Definitions 247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!