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.

Extended SET Statements<br />

Optionally, you can place a period between the closing parenthesis of a substring<br />

notation and the opening single quotation mark of the next item in the operand<br />

field.<br />

If &ALPHA has been assigned the character value AB%4, and &ABC has been assigned<br />

the character value 5RS, either of the following statements can be used to assign<br />

&WORD the character value AB%45RS.<br />

&WORD SETC '&ALPHA'(1,4).'&ABC'<br />

&WORD SETC '&ALPHA'(1,4)'&ABC'(1,3)<br />

If a SETC symbol is used in the operand field of a SETA instruction, the character<br />

value assigned to the SETC symbol must be 1-to-10 decimal digits (not greater<br />

than 2147483647), or a valid self-defining term.<br />

If a SETA symbol is used in the operand field of a SETC statement, the arithmetic<br />

value is converted to an unsigned integer with leading zeros removed. If the value<br />

is 0, it is converted to a single 0.<br />

Extended SET Statements<br />

As well as assigning single values to SET symbols, you can assign values to<br />

multiple elements in an array of a subscripted SET symbol with one single SETx<br />

instruction. Such an instruction is called an extended SET statement.<br />

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

►►──variable_symbol(subscript)<br />

──┬─SETA─┬─── ▼ ─operand─┴──────────────►◄<br />

├─SETB─┤<br />

└─SETC─┘<br />

variable_symbol(subscript)<br />

is a variable symbol and a subscript that shows the position in the SET symbol<br />

array to which the first operand is to be assigned.<br />

operand<br />

is the arithmetic value, binary value, or character value to be assigned to the<br />

corresponding SET symbol array element.<br />

The first operand is assigned to the SET symbol denoted by<br />

variable_symbol(subscript). Successive operands are then assigned to successive<br />

positions in the SET symbol array. If an operand is omitted, the corresponding<br />

element of the array is unchanged. Consider the following example:<br />

LCLA<br />

&LIST(5)<br />

&LIST(3) SETA<br />

5,1,,2,25,3<br />

The first instruction declares &LIST as a subscripted local SETA symbol. The<br />

second instruction assigns values to certain elements of the array &LIST. Thus, the<br />

instruction does the same as the following sequence:<br />

&LIST(3) SETA 5<br />

&LIST(4) SETA<br />

1<br />

&LIST(6) SETA<br />

2<br />

&LIST(7) SETA 25<br />

&LIST(8) SETA<br />

3<br />

Chapter 9. How to Write Conditional Assembly Instructions 387

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

Saved successfully!

Ooh no, something went wrong!