HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Values in Operands Parentheses In macro instruction operand values, there must be an equal number of left and right parentheses. They must be paired, that is, each left parenthesis needs a following right parenthesis at the same level of nesting. An unpaired (single) left or right parenthesis can appear only in a quoted string. Examples: (PAIRED-PARENTHESES) () (A(B)C)D(E) (IN'('STRING) Spaces One or more spaces outside a quoted string indicates the end of the operands of a macro instruction. Thus spaces should only be used inside quoted strings. Example: 'SPACES ALLOWED' Commas A comma outside a quoted string indicates the end of an operand value or sublist entry. Commas that do not delimit values can appear inside quoted strings or paired parentheses that do not enclose sublists. Examples: A,B,C,D (1,2)3'5,6' Equal Signs An equal sign can appear in the value of a macro instruction operand or sublist entry: As the first character Inside quoted strings Between paired parentheses In a keyword operand In a positional operand, provided the parameter does not resemble a keyword operand Examples: =H'21' A'='B C(A=B) 2X=B KEY=A=B The assembler issues a warning message for a positional operand containing an equal sign, if the operand resembles a keyword operand. Thus, if we assume that the following is the prototype of a macro definition: MAC1 &F the following macro instruction generates a warning message: MAC1 K=L (K appears to be a valid keyword) 310 HLASM V1R5 Language Reference
Nesting Macro Instruction Definitions while the following macro instruction does not: MAC1 2+2=4 (2+2 is not a valid keyword) Periods A period (.) can be used in the value of an operand or sublist entry. It is passed as a period. However, if it is used immediately after a variable symbol, it becomes a concatenation character. Two periods are required if one is to be passed as a character. Examples: 3.4 &A.1 &A..1 Nesting Macro Instruction Definitions A nested macro instruction definition is a macro instruction definition you can specify as a set of model statements in the body of an enclosing macro definition. This lets you create a macro definition by expanding the outer macro that contains the nested definition. Note that all nested inner macro definitions are effectively “black boxes”: there is no visibility to the outermost macro definition of any variable symbol or sequence symbol within any of the nested macro definitions. This means that you cannot use an enclosing macro definition to tailor or parameterize the contents of a nested inner macro definition. This lack of parameterization can be overcome in some cases by using the AINSERT statement. This lets you generate a macro definition from within another macro generation. A simple example is shown at “Where to Define a Macro in a Source Module” on page 243. In Figure 83 on page 312, macro ainsert_test_macro generates the macro mac1 using a combination of AINSERT and AREAD instructions. The mac1 macro is then called with a list of seven parameters. Chapter 8. How to Write Macro Instructions 311
- Page 280 and 281: COPY Instruction sequence_symbol is
- Page 282 and 283: System Variable Symbols System Vari
- Page 284 and 285: &SYSADATA_MEMBER System Variable Sy
- Page 286 and 287: &SYSCLOCK System Variable Symbol &S
- Page 288 and 289: &SYSECT System Variable Symbol depe
- Page 290 and 291: &SYSIN_MEMBER System Variable Symbo
- Page 292 and 293: &SYSJOB System Variable Symbol &SYS
- Page 294 and 295: &SYSLIN_DSN System Variable Symbol
- Page 296 and 297: &SYSLIST System Variable Symbol The
- Page 298 and 299: &SYSLOC System Variable Symbol To
- Page 300 and 301: &SYSM_SEV System Variable Symbol &S
- Page 302 and 303: &SYSNDX System Variable Symbol The
- Page 304 and 305: &SYSOPT_DBCS System Variable Symbol
- Page 306 and 307: &SYSPARM System Variable Symbol Not
- Page 308 and 309: &SYSPRINT_MEMBER System Variable Sy
- Page 310 and 311: &SYSPUNCH_MEMBER System Variable Sy
- Page 312 and 313: &SYSSTEP System Variable Symbol Not
- Page 314 and 315: &SYSTERM_DSN System Variable Symbol
- Page 316 and 317: &SYSTIME System Variable Symbol Not
- Page 318 and 319: Macro Instruction Format sequence_s
- Page 320 and 321: Macro Instruction Format Operand En
- Page 322 and 323: Macro Instruction Format When you n
- Page 324 and 325: Sublists in Operands the order in w
- Page 326 and 327: Sublists in Operands &SYSLIST( n,m)
- Page 328 and 329: Values in Operands Notes: 1. Spaces
- Page 332 and 333: Inner and Outer Macro Instructions
- Page 334 and 335: Levels of Macro Call Nesting When t
- Page 336 and 337: Levels of Macro Call Nesting System
- Page 338 and 339: How to Write Conditional Assembly I
- Page 340 and 341: SET Symbols SET Symbol Specificatio
- Page 342 and 343: SET Symbols Figure 86 (Page 3 of 3)
- Page 344 and 345: Data Attributes this example indica
- Page 346 and 347: Data Attributes variable_symbol is
- Page 348 and 349: Data Attributes The value of an att
- Page 350 and 351: Data Attributes The following attri
- Page 352 and 353: Data Attributes Assembler gives a t
- Page 354 and 355: Data Attributes The scale attribute
- Page 356 and 357: Data Attributes Number Attribute (N
- Page 358 and 359: Data Attributes The operation code
- Page 360 and 361: Lookahead MACRO &NAME MOVE &TO,&FRO
- Page 362 and 363: Open Code Sequence Symbols The cond
- Page 364 and 365: GBLA, GBLB, and GBLC Instructions G
- Page 366 and 367: LCLA, LCLB, and LCLC Instructions s
- Page 368 and 369: SETA Instruction expression is an a
- Page 370 and 371: SETA Instruction | The logical-exp
- Page 372 and 373: SETA Instruction | Figure 99 (Page
- Page 374 and 375: SETA Instruction | The result of C2
- Page 376 and 377: SETA Instruction NOT Format: Logica
- Page 378 and 379: SETA Instruction | X2A Name Operati
Nesting Macro Instruction Definitions<br />
while the following macro instruction does not:<br />
MAC1 2+2=4 (2+2 is not a valid keyword)<br />
Periods<br />
A period (.) can be used in the value of an operand or sublist entry. It is passed as<br />
a period. However, if it is used immediately after a variable symbol, it becomes a<br />
concatenation character. Two periods are required if one is to be passed as a<br />
character.<br />
Examples:<br />
3.4<br />
&A.1<br />
&A..1<br />
Nesting Macro Instruction Definitions<br />
A nested macro instruction definition is a macro instruction definition you can<br />
specify as a set of model statements in the body of an enclosing macro definition.<br />
This lets you create a macro definition by expanding the outer macro that contains<br />
the nested definition.<br />
Note that all nested inner macro definitions are effectively “black boxes”: there is no<br />
visibility to the outermost macro definition of any variable symbol or sequence<br />
symbol within any of the nested macro definitions. This means that you cannot use<br />
an enclosing macro definition to tailor or parameterize the contents of a nested<br />
inner macro definition.<br />
This lack of parameterization can be overcome in some cases by using the<br />
AINSERT statement. This lets you generate a macro definition from within another<br />
macro generation. A simple example is shown at “Where to Define a Macro in a<br />
Source Module” on page 243. In Figure 83 on page 312, macro<br />
ainsert_test_macro generates the macro mac1 using a combination of AINSERT<br />
and AREAD instructions. The mac1 macro is then called with a list of seven<br />
parameters.<br />
Chapter 8. How to Write Macro Instructions 311