11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SETA instructionOutput: X2A(’hexstring’) converts a character string argument containinghexadecimal digits to an arithmetic value.v If the character string contains fewer than 8 characters, it is paddedinternally on the left with ’0’ characters.v Error conditions are detected if the argument contains invalid characters,or if the argument length exceeds 8 characters, generating the messageASMA214E.v Null argument strings return zero.The result of the X2A function is the same as&value SETA X’hexstring’except that null strings are allowed by X2A but not by SETA.ExamplesX2A(’00000101’) has value 257X2A(’C1’) has value 193X2A(’’) has value 0X2A(’FFFFFFF0’) has value -16XOR Format: Logical-expressionOperands: ArithmeticOutput: Each bit position in the result is set to 1 if the corresponding bitpositions in the two operands are unlike, otherwise the result bit is set to 0.Example After the following statements &VAR contains the arithmetic value+8.Name Operation Operand&OP1 SETA 10&OP2 SETA 2&VAR SETA (&OP1 XOR &OP2)Rules for coding arithmetic expressions: The following is a summary of codingrules for arithmetic expressions:1. Unary (operating on one value) operators and binary (operating on twovalues) operators are allowed in arithmetic expressions.2. An arithmetic expression can have one or more unary operators preceding anyterm in the expression or at the beginning of the expression. The unaryoperators are + (positive) and − (negative).3. The binary operators that can be used to combine the terms of an expressionare + (addition), − (subtraction), * (multiplication), and / (division).4. An arithmetic expression must not begin with a binary operator, and it mustnot contain two binary operators in succession.5. An arithmetic-valued function is a term.6. An arithmetic expression must not contain two terms in succession.7. An arithmetic expression must not contain a decimal point. For example,123.456 is not a valid arithmetic term, but 123 is.8. An arithmetic expression must not contain spaces between an operator and aterm, nor between two successive operators except for built-in functions usingthe “logical-expression format” described at “Logical (SETB) expressions” onpage 361.9. Ordinary symbols specified in arithmetic expressions must be defined beforethe arithmetic expression is encountered, and must have an absolute value.Chapter 9. How to write conditional assembly instructions 355

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

Saved successfully!

Ooh no, something went wrong!