HLASM Language Reference
HLASM Language Reference HLASM Language Reference
SETA Instruction | Figure 99 (Page 3 of 3). Summary of Built-In Functions | Function Type L-E F-I Result Operands Page | X2C Representation conversion √ C C 381 | X2D Representation conversion √ C C 381 | XOR Logical √ A A 358 | XOR Logical √ B B 367 | XOR NOT Logical √ B B 367 | Notes: | 1. If a √ is in this column, the function is available in the “logical-expression” format. | 2. If a √ is in this column, the function is available in the “function-invocation” format. | 3. Possible values in these columns are: | A Arithmetic | B Binary | C Character | 4. For these functions, the maximum length of the operand (and output) is the maximum | string length that the assembler supports, currently 1024. Arithmetic (SETA) Expressions Figure 100 shows how arithmetic expressions can be used. Figure 100. Use of Arithmetic Expressions Used in Used as Example SETA instruction Operand &A1 SETA &A1+2 AIF or SETB instruction Term in arithmetic relation AIF (&A1 GT 3).A Subscripted SET symbols Subscript &ASYM(&A+1−&C) Substring notation Subscript 'STRING'(&A2,&A−1) Sublist notation Subscript Given sublist (A,B,C,D) named &PARAM, if &A=1 then &PARAM(&A+1)=B &SYSLIST Subscript &SYSLIST(&M+1,&N−2) &SYSLIST(N'&SYSLIST) SETC instruction Character string in operand Given &C SETC '5−1&A' ▌1▐ if &A=1 then &C=5−11 ▌2▐ Given &D SETC '5−1&A' ▌1▐ if &A=−1 then &D=5−11▌3▐ Built-in functions Operand &VAR SETA (NOT &OP1) &VAR SETA BYTE(64) When an arithmetic expression is used in the operand field of a SETC instruction (see ▌1▐ in Figure 100), the assembler assigns the character value representing the arithmetic expression to the SETC symbol, after substituting values (see ▌2▐ in Figure 100) into any variable symbols. It does not evaluate the arithmetic expression. The mathematical sign (+ or −) is not included in the substituted value 352 HLASM V1R5 Language Reference
SETA Instruction of a variable symbol (see ▌3▐ in Figure 100), and any insignificant leading zeros are removed. Here are the built-in functions for arithmetic (SETA) expressions: AND | B2A Format: Logical-expression Operands: Arithmetic Output: (aexpr1 AND aexpr2) provides an arithmetic result where each bit position in the result is set to 1 if the corresponding bit positions in both operands contain 1, otherwise, the result bit is set to 0. Example After the following statements &VAR contains the arithmetic value +2. Name Operation Operand &OP1 SETA 1 &OP2 SETA 2 &VAR SETA (&OP1 AND &OP2) | Format: Function-invocation | Operands: Character | Output: B2A('bitstring') converts a character string argument containing | '' and '1' characters to an arithmetic value. | Fewer than 32 characters are padded internally on the left with '' | characters to a length of 32 characters. | Error conditions are detected if the argument contains invalid characters, | or if the argument length exceeds 32 characters, generating the message | ASMA214E. | Null argument strings return zero. | The result of the B2A function is the same as | &value SETA B'bitstring' | except that null strings are allowed by B2A but not by SETA. | Examples | B2A('') has value | B2A('11') has value 5 | B2A('1111111111111111111111111111111') has value -2 | C2A | Format: Function-invocation | Operands: Character | Output: C2A('charstring') converts a character string of zero to four | characters to a binary arithmetic value having the same bit pattern. | Fewer than four characters are padded internally on the left with EBCDIC | null characters to a length of four characters. | An error condition is detected if the argument length exceeds 4 | characters, generating the message ASMA214E. | Null argument strings return zero. Chapter 9. How to Write Conditional Assembly Instructions 353
- Page 322 and 323: Macro Instruction Format When you n
- Page 324 and 325: Sublists in Operands the order in w
- Page 326 and 327: Sublists in Operands &SYSLIST( n,m)
- Page 328 and 329: Values in Operands Notes: 1. Spaces
- Page 330 and 331: Values in Operands Parentheses In m
- Page 332 and 333: Inner and Outer Macro Instructions
- Page 334 and 335: Levels of Macro Call Nesting When t
- Page 336 and 337: Levels of Macro Call Nesting System
- Page 338 and 339: How to Write Conditional Assembly I
- Page 340 and 341: SET Symbols SET Symbol Specificatio
- Page 342 and 343: SET Symbols Figure 86 (Page 3 of 3)
- 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 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 394 and 395: Loc Object Code Addr1 Addr2 Stmt So
- 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
SETA Instruction<br />
of a variable symbol (see ▌3▐ in Figure 100), and any insignificant leading zeros<br />
are removed.<br />
Here are the built-in functions for arithmetic (SETA) expressions:<br />
AND<br />
| B2A<br />
Format: Logical-expression<br />
Operands: Arithmetic<br />
Output: (aexpr1 AND aexpr2) provides an arithmetic result where each bit<br />
position in the result is set to 1 if the corresponding bit positions in both<br />
operands contain 1, otherwise, the result bit is set to 0.<br />
Example<br />
After the following statements &VAR contains the arithmetic value +2.<br />
Name Operation Operand<br />
&OP1 SETA 1<br />
&OP2 SETA 2<br />
&VAR SETA (&OP1 AND &OP2)<br />
| Format: Function-invocation<br />
| Operands: Character<br />
| Output: B2A('bitstring') converts a character string argument containing<br />
| '' and '1' characters to an arithmetic value.<br />
| Fewer than 32 characters are padded internally on the left with ''<br />
| characters to a length of 32 characters.<br />
| Error conditions are detected if the argument contains invalid characters,<br />
| or if the argument length exceeds 32 characters, generating the message<br />
| ASMA214E.<br />
| Null argument strings return zero.<br />
| The result of the B2A function is the same as<br />
| &value SETA B'bitstring'<br />
| except that null strings are allowed by B2A but not by SETA.<br />
| Examples<br />
| B2A('') has value <br />
| B2A('11') has value 5<br />
| B2A('1111111111111111111111111111111') has value -2<br />
| C2A<br />
| Format: Function-invocation<br />
| Operands: Character<br />
| Output: C2A('charstring') converts a character string of zero to four<br />
| characters to a binary arithmetic value having the same bit pattern.<br />
| Fewer than four characters are padded internally on the left with EBCDIC<br />
| null characters to a length of four characters.<br />
| An error condition is detected if the argument length exceeds 4<br />
| characters, generating the message ASMA214E.<br />
| Null argument strings return zero.<br />
Chapter 9. How to Write Conditional Assembly Instructions 353