22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How to Write Macro Instructions<br />

Chapter 8. How to Write Macro Instructions<br />

This chapter describes macro instructions; where you can use them and how you<br />

specify them.<br />

The first section on page 297 describes the macro instruction format, including<br />

details on the name, operation, and operand entries, and what is generated as a<br />

result of a macro instruction.<br />

“Sublists in Operands” on page 304 describes how you can use sublists to specify<br />

several values in an operand entry.<br />

“Values in Operands” on page 307 describes the values you can specify in an<br />

operand entry when you call a macro definition.<br />

“Nesting Macro Instruction Definitions” on page 311 describes how you can use<br />

nested macro call instructions to call macros from within a macro.<br />

What is a Macro Instruction: The macro instruction provides the assembler with:<br />

The name of the macro definition to process<br />

The information or values to pass to the macro definition<br />

This information is the input to a macro definition. The assembler uses the<br />

information either in processing the macro definition, or for substituting values into<br />

model statements in the definition.<br />

The output from a macro definition can be:<br />

A sequence of statements generated from the model statements of the macro<br />

for further processing at assembly time.<br />

Values assigned to global-scope SET symbols. These values can be used in<br />

other macro definitions and in open code (see “SET Symbols” on page 319).<br />

Where Macro Instructions Can Appear: A macro instruction can be written<br />

anywhere in your program, provided the assembler can find the macro definition.<br />

The macro definition can be found either in a macro library, or in the source<br />

program before the macro instruction, or be provided by a LIBRARY user exit.<br />

However, the statements generated from the called macro definition must be valid<br />

assembler language instructions and allowed where the calling macro instruction<br />

appears.<br />

Macro Instruction Format<br />

►►──┬─────────────────┬──operation_code──┬─────────────┬───────────►◄<br />

├─name_field──────┤<br />

│ ┌─,───────┐<br />

│<br />

└─sequence_symbol─┘<br />

└── ▼ ─operand─┴─┘<br />

name_field<br />

is a special positional operand that can be used to pass a value into the called<br />

macro definition. For a detailed description of what form name_entry can take,<br />

see “Name Entry” on page 299.<br />

© Copyright IBM Corp. 1982, 2004 297

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

Saved successfully!

Ooh no, something went wrong!