11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Assigning values to SET symbolsLogical-expression unary format|►► (built-in_function operand) ►◄Logical-expression binary format|►► (operand built-in_function operand) ►◄|(A OR B) and (&J SLL 2) are examples of binary logical-expression formatfunctions, and (NOT C) and (SIGNED &J) are examples of unarylogical-expression format functions.v The function-invocation format has the function first, followed by one or moreoperands in parentheses.Function-invocation format►►built-in_function(operand )►◄▼, operand|FIND(’abcde’,’d’) is an example of a function-invocation format. (Theequivalent logical-expression format is (’abcde’ FIND ’d’).)Spaces are not allowed between the arguments of functions infunction-invocation format.In either format, the operand is an expression of the type expected by the built-infunction. (The particular details of the number of operands and the operand typeare provided with the information for each built-in function.)|||||Conditional-assembly functions do not always behave like functions in traditionalhigh-level languages. The results of a function might not be automaticallyconverted to the type expected in the invoking expression, and nested invocationsmay not produce expected results. In general, it is safest to invoke only oneconditional assembly function in a SET expression or AIF statement.Some functions are available in one format, some are available in both. Table 57 onpage 345, which provides a summary of all the built-in functions, shows the formsin which a function is available.||||||||Because some function names such as AND and OR are used both as arithmeticoperators and as logical connectives, their use may appear to be ambiguous. Forexample, the function (1 AND 2) in an arithmetic expression would be interpretedas the logical AND of the two 32-bit SETA expressions 1 and 2, resulting in zero. Ina 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 arithmeticexpression would have value 3, while in a logical expression it would have value0.344 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>

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

Saved successfully!

Ooh no, something went wrong!