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.

Substring Notation<br />

LCLC &C1,&C2<br />

LCLC &SUBSCRC(2)<br />

. ▲<br />

┌─── ▌1▐ . └─── ▌2▐<br />

▼ .<br />

&SUBSCRC(1) SETC 'ABCDE'<br />

. │<br />

. │<br />

. │<br />

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

▌3▐─────┐<br />

&SUBSCRC Array:<br />

│<br />

▼<br />

┌─────┬─────┬─────┬────/ /────┬─────┬─────┬─────┬────/ /────┬─────┐<br />

│ │ │ │ │ABCDE│ │ │ │ │<br />

└─────┴─────┴─────┴────/ /────┴─────┴─────┴─────┴────/ /────┴─────┘<br />

▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲<br />

1 2 3 4 1 11 12 13 2<br />

Figure 102. Subscripted SETC Symbols<br />

Character (SETC) Expressions<br />

The main purpose of a character expression is to assign a character value to a<br />

SETC symbol. You can then use the SETC symbol to substitute the character<br />

string into a model statement.<br />

You can also use a character expression as a value for comparison in condition<br />

tests and logical expressions. Also, a character expression provides the string from<br />

which characters can be selected by the substring notation.<br />

Substitution of one or more character values into a character expression lets you<br />

use the character expression wherever you need to vary values for substitution or<br />

to control loops.<br />

A character string consists of any combination of characters enclosed in single<br />

quotation marks. Variable symbols are allowed. The assembler substitutes the<br />

representation of their values as character strings into the character expression<br />

| before evaluating the expression. Up to 1024 characters are allowed in a character<br />

expression.<br />

An attribute reference must be the only term in a character expression.<br />

Substring Notation: The substring notation lets you refer to one or more<br />

characters within a character string. You can, therefore, either select characters<br />

from the string and use them for substitution or testing, or scan through a complete<br />

string, inspecting each character. By concatenating substrings with other<br />

substrings or character strings, you can rearrange and build your own strings.<br />

The substring notation can be used only in conditional assembly instructions.<br />

Figure 103 shows how to use the substring notation.<br />

Chapter 9. How to Write Conditional Assembly Instructions 371

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

Saved successfully!

Ooh no, something went wrong!