HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R5. 24/6/11 17.48 7 ACONTROL FLAG(NOSUBSTR) 8 &STRING SETC 'STRING' 8 9 &SUBSTR1 SETC '&STRING'(,4) 9 ASMA93E Substring expression 1 less than 1; default=null - OPENC 1 &SUBSTR2 SETC '&STRING'(7,4) 1 ASMA92E Substring expression 1 points past string end; default=null - OPENC 11 &SUBSTR3 SETC '&STRING'(3,) 11 12 &SUBSTR4 SETC '&STRING'(3,-2) 12 ASMA95W Substring expression 2 less than ; default=null - OPENC 13 &SUBSTR5 SETC '&STRING'(3,4) 13 14 &SUBSTR6 SETC '&STRING'(3,5) 14 15 END 15 Figure 105. Sample Assembly Using Substring Notation With Messages Suppressed Character (SETC) expressions can be used only in conditional assembly instructions. Figure 106 shows examples of using character expressions. Figure 106. Use of Character Expressions Used in Used as Example SETC instruction Operand &C SETC 'STRING' AIF or SETB instruction Substring notation Character string in character relation First part of notation AIF ('&C' EQ 'STRING1').B 'SELECT'(2,5) returns 'ELECT' Built-in functions Operand &VAR SETC (LOWER '&twenty.&six') &AB SETA A2B('1') | Character-Valued Built-in Functions: Character-valued built-in functions have | arithmetic-only operands, character-only operands, or both arithmetic and character | operands. Each type is described in a separate section. The maximum string | length of any SETC variable is 1024 bytes. If this length is exceeded, the string | value is truncated, and message ASMA091E is generated. | A2B Here are the SETC built-in functions: | Format: Function-invocation | Operands: Arithmetic | Output: A2B(aexpr) converts the value of its arithmetic argument to a string | of 32 zero ('') and one ('1') characters. The value of aexpr must be | representable as a 32-bit binary integer. If the aexpr argument is negative, | the result contains 32 characters, the first of which is '1'. | Examples | A2B() has value '' | A2B(5) has value '11' | A2B(122) has value '111111111' | A2B(-7) has value '111111111111111111111111111111' | A2B(234567891) indicates an error (value too large) 374 HLASM V1R5 Language Reference
| A2C | Format: Function-invocation | Operands: Arithmetic | Output: A2C(aexpr) | converts the value of its arithmetic argument to a string of four characters | whose bit pattern is the same as the argument's. | Examples | A2C() has value 'nnnn' (4 EBCDIC nulls) | A2C(241) has value 'nnn1' | A2C(246) has value 'nn++' | A2C(-252645136) has value '' | A2D | Format: Function-invocation | Operands: Arithmetic | Output: A2D(aexpr) converts the value of its arithmetic argument to a string | of decimal digits preceded by a plus or minus sign. | Note: The A2D function is similar to the SIGNED function, except that A2D | always provides an initial sign character. | Examples | A2C() has value '+' | A2C(241) has value '+241' | A2C(16448) has value '+16448' | A2C(-3) has value '-3' | A2X | Format: Function-invocation | Operands: Arithmetic | Output: A2X(aexpr) converts the value of its arithmetic argument to a string | of eight hexadecimal characters. | Examples | A2X() has value '' | A2X(1) has value 'A' | A2X(257) has value '11' | A2X(122) has value '3FE' | A2X(-7) has value 'FFFFFFF9' | B2C | Format: Function-invocation | Operands: Character | Output: B2C('bitstring') converts the bit-string character argument to | characters representing the same bit pattern. Null arguments return a null | string. | If needed, the argument string is padded internally on the left with zeros so | that its length is a multiple of eight. | The operand must contain only ones and zeros. Any other value causes the | message ASMA214E to be generated. | Examples Chapter 9. How to Write Conditional Assembly Instructions 375
- Page 344 and 345: Data Attributes this example indica
- Page 346 and 347: Data Attributes variable_symbol is
- Page 348 and 349: Data Attributes The value of an att
- Page 350 and 351: Data Attributes The following attri
- Page 352 and 353: Data Attributes Assembler gives a t
- Page 354 and 355: Data Attributes The scale attribute
- Page 356 and 357: Data Attributes Number Attribute (N
- Page 358 and 359: Data Attributes The operation code
- Page 360 and 361: Lookahead MACRO &NAME MOVE &TO,&FRO
- Page 362 and 363: Open Code Sequence Symbols The cond
- Page 364 and 365: GBLA, GBLB, and GBLC Instructions G
- Page 366 and 367: LCLA, LCLB, and LCLC Instructions s
- Page 368 and 369: SETA Instruction expression is an a
- Page 370 and 371: SETA Instruction | The logical-exp
- Page 372 and 373: SETA Instruction | Figure 99 (Page
- Page 374 and 375: SETA Instruction | The result of C2
- Page 376 and 377: SETA Instruction NOT Format: Logica
- Page 378 and 379: SETA Instruction | X2A Name Operati
- Page 380 and 381: SETA Instruction In evaluating the
- Page 382 and 383: SETB Instruction Any expression tha
- Page 384 and 385: SETB Instruction ┌─────
- Page 386 and 387: SETB Instruction | ISDEC | Format:
- Page 388 and 389: SETB Instruction The two comparands
- Page 390 and 391: SETC Instruction Notes: 1. The asse
- Page 392 and 393: Figure 103. Substring Notation in C
- Page 396 and 397: | B2C('111111') has value '3' | B2C
- Page 398 and 399: | Output: D2B('decstring') converts
- Page 400 and 401: SIGNED Format: Logical-expression,
- Page 402 and 403: | X2D('') has value '+' | X2D('91')
- Page 404 and 405: Concatenation of strings containing
- Page 406 and 407: MACRO &NAME MOVE &TO,&FROM LCLC &PR
- Page 408 and 409: SETAF Instruction Alternative State
- Page 410 and 411: Branching Branching You can control
- Page 412 and 413: AGO Instruction The extended AIF in
- Page 414 and 415: ACTR Instruction AGOB—Synonym of
- Page 416 and 417: ANOP Instruction statement processe
- Page 418 and 419: MHELP Instruction MHELP B'10000000'
- Page 420 and 421: 400 HLASM V1R5 Language Reference
- Page 422 and 423: Assembler Instructions and Statemen
- Page 424 and 425: Assembler Instructions and Statemen
- Page 426 and 427: Assembler Instructions and Statemen
- Page 428 and 429: Summary of Constants Figure 113. Su
- Page 430 and 431: Macro and Conditional Assembly Lang
- Page 432 and 433: Macro and Conditional Assembly Lang
- Page 434 and 435: Macro and Conditional Assembly Lang
- Page 436 and 437: Macro and Conditional Assembly Lang
- Page 438 and 439: Macro and Conditional Assembly Lang
- Page 440 and 441: Macro and Conditional Assembly Lang
- Page 442 and 443: Standard Character Set Code Table H
Loc Object Code Addr1 Addr2 Stmt Source Statement <strong>HLASM</strong> R5. 24/6/11 17.48<br />
7 ACONTROL FLAG(NOSUBSTR)<br />
8 &STRING SETC 'STRING' 8<br />
9 &SUBSTR1 SETC '&STRING'(,4) 9<br />
ASMA93E Substring expression 1 less than 1; default=null - OPENC<br />
1 &SUBSTR2 SETC '&STRING'(7,4) 1<br />
ASMA92E Substring expression 1 points past string end; default=null - OPENC<br />
11 &SUBSTR3 SETC '&STRING'(3,) 11<br />
12 &SUBSTR4 SETC '&STRING'(3,-2) 12<br />
ASMA95W Substring expression 2 less than ; default=null - OPENC<br />
13 &SUBSTR5 SETC '&STRING'(3,4) 13<br />
14 &SUBSTR6 SETC '&STRING'(3,5) 14<br />
15 END 15<br />
Figure 105. Sample Assembly Using Substring Notation With Messages Suppressed<br />
Character (SETC) expressions can be used only in conditional assembly<br />
instructions. Figure 106 shows examples of using character expressions.<br />
Figure 106. Use of Character Expressions<br />
Used in Used as Example<br />
SETC instruction Operand &C SETC 'STRING'<br />
AIF or SETB instruction<br />
Substring notation<br />
Character string<br />
in character<br />
relation<br />
First part of<br />
notation<br />
AIF<br />
('&C' EQ 'STRING1').B<br />
'SELECT'(2,5) returns 'ELECT'<br />
Built-in functions Operand &VAR SETC (LOWER '&twenty.&six')<br />
&AB SETA A2B('1')<br />
| Character-Valued Built-in Functions: Character-valued built-in functions have<br />
| arithmetic-only operands, character-only operands, or both arithmetic and character<br />
| operands. Each type is described in a separate section. The maximum string<br />
| length of any SETC variable is 1024 bytes. If this length is exceeded, the string<br />
| value is truncated, and message ASMA091E is generated.<br />
| A2B<br />
Here are the SETC built-in functions:<br />
| Format: Function-invocation<br />
| Operands: Arithmetic<br />
| Output: A2B(aexpr) converts the value of its arithmetic argument to a string<br />
| of 32 zero ('') and one ('1') characters. The value of aexpr must be<br />
| representable as a 32-bit binary integer. If the aexpr argument is negative,<br />
| the result contains 32 characters, the first of which is '1'.<br />
| Examples<br />
| A2B() has value ''<br />
| A2B(5) has value '11'<br />
| A2B(122) has value '111111111'<br />
| A2B(-7) has value '111111111111111111111111111111'<br />
| A2B(234567891) indicates an error (value too large)<br />
374 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>