The assembler provides built-in functions for the SETA, SETB and SETC expressions.
Each function returns one value - an arithmetic value for SETA, a binary bit for SETB, and a character string for SETC.
There are two different forms of invocation for the built-in functions:
| Logical-expression unary format |
|---|
|
| Logical-expression binary format |
|---|
|
(A OR B) and (&J SLL 2) are examples of binary logical-expression format functions, and (NOT C) and (SIGNED &J) are examples of unary logical-expression format functions.
| Function-invocation format |
|---|
|
FIND('abcde','d') is an example of a function-invocation format. (The equivalent logical-expression format is ('abcde' FIND 'd').)
Spaces are not allowed between the arguments of functions in function-invocation format.
In either format, the operand is an expression of the type expected by the built-in function. (The particular details of the number of operands and the operand type are provided with the information for each built-in function.)
Conditional-assembly functions do not always behave like functions in traditional high-level languages. The results of a function might not be automatically converted to the type expected in the invoking expression, and nested invocations may not produce expected results. In general, it is safest to invoke only one conditional assembly function in a SET expression or AIF statement.
Some functions are available in one format, some are available in both. Table 57, which provides a summary of all the built-in functions, shows the forms in which a function is available.
Because some function names such as AND and OR are used both as arithmetic operators and as logical connectives, their use may appear to be ambiguous. For example, the function (1 AND 2) in an arithmetic expression would be interpreted as the logical AND of the two 32-bit SETA expressions 1 and 2, resulting in zero. In a logical expression, the two nonzero operands would be converted to 1 (meaning "true") and the result would be 1. Similarly, the function (1 XOR 2) in an arithmetic expression would have value 3, while in a logical expression it would have value 0.
To avoid ambiguities, such function names are interpreted as arithmetic operators in SETA statements, and as logical operators in SETB and AIF statements.
| Function | Type | L-E1 | F-I2 | Result3 | Operands3 | Topic |
|---|---|---|---|---|---|---|
| A2B | Representation conversion | X | C | A | *** | |
| A2C | Representation conversion | X | C | A | *** | |
| A2D | Representation conversion | X | C | A | *** | |
| A2X | Representation conversion | X | C | A | *** | |
| AND | Logical | X | A | A | *** | |
| AND | Logical | X | B | B | *** | |
| AND NOT | Logical | X | B | B | *** | |
| B2A | Representation conversion | X | A | C | *** | |
| B2C4 | Representation conversion | X | C | C | *** | |
| B2D | Representation conversion | X | C | C | *** | |
| B2X4 | Representation conversion | X | C | C | *** | |
| BYTE | Representation conversion | X | X | C | A | *** |
| C2A | Representation conversion | X | A | C | *** | |
| C2B4 | Representation conversion | X | C | C | *** | |
| C2D | Representation conversion | X | C | C | *** | |
| C2X4 | Representation conversion | X | C | C | *** | |
| D2A | Representation conversion | X | A | C | *** | |
| D2B | Representation conversion | X | C | C | *** | |
| D2C | Representation conversion | X | C | C | *** | |
| D2X | Representation conversion | X | C | C | *** | |
| DCLEN | String manipulation | X | A | C | *** | |
| DCVAL | String manipulation | X | C | C | *** | |
| DEQUOTE | String manipulation | X | C | C | *** | |
| DOUBLE | String manipulation | X | X | C | C | *** |
| FIND | String scanning | X | X | A | C | *** |
| INDEX | String scanning | X | X | A | C | *** |
| ISBIN | Validity checking | X | B | C | *** | |
| ISDEC | Validity checking | X | B | C | *** | |
| ISHEX | Validity checking | X | B | C | *** | |
| ISSYM | Validity checking | X | B | C | *** | |
| LOWER | String manipulation | X | X | C | C | *** |
| NOT | Logical | X | X | A | A | *** |
| NOT | Logical | X | B | B | *** | |
| OR | Logical | X | A | A | *** | |
| OR | Logical | X | B | B | *** | |
| OR NOT | Logical | X | B | B | *** | |
| SIGNED | Representation conversion | X | X | C | A | *** |
| SLA | Shift | X | A | A | *** | |
| SLL | Shift | X | A | A | *** | |
| SRA | Shift | X | A | A | *** | |
| SRL | Shift | X | A | A | *** | |
| SYSATTRA | Information retrieval | X | C | C | *** | |
| SYSATTRP | Information retrieval | X | C | C | *** | |
| UPPER | String manipulation | X | X | C | C | *** |
| X2A | Representation conversion | X | A | C | *** | |
| X2B4 | Representation conversion | X | C | C | *** | |
| X2C4 | Representation conversion | X | C | C | *** | |
| X2D | Representation conversion | X | C | C | *** | |
| XOR | Logical | X | A | A | *** | |
| XOR | Logical | X | B | B | *** | |
| XOR NOT | Logical | X | B | B | *** | |
|
Notes:
|
||||||
[ Top of Page | Previous Page | Next Page | Contents | Index ]