#CONP-convert binary to character hexadecimal with EBCDIC interpretation
Use this macro to generate inline code to convert binary data to character hexadecimal. A character hexadecimal number is a hexadecimal number represented in a string that contains only EBCDIC 0-9 and A-F.
The data is converted to character hexadecimal unless it is a binary value corresponding to the EBCDIC characters A-Z and 0-9. The corresponding hexadecimal values are as follows:
- Hexadecimal Value
- EBCDIC Value
- X'C1'-X'C9'
- A-I
- X'D1'-X'D9'
- J-R
- X'E2'-X'E9'
- S-Z
- X'F0'-X'F9'
- 0-9
A fill character is inserted in the output string to differentiate between these characters and the hexadecimal characters (see the FILLCHR parameter).
Format
- INPUT=reg1
- specifies a register, reg1, that points to the start of the string to convert.
- TO=reg2
- specifies a register, reg2, that points to the location that will contain the converted value.
- LENGTH=reg3
- specifies a register, reg3, that contains the number of characters to convert.
- FILLCHR=fill
- specifies the character that pads the converted output, where fill is the character specified as
an immediate value.
For example, FILLCHR=C"." specifies a "." for the fill character. The string X'C1C2FFC4' is converted to C".A.BFF.D".
Entry requirements
None.
Return conditions
- reg1 points to the next byte immediately following the input string.
- reg2 points to the next available byte following the output string.
- reg3 contains X'00000000'.
Programming considerations
- You can specify the parameters for this macro in any order.
- All labels used in the SPM conditional expression can be no more than 32 characters long. Any additional characters are truncated.
- All SPM conditional expressions can be no more than 128 characters long. Any additional characters are truncated.
Examples
- In the following example:
Before the conversion: R14 points to CONP0, which contains X'C1FFF3'.
R15 points to EBW000.
R0 (the length) contains 3.
After the conversion: R14 points to CONP0+3.
EBW000 contains C" AFF 3".
R15 points to EBW000+6.
R0 contains 0.
LA R14,CONP0 LA R15,EBW000 LA R0,L'CONP0 #CONP INPUT=R14,TO=R15,LENGTH=R0,FILLCHR=C' ' : CONP0 DC X'C1FFF3' - In the following example:
Before the conversion: R14 points to CONP1, which contains X'C1C2FFC4'.
R15 points to EBW050.
The length defaults to 1 byte.
After the conversion: R14 points to CONP1+1.
EBW050 contains C" A".
R15 points to EBW050+2.
LA R14,CONP1 LA R15,EBW050 #CONP INPUT=14,TO=R15,FILLCHR=C' ' : CONP1 DC X'C1C2FFC4' - In the following example:
Before the conversion: R14 points to CONP2, which contains X'C3F361F5C4C1'.
R15 points to EBW070.
R0 (the length) contains 5.
After the conversion: R14 points to CONP2+5.
EBW070 contains C"/C/361/5/D".
R15 points to EBW070+10.
R0 contains 0.
LA R14,CONP2 LA R15,EBW070 LA R0,5 #CONP INPUT=R14,TO=R15,LENGTH=R0,FILLCHR=C"/" : CONP2 DC X'C3F361F5C4C1'
