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

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

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>

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

Saved successfully!

Ooh no, something went wrong!