HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Open Code Sequence Symbols The conditional assembly instructions AGO and AIF in open code control the sequence in which source statements are processed. Using these instructions it is possible to branch back to a sequence symbol label and re-use previously processed statements. Due to operating system restrictions, the primary input source can only be read sequentially, and cannot be re-read. Whenever a sequence symbol in the name field is encountered in open code, the assembler must assume that all subsequent statements may need to be processed more than once. The assembler uses the lookahead file to save the statement containing the sequence symbol label and all subsequent statements as they are read and processed. Any subsequent AGO or AIF to a previously encountered sequence symbol is resolved to an offset into the lookahead file and input continues from that point. Open Code Conditional assembly instructions in open code let you: Select, during conditional assembly, statements or groups of statements from the open code portion of a source module according to a predetermined set of conditions. The assembler further processes the selected statements at assembly time. Pass local variable information from open code through parameters into macro definitions. Control the computation in and generation of macro definitions using global SET symbols. Substitute values into the model statements in the open code of a source module and control the sequence of their generation. All the conditional assembly elements and instructions can be specified in open code. The specifications for the conditional assembly language described in this chapter also apply in open code. However, the following restrictions apply: To Attributes In Open Code: For ordinary symbols, only references to the type, length, scale, integer, defined, and operation code attributes are allowed. References to the number attribute have no meaning in open code, because &SYSLIST is not allowed in open code, and symbolic parameters have no meaning in open code. To Conditional Assembly Expressions: Figure 95 shows the restrictions for different expression types. Figure 95 (Page 1 of 2). Restrictions on Coding Expressions in Open Code Expression Arithmetic (SETA) Must not contain &SYSLIST Symbolic parameters Any attribute references to symbolic parameters, or system variable symbols with local scope 342 HLASM V1R5 Language Reference
Conditional Assembly Instructions Figure 95 (Page 2 of 2). Restrictions on Coding Expressions in Open Code Expression Character (SETC) Logical (SETB) Must not contain System variables with local scope Attribute references to system variables with local scope Symbolic parameters Predefined absolute symbols Arithmetic expressions with the items listed above Character expressions with the items listed above Conditional Assembly Instructions The remainder of this chapter describes, in detail, the syntax and rules for use of each conditional assembler instruction. The following table lists the conditional assembler instructions by type, and provides the page number where the instruction is described in detail. Figure 96. Assembler Instructions Type of Instruction Instruction Page No. Establishing SET symbols GBLA 344 GBLB 344 GBLC 344 LCLA 345 LCLB 345 LCLC 345 SETA 347 SETB 362 SETC 369 Branching ACTR 394 AGO 392 AIF 390 ANOP 395 External Function Calling SETAF 388 SETCF 389 Declaring SET Symbols You must declare a global SET symbol before you can use it. The assembler assigns an initial value to a global SET symbol at its first point of declaration. Local SET symbols need not be declared explicitly with LCLA, LCLB, or LCLC statements. The assembler considers any undeclared variable symbol found in the name field of a SETA, SETB, SETC, SETAF, or SETCF statement to be a local SET symbol. It is given the initial value specified in the operand field. If the symbol in the name field is subscripted, it is declared as a subscripted SET symbol. Chapter 9. How to Write Conditional Assembly Instructions 343
- 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 330 and 331: Values in Operands Parentheses In m
- 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 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
- Page 380 and 381: SETA Instruction In evaluating the
- Page 382 and 383: SETB Instruction Any expression tha
- Page 384 and 385: SETB Instruction ┌─────
- Page 386 and 387: SETB Instruction | ISDEC | Format:
- Page 388 and 389: SETB Instruction The two comparands
- Page 390 and 391: SETC Instruction Notes: 1. The asse
- Page 392 and 393: Figure 103. Substring Notation in C
- Page 394 and 395: Loc Object Code Addr1 Addr2 Stmt So
- Page 396 and 397: | B2C('111111') has value '3' | B2C
- Page 398 and 399: | Output: D2B('decstring') converts
- Page 400 and 401: SIGNED Format: Logical-expression,
- Page 402 and 403: | X2D('') has value '+' | X2D('91')
- Page 404 and 405: Concatenation of strings containing
- Page 406 and 407: MACRO &NAME MOVE &TO,&FROM LCLC &PR
- Page 408 and 409: SETAF Instruction Alternative State
- Page 410 and 411: Branching Branching You can control
Open Code<br />
Sequence Symbols<br />
The conditional assembly instructions AGO and AIF in open code control the<br />
sequence in which source statements are processed. Using these instructions it is<br />
possible to branch back to a sequence symbol label and re-use previously<br />
processed statements. Due to operating system restrictions, the primary input<br />
source can only be read sequentially, and cannot be re-read. Whenever a<br />
sequence symbol in the name field is encountered in open code, the assembler<br />
must assume that all subsequent statements may need to be processed more than<br />
once. The assembler uses the lookahead file to save the statement containing the<br />
sequence symbol label and all subsequent statements as they are read and<br />
processed. Any subsequent AGO or AIF to a previously encountered sequence<br />
symbol is resolved to an offset into the lookahead file and input continues from that<br />
point.<br />
Open Code<br />
Conditional assembly instructions in open code let you:<br />
Select, during conditional assembly, statements or groups of statements from<br />
the open code portion of a source module according to a predetermined set of<br />
conditions. The assembler further processes the selected statements at<br />
assembly time.<br />
Pass local variable information from open code through parameters into macro<br />
definitions.<br />
Control the computation in and generation of macro definitions using global<br />
SET symbols.<br />
Substitute values into the model statements in the open code of a source<br />
module and control the sequence of their generation.<br />
All the conditional assembly elements and instructions can be specified in open<br />
code.<br />
The specifications for the conditional assembly language described in this chapter<br />
also apply in open code. However, the following restrictions apply:<br />
To Attributes In Open Code: For ordinary symbols, only references to the type,<br />
length, scale, integer, defined, and operation code attributes are allowed.<br />
<strong>Reference</strong>s to the number attribute have no meaning in open code, because<br />
&SYSLIST is not allowed in open code, and symbolic parameters have no meaning<br />
in open code.<br />
To Conditional Assembly Expressions: Figure 95 shows the restrictions for<br />
different expression types.<br />
Figure 95 (Page 1 of 2). Restrictions on Coding Expressions in Open Code<br />
Expression<br />
Arithmetic<br />
(SETA)<br />
Must not contain<br />
&SYSLIST<br />
Symbolic parameters<br />
Any attribute references to symbolic parameters, or system variable<br />
symbols with local scope<br />
342 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>