HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

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

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

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

Saved successfully!

Ooh no, something went wrong!