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

Macro Instruction Format sequence_symbol is a sequence symbol. If a sequence symbol is coded in the name entry of a macro instruction, the value of the symbol is not passed to the called macro definition and therefore cannot be used as a value for substitution in the macro definition. operation_code is the symbolic operation code which identifies the macro definition that you want the assembler to process. For more information, see “Operation Entry” on page 299. operand The positional operands or keyword operands that you use to pass values into the called macro definition. For more information, see “Operand Entry” on page 300. If no operands 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 entries in the name, operation, and operand fields correspond to entries in the prototype statement of the called macro definition (see “Macro Instruction Prototype” on page 245). Alternative Formats for a Macro Instruction A macro instruction can be specified in one of the three following ways: The normal way, with the operands preceding any remarks The alternative way, allowing remarks for each operand A combination of the first two ways The following example 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 Notes: 1. Any number of continuation lines are allowed. However, each continuation line must be indicated by a non-space character in the column after the end column of the previous statement line (see “Continuation Lines” on page 15). 2. 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 operand contains double-byte data. 298 HLASM V1R5 Language Reference

Macro Instruction Format 3. Operands on continuation lines must begin in the continue column (column 16), or the assembler assumes that the current line and any lines that follow contain remarks. If any entries are made in the columns before the continue column in continuation lines, the assembler issues an error message and the whole statement is not processed. 4. One or more spaces must separate the operand from the remarks. 5. A comma after an operand indicates more operands follow. 6. The last operand requires no comma following it, but using a comma does not cause an error. 7. You do not need to use the same format when you code a macro instruction as you use when you code the corresponding macro prototype statement. 8. Continued comments for a macro with an operand list that terminates in a null operand will be recognized provided each continued comment begins in the same or later column as the preceding line's comment. Name Entry Use the name entry of a macro instruction to: Pass a value into a macro definition through the name entry declared in the macro definition Provide a conditional assembly label (see “Sequence Symbols” on page 339) so that you can branch to the macro instruction during conditional assembly if you want the called macro definition expanded. The name entry of a macro instruction can be: Space An ordinary symbol, such as HERE A variable symbol, such as &A. Any combination of variable symbols and other character strings concatenated together, such as HERE.&A Any character string allowed in a macro instruction operand, such as 'Now is the hour' or STRING, excluding sublist entries and certain attribute references (see “Values in Operands” on page 307) A sequence symbol, which is not passed to the macro definition, such as .SEQ Operation Entry The operation entry is the symbolic name of the operation code that identifies a macro definition to process. The operation entry must be a valid symbol, and must be identical to the operation field in the prototype statement of the macro definition. The assembler searches for source macro definitions before library macro definitions. If you have a source macro definition that has the same name as a library macro definition, the assembler only processes the source macro definition. Chapter 8. How to Write Macro Instructions 299

Macro Instruction Format<br />

3. Operands on continuation lines must begin in the continue column (column 16),<br />

or the assembler assumes that the current line and any lines that follow contain<br />

remarks.<br />

If any entries are made in the columns before the continue column in<br />

continuation lines, the assembler issues an error message and the whole<br />

statement is not processed.<br />

4. One or more spaces must separate the operand from the remarks.<br />

5. A comma after an operand indicates more operands follow.<br />

6. The last operand requires no comma following it, but using a comma does not<br />

cause an error.<br />

7. You do not need to use the same format when you code a macro instruction as<br />

you use when you code the corresponding macro prototype statement.<br />

8. Continued comments for a macro with an operand list that terminates in a null<br />

operand will be recognized provided each continued comment begins in the<br />

same or later column as the preceding line's comment.<br />

Name Entry<br />

Use the name entry of a macro instruction to:<br />

Pass a value into a macro definition through the name entry declared in the<br />

macro definition<br />

Provide a conditional assembly label (see “Sequence Symbols” on page 339)<br />

so that you can branch to the macro instruction during conditional assembly if<br />

you want the called macro definition expanded.<br />

The name entry of a macro instruction can be:<br />

Space<br />

An ordinary symbol, such as HERE<br />

A variable symbol, such as &A.<br />

Any combination of variable symbols and other character strings concatenated<br />

together, such as HERE.&A<br />

Any character string allowed in a macro instruction operand, such as 'Now is<br />

the hour' or STRING, excluding sublist entries and certain attribute references<br />

(see “Values in Operands” on page 307)<br />

A sequence symbol, which is not passed to the macro definition, such as .SEQ<br />

Operation Entry<br />

The operation entry is the symbolic name of the operation code that identifies a<br />

macro definition to process.<br />

The operation entry must be a valid symbol, and must be identical to the operation<br />

field in the prototype statement of the macro definition.<br />

The assembler searches for source macro definitions before library macro<br />

definitions. If you have a source macro definition that has the same name as a<br />

library macro definition, the assembler only processes the source macro definition.<br />

Chapter 8. How to Write Macro Instructions 299

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

Saved successfully!

Ooh no, something went wrong!