22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sublists in Operands<br />

Figure 80 on page 305 shows that the value specified in a positional or keyword<br />

operand can be a sublist.<br />

A symbolic parameter can refer to the whole sublist (see ▌1▐ in Figure 80), or to an<br />

individual entry of the sublist. To refer to an individual entry, the symbolic<br />

parameter (see ▌2▐ in Figure 80) must have a subscript whose value indicates the<br />

position (see ▌3▐ in Figure 80) of the entry in the sublist. The subscript must have<br />

a value greater than or equal to 1.<br />

| A sublist, including the enclosing parentheses, must not contain more than 1024<br />

characters. It consists of one or more entries separated by commas and enclosed<br />

in parentheses; for example, (A,B,C,D,E). () is a valid sublist with the null<br />

character string as the only entry.<br />

MACRO<br />

SUBLISTS &P1,&P2,&KEY=(F,F,)<br />

. ▲ Refers to default value<br />

. ┌───▌3▐──┘ in keyword operand<br />

. │<br />

&KEY(1) DC &KEY(2)'&KEY(3)'<br />

.<br />

. ┌────────────▌3▐ Refers to value in<br />

&P1(1) DC &P1(2)'&P1(3)' │ positional operand<br />

. ▌2▐ │<br />

. │<br />

DC A&P2 │<br />

. │ │<br />

. └───────────────▌1▐ │<br />

MEND │ │<br />

──────────────────────────────────┼──────┼───────────────────────────────<br />

OPEN START │ │<br />

. ▼ │<br />

. ┌─────┐ │<br />

SUBLISTS (H2,H,2),(A,B,C) │<br />

. ▲ │<br />

. └──────────────┘<br />

.<br />

+F DC F''<br />

.<br />

.<br />

+H2 DC H'2'<br />

.<br />

.<br />

+ DC A(A,B,C)<br />

.<br />

.<br />

END<br />

Figure 80. Sublists in Operands<br />

Figure 81 shows the relationship between subscripted parameters and sublist<br />

entries if:<br />

A sublist entry is omitted (see ▌1▐ in Figure 81).<br />

The subscript refers past the end of the sublist (see ▌2▐ in Figure 81).<br />

The value of the operand is not a sublist (see ▌3▐ in Figure 81).<br />

The parameter is not subscripted (see ▌4▐ in Figure 81).<br />

Chapter 8. How to Write Macro Instructions 305

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

Saved successfully!

Ooh no, something went wrong!