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

Introduction to Macro Language The three types of variable symbols in the assembler language are: Symbolic parameters, declared in the prototype statement System variable symbols SET symbols, which are part of the conditional assembly language The assembler processes the generated statements, with or without value substitution, at assembly time. Processing Statements Processing statements are processed during conditional assembly, when macros are expanded, but they are not themselves generated for further processing at assembly time. The processing statements are: AEJECT instructions AREAD instructions ASPACE instructions Conditional assembly instructions Inner macro calls MEXIT instructions MNOTE instructions The AEJECT and ASPACE instructions let you control the listing of your macro definition. Use the AEJECT instruction to stop printing the listing on the current page and continue printing on the next. Use the ASPACE instruction to insert blank lines in the listing. The AEJECT instruction is described on page 257. The ASPACE instruction is described on page 259. The AREAD instruction assigns a character string value, of a statement that is placed immediately after a macro instruction, to a SETC symbol. The AREAD instruction is described on page 257. Conditional assembly instructions, inner macro calls, and macro processing instructions are described in detail in the following chapters. The MNOTE instruction generates an error message with an error condition code attached, or generates comments in which you can display the results of a conditional assembly computation. The MNOTE instruction is described on page 196. The MEND statement delimits the contents of a macro definition, and also provides an exit from the definition. The MEND instruction is described on page 245. The MEXIT instruction tells the assembler to stop processing a macro definition, and provides an exit from the macro definition at a point before the MEND statement. The MEXIT instruction is described on page 260. Comment Statements One type of comment statement describes conditional assembly operations and is not generated. The other type describes assembly-time operations and is, therefore, generated. For a description of the two types of comment statements, see “Comment Statements” on page 261. 240 HLASM V1R5 Language Reference

Introduction to Macro Language Macro Instruction A macro instruction is a source program statement that you code to tell the assembler to process a particular macro definition. The assembler generates a sequence of assembler language statements for each occurrence of the same macro instruction. The generated statements are then processed as any other assembler language statement. The macro instruction provides the assembler with: The name of the macro definition to be processed. The information or values to be passed to the macro definition. The assembler uses the information either in processing the macro definition or for substituting values into a model statement in the definition. The output from a macro definition, called by a macro instruction, can be: A sequence of statements generated from the model statements of the macro for further processing at assembly time. Values assigned to global SET symbols. These values can be used in other macro definitions and in open code. You can call a macro definition by specifying a macro instruction anywhere in a source module. You can also call a macro definition from within another macro definition. This type of call is an inner macro call; it is said to be nested in the macro definition. Source and Library Macro Definitions You can include a macro definition in a source module. This type of definition is called a source macro definition, or, sometimes, an in-line macro definition. You can also insert a macro definition into a system or user library by using the applicable utility program. This type of definition is called a library macro definition. The IBM-supplied macro definitions are examples of library macro definitions. You can call a source macro definition only from the source module in which it is included. You can call a library macro definition from any source module if the library containing the macro definition is available to the assembler. Syntax errors in processing statements are handled differently for source macro definitions and library macro definitions. In source macro definitions, error messages are listed following the statements in error. In library macros, however, error messages cannot be associated with the statement in error, because the statements in library macro definitions are not included in the assembly listing. Therefore, the error messages are listed directly following the first call of that macro. Because of the difficulty of finding syntax errors in library macros, a macro definition should be run and “debugged” as a source macro before it is placed in a macro library. Alternatively, you can use the LIBMAC assembler option to have the assembler automatically include the source statements of the library macro in your source module. For more information about the LIBMAC option, see the HLASM Programmer's Guide. Chapter 6. Introduction to Macro Language 241

Introduction to Macro <strong>Language</strong><br />

The three types of variable symbols in the assembler language are:<br />

Symbolic parameters, declared in the prototype statement<br />

System variable symbols<br />

SET symbols, which are part of the conditional assembly language<br />

The assembler processes the generated statements, with or without value<br />

substitution, at assembly time.<br />

Processing Statements<br />

Processing statements are processed during conditional assembly, when macros<br />

are expanded, but they are not themselves generated for further processing at<br />

assembly time. The processing statements are:<br />

AEJECT instructions<br />

AREAD instructions<br />

ASPACE instructions<br />

Conditional assembly instructions<br />

Inner macro calls<br />

MEXIT instructions<br />

MNOTE instructions<br />

The AEJECT and ASPACE instructions let you control the listing of your macro<br />

definition. Use the AEJECT instruction to stop printing the listing on the current<br />

page and continue printing on the next. Use the ASPACE instruction to insert<br />

blank lines in the listing. The AEJECT instruction is described on page 257. The<br />

ASPACE instruction is described on page 259.<br />

The AREAD instruction assigns a character string value, of a statement that is<br />

placed immediately after a macro instruction, to a SETC symbol. The AREAD<br />

instruction is described on page 257.<br />

Conditional assembly instructions, inner macro calls, and macro processing<br />

instructions are described in detail in the following chapters.<br />

The MNOTE instruction generates an error message with an error condition code<br />

attached, or generates comments in which you can display the results of a<br />

conditional assembly computation. The MNOTE instruction is described on page<br />

196.<br />

The MEND statement delimits the contents of a macro definition, and also provides<br />

an exit from the definition. The MEND instruction is described on page 245.<br />

The MEXIT instruction tells the assembler to stop processing a macro definition,<br />

and provides an exit from the macro definition at a point before the MEND<br />

statement. The MEXIT instruction is described on page 260.<br />

Comment Statements<br />

One type of comment statement describes conditional assembly operations and is<br />

not generated. The other type describes assembly-time operations and is,<br />

therefore, generated. For a description of the two types of comment statements,<br />

see “Comment Statements” on page 261.<br />

240 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!