11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SETC instruction|LCLC &C1,&C2LCLC &SUBSCRC(20)&D(4) SETC ’XYZ’. ┌─── ▌1▐ . └─── ▌2▐ .&SUBSCRC(10) SETC ’ABCDE’. │. │. │────────────────────────┼──────────────────────────────────────────────▌3▐─────┐&SUBSCRC Array: │┌─────┬─────┬─────┬────/ /────┬─────┬─────┬─────┬────/ /────┬─────┐│ │ │ │ │ABCDE│ │ │ │ │└─────┴─────┴─────┴────/ /────┴─────┴─────┴─────┴────/ /────┴─────┘ 1 2 3 4 10 11 12 13 20Figure 42. Subscripted SETC symbolsCharacter (SETC) expressionsThe main purpose of a character expression is to assign a character value to aSETC symbol. You can then use the SETC symbol to substitute the character stringinto a model statement.You can also use a character expression as a value for comparison in conditiontests and logical expressions. Also, a character expression provides the string fromwhich characters can be selected by the substring notation.Substitution of one or more character values into a character expression lets youuse the character expression wherever you need to vary values for substitution orto control loops.An attribute reference must be the only term in a character expression.Substring notation: The substring notation lets you refer to one or morecharacters within a character string. You can, therefore, either select characters fromthe string and use them for substitution or testing, or scan through a completestring, inspecting each character. By concatenating substrings with other substringsor character strings, you can rearrange and build your own strings.The substring notation can be used only in conditional assembly instructions.Table 60 shows how to use the substring notation.Table 60. Substring notation in conditional assembly instructionsUsed in Used as ExampleSETC instruction Operand &C1 SETC ’ABC’(1,3)operandPart of&C2 SETC ’&C1’(1,2).’DEF’operandAIF or SETBinstructionoperand (logicalexpression)Character valuein comparand ofcharacterrelationAIF (’&STRING’(1,4) EQ ’AREA’).SEQ&B SETB (’&STRING’(1,4).’9’ EQ ’FULL9’)Valueassigned toSETC SymbolABCABDEF---366 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>

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

Saved successfully!

Ooh no, something went wrong!