HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R5. 24/6/11 17.48 7 ACONTROL FLAG(NOSUBSTR) 8 &STRING SETC 'STRING' 8 9 &SUBSTR1 SETC '&STRING'(,4) 9 ASMA93E Substring expression 1 less than 1; default=null - OPENC 1 &SUBSTR2 SETC '&STRING'(7,4) 1 ASMA92E Substring expression 1 points past string end; default=null - OPENC 11 &SUBSTR3 SETC '&STRING'(3,) 11 12 &SUBSTR4 SETC '&STRING'(3,-2) 12 ASMA95W Substring expression 2 less than ; default=null - OPENC 13 &SUBSTR5 SETC '&STRING'(3,4) 13 14 &SUBSTR6 SETC '&STRING'(3,5) 14 15 END 15 Figure 105. Sample Assembly Using Substring Notation With Messages Suppressed Character (SETC) expressions can be used only in conditional assembly instructions. Figure 106 shows examples of using character expressions. Figure 106. Use of Character Expressions Used in Used as Example SETC instruction Operand &C SETC 'STRING' AIF or SETB instruction Substring notation Character string in character relation First part of notation AIF ('&C' EQ 'STRING1').B 'SELECT'(2,5) returns 'ELECT' Built-in functions Operand &VAR SETC (LOWER '&twenty.&six') &AB SETA A2B('1') | Character-Valued Built-in Functions: Character-valued built-in functions have | arithmetic-only operands, character-only operands, or both arithmetic and character | operands. Each type is described in a separate section. The maximum string | length of any SETC variable is 1024 bytes. If this length is exceeded, the string | value is truncated, and message ASMA091E is generated. | A2B Here are the SETC built-in functions: | Format: Function-invocation | Operands: Arithmetic | Output: A2B(aexpr) converts the value of its arithmetic argument to a string | of 32 zero ('') and one ('1') characters. The value of aexpr must be | representable as a 32-bit binary integer. If the aexpr argument is negative, | the result contains 32 characters, the first of which is '1'. | Examples | A2B() has value '' | A2B(5) has value '11' | A2B(122) has value '111111111' | A2B(-7) has value '111111111111111111111111111111' | A2B(234567891) indicates an error (value too large) 374 HLASM V1R5 Language Reference

| A2C | Format: Function-invocation | Operands: Arithmetic | Output: A2C(aexpr) | converts the value of its arithmetic argument to a string of four characters | whose bit pattern is the same as the argument's. | Examples | A2C() has value 'nnnn' (4 EBCDIC nulls) | A2C(241) has value 'nnn1' | A2C(246) has value 'nn++' | A2C(-252645136) has value '' | A2D | Format: Function-invocation | Operands: Arithmetic | Output: A2D(aexpr) converts the value of its arithmetic argument to a string | of decimal digits preceded by a plus or minus sign. | Note: The A2D function is similar to the SIGNED function, except that A2D | always provides an initial sign character. | Examples | A2C() has value '+' | A2C(241) has value '+241' | A2C(16448) has value '+16448' | A2C(-3) has value '-3' | A2X | Format: Function-invocation | Operands: Arithmetic | Output: A2X(aexpr) converts the value of its arithmetic argument to a string | of eight hexadecimal characters. | Examples | A2X() has value '' | A2X(1) has value 'A' | A2X(257) has value '11' | A2X(122) has value '3FE' | A2X(-7) has value 'FFFFFFF9' | B2C | Format: Function-invocation | Operands: Character | Output: B2C('bitstring') converts the bit-string character argument to | characters representing the same bit pattern. Null arguments return a null | string. | If needed, the argument string is padded internally on the left with zeros so | that its length is a multiple of eight. | The operand must contain only ones and zeros. Any other value causes the | message ASMA214E to be generated. | Examples Chapter 9. How to Write Conditional Assembly Instructions 375

| A2C<br />

| Format: Function-invocation<br />

| Operands: Arithmetic<br />

| Output: A2C(aexpr)<br />

| converts the value of its arithmetic argument to a string of four characters<br />

| whose bit pattern is the same as the argument's.<br />

| Examples<br />

| A2C() has value 'nnnn' (4 EBCDIC nulls)<br />

| A2C(241) has value 'nnn1'<br />

| A2C(246) has value 'nn++'<br />

| A2C(-252645136) has value ''<br />

| A2D<br />

| Format: Function-invocation<br />

| Operands: Arithmetic<br />

| Output: A2D(aexpr) converts the value of its arithmetic argument to a string<br />

| of decimal digits preceded by a plus or minus sign.<br />

| Note: The A2D function is similar to the SIGNED function, except that A2D<br />

| always provides an initial sign character.<br />

| Examples<br />

| A2C() has value '+'<br />

| A2C(241) has value '+241'<br />

| A2C(16448) has value '+16448'<br />

| A2C(-3) has value '-3'<br />

| A2X<br />

| Format: Function-invocation<br />

| Operands: Arithmetic<br />

| Output: A2X(aexpr) converts the value of its arithmetic argument to a string<br />

| of eight hexadecimal characters.<br />

| Examples<br />

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

| A2X(1) has value 'A'<br />

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

| A2X(122) has value '3FE'<br />

| A2X(-7) has value 'FFFFFFF9'<br />

| B2C<br />

| Format: Function-invocation<br />

| Operands: Character<br />

| Output: B2C('bitstring') converts the bit-string character argument to<br />

| characters representing the same bit pattern. Null arguments return a null<br />

| string.<br />

| If needed, the argument string is padded internally on the left with zeros so<br />

| that its length is a multiple of eight.<br />

| The operand must contain only ones and zeros. Any other value causes the<br />

| message ASMA214E to be generated.<br />

| Examples<br />

Chapter 9. How to Write Conditional Assembly Instructions 375

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

Saved successfully!

Ooh no, something went wrong!