22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Macro Instruction Format<br />

Source Module<br />

┌────────────────────────────────────────────────┐<br />

Macro │ MACRO │<br />

Definition<br />

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

│ POSPAR &POS1,&POS2,&POS3 │<br />

│ . ▲ ▲ ▲ │<br />

│ . │ │ │ │<br />

│ MEND │ │ │ │<br />

├──────────────────────────┼─────┼─────┼─────────┤<br />

│ . │ │ │ │<br />

│ . ▌1▐ ▌1▐ ▌1▐ │<br />

│ START │ │ │ │<br />

│ . │ ┌──┘ ┌───┘ │<br />

│ . │ │ │ │<br />

Macro │ POSPAR ONE,TWO,THREE ▌2▐ │<br />

Instruction │ . │<br />

│ . │<br />

│ END │<br />

└────────────────────────────────────────────────┘<br />

Figure 77. Positional Operands<br />

Notes:<br />

1. An omitted operand has a null character value.<br />

| 2. Each positional operand can be up to 1024 characters long.<br />

3. If the DBCS assembler option is specified, the positional operand can be a<br />

string containing double-byte data. The string need not be quoted.<br />

The following are examples of macro instructions with positional operands:<br />

MACCALL VALUE,9,8<br />

MACCALL &A,'QUOTED STRING'<br />

MACCALL EXPR+2,,SYMBOL<br />

MACCALL (A,B,C,D,E),(1,2,3,4)<br />

MACCALL &A,''<br />

The following list shows what happens when the number of positional operands in<br />

the macro instruction is equal to or differs from the number of positional parameters<br />

declared in the prototype statement of the called macro definition:<br />

Equal<br />

Greater than<br />

Less than<br />

Valid, if operands are correctly specified.<br />

Meaningless, unless &SYSLIST is specified in definition to refer to<br />

excess operands.<br />

Omitted operands give null character values to corresponding<br />

parameters (or &SYSLIST specification).<br />

Keyword Operands<br />

You can use a keyword operand to pass a value through a keyword parameter into<br />

a macro definition. The values you specify in keyword operands override the<br />

default values assigned to the keyword parameters. The default value should be a<br />

value you use frequently. Thus, you avoid having to write this value every time you<br />

code the calling macro instruction.<br />

Chapter 8. How to Write Macro Instructions 301

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

Saved successfully!

Ooh no, something went wrong!