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

LCLA, LCLB, and LCLC Instructions sequence_symbol is a sequence symbol. variable_symbol is a variable symbol, with or without the leading ampersand (&). These instructions can be used anywhere in the body of a macro definition or in the open code portion of a source module. Any variable symbols declared in the operand field have a local scope. They can be used as SET symbols anywhere after the pertinent LCLA, LCLB, or LCLC instructions, but only within the declared local scope. Multiple LCLx statements can declare the same variable symbol so long as only one declaration for a given symbol is encountered during the expansion of a macro. The following rules apply to a local SET variable symbol: Within a macro definition, it must not be the same as any symbolic parameter declared in the prototype statement. It must not be the same as any global variable symbol declared within the same local scope. The same variable symbol must not be declared or used as two different types of SET symbols; for example, as a SETA and a SETB symbol, within the same local scope. A local SET symbol should not begin with &SYS because these characters are used for system variable symbols. Subscripted Local SET Symbols A local subscripted SET symbol is declared by the LCLA, LCLB, or LCLC instruction. ┌─,────────────────────────┐ ►►──┬─────────────────┬──┬─LCLA─┬─── ▼ variable_symbol(dimension) ┴────►◄ └─sequence_symbol─┘ ├─LCLB─┤ └─LCLC─┘ sequence_symbol is a sequence symbol. variable_symbol is a variable symbol, with or without the leading ampersand (&). dimension is the dimension of the array. It must be an unsigned, decimal, self-defining term greater than zero. Example: LCLB &B(1) There is no limit to SET symbol dimensioning. The limit specified in the explicit (LCLx) or implicit (SETx) declaration can also be exceeded by later SETx statements. The dimension shows the number of SET variables associated with 346 HLASM V1R5 Language Reference

Assigning Values to SET Symbols the subscripted SET symbol. The assembler assigns an initial value to every variable in the array thus declared. Subscripted Local SET Symbol: A subscripted local SET symbol can be used only if the declaration has a subscript, which represents a dimension; an unsubscripted local SET symbol can be used only if the declaration had no subscript, except for a number attribute reference to the dimensioned SET symbol. Alternative Format for LCLx Statements The assembler permits an alternative statement format for LCLx instructions: Cont. LCLA &LOCAL_SYMBOL_FOR_DC_GEN, X &COUNTER_FOR_INNER_LOOP, X &COUNTER_FOR_OUTER_LOOP, X &COUNTER_FOR_TRAILING_LOOP Assigning Values to SET Symbols You can assign values to SET symbols by using the SETA, SETB, SETC, SETAF and SETCF instructions (SETx). You can also use these instructions to implicitly define local SET symbols. 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 SETx statement to be a local SET symbol. It is given the initial value specified in the operand field of SETA, SETB and SETC instructions, and the value returned from the external function specified in the operand of SETAF and SETCF instructions. If the symbol in the name field is subscripted, it is declared as a subscripted SET symbol. Note that spaces do not terminate the operand field when used in logical expressions and in build-in functions. For more information, see “Logical (SETB) Expressions” on page 365. SETA Instruction The SETA instruction assigns an arithmetic value to a SETA symbol. You can specify a single value or an arithmetic expression from which the assembler computes the value to assign. You can change the values assigned to an arithmetic or SETA symbol. This lets you use SETA symbols as counters, indexes, or for other repeated computations that require varying values. ►►──variable_symbol──SETA──expression──────────────────────────────►◄ variable_symbol is a variable symbol. A global variable symbol in the name field must have been previously declared as a SETA symbol in a GBLA instruction. Local SETA symbols need not be declared in a LCLA instruction. The assembler considers any undeclared variable symbol found in the name field of a SETA instruction as a local SET symbol. The variable symbol is assigned a type attribute value of N. Chapter 9. How to Write Conditional Assembly Instructions 347

LCLA, LCLB, and LCLC Instructions<br />

sequence_symbol<br />

is a sequence symbol.<br />

variable_symbol<br />

is a variable symbol, with or without the leading ampersand (&).<br />

These instructions can be used anywhere in the body of a macro definition or in the<br />

open code portion of a source module.<br />

Any variable symbols declared in the operand field have a local scope. They can<br />

be used as SET symbols anywhere after the pertinent LCLA, LCLB, or LCLC<br />

instructions, but only within the declared local scope. Multiple LCLx statements can<br />

declare the same variable symbol so long as only one declaration for a given<br />

symbol is encountered during the expansion of a macro.<br />

The following rules apply to a local SET variable symbol:<br />

Within a macro definition, it must not be the same as any symbolic parameter<br />

declared in the prototype statement.<br />

It must not be the same as any global variable symbol declared within the<br />

same local scope.<br />

The same variable symbol must not be declared or used as two different types<br />

of SET symbols; for example, as a SETA and a SETB symbol, within the same<br />

local scope.<br />

A local SET symbol should not begin with &SYS because these characters are<br />

used for system variable symbols.<br />

Subscripted Local SET Symbols<br />

A local subscripted SET symbol is declared by the LCLA, LCLB, or LCLC<br />

instruction.<br />

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

►►──┬─────────────────┬──┬─LCLA─┬─── ▼ variable_symbol(dimension) ┴────►◄<br />

└─sequence_symbol─┘<br />

├─LCLB─┤<br />

└─LCLC─┘<br />

sequence_symbol<br />

is a sequence symbol.<br />

variable_symbol<br />

is a variable symbol, with or without the leading ampersand (&).<br />

dimension<br />

is the dimension of the array. It must be an unsigned, decimal, self-defining<br />

term greater than zero.<br />

Example:<br />

LCLB<br />

&B(1)<br />

There is no limit to SET symbol dimensioning. The limit specified in the explicit<br />

(LCLx) or implicit (SETx) declaration can also be exceeded by later SETx<br />

statements. The dimension shows the number of SET variables associated with<br />

346 <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!