22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

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

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

SETA Instruction<br />

| X2A<br />

Name Operation Operand<br />

&OP1 SETA -344<br />

&OP2 SETA 4<br />

&VAR SETA (&OP1 SRL &OP2)<br />

| Format: Function-invocation<br />

| Operands: Character<br />

| Output: X2A('hexstring') converts a character string argument containing<br />

| hexadecimal digits to an arithmetic value.<br />

| If the character string contains fewer than 8 characters, it is padded<br />

| internally on the left with '' characters.<br />

| Error conditions are detected if the argument contains invalid characters,<br />

| or if the argument length exceeds 8 characters, generating the message<br />

| ASMA214E.<br />

| Null argument strings return zero.<br />

| The result of the X2A function is the same as<br />

| &value SETA X'hexstring'<br />

| except that null strings are allowed by X2A but not by SETA.<br />

| Examples<br />

| X2A('11') has value 257<br />

| X2A('C1') has value 193<br />

| X2A('') has value <br />

| X2A('FFFFFFF') has value -16<br />

XOR<br />

Format: Logical-expression<br />

Operands: Arithmetic<br />

Output: Each bit position in the result is set to 1 if the corresponding bit<br />

positions in the two operands are unlike, otherwise the result bit is set to 0.<br />

Example After the following statements &VAR contains the arithmetic value +8.<br />

Name Operation Operand<br />

&OP1 SETA 1<br />

&OP2 SETA 2<br />

&VAR SETA (&OP1 XOR &OP2)<br />

Rules for Coding Arithmetic Expressions: The following is a summary of coding<br />

rules for arithmetic expressions:<br />

1. Unary (operating on one value) operators and binary (operating on two values)<br />

operators are allowed in arithmetic expressions.<br />

2. An arithmetic expression can have one or more unary operators preceding any<br />

term in the expression or at the beginning of the expression. The unary<br />

operators are + (positive) and − (negative).<br />

3. The binary operators that can be used to combine the terms of an expression<br />

are + (addition), − (subtraction), (multiplication), and / (division).<br />

4. An arithmetic expression must not begin with a binary operator, and it must not<br />

contain two binary operators in succession.<br />

358 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!