Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Introducing Built-In Functions HLASM Language Reference SC26-4940-06 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
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 might 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 1, 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 might appear to be ambiguous. For example, the function (1 AND 2) in an arithmetic expression is 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 are converted to 1 (meaning "true") and the result is 1. Similarly, the function (1 XOR 2) in an arithmetic expression has value 3, while in a logical expression it has 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.
|
Copyright IBM Corporation 1990, 2014
|