bdfs1m0r | Structured Programming Macros |
Use this macro to generate inline code to convert a character hexadecimal number to a binary value. Each pair of character hexadecimal digits converts to 1 byte of binary.
This macro only converts data that corresponds to the EBCDIC characters A-Z and 0-9. The corresponding hexadecimal values are as follows:
Format
|
Entry Requirements
None.
Return Conditions
Programming Considerations
Before the conversion: |
R14 points to EBX000, which contains C'12713971'. R15 points to EBW000. R0 contains 8. |
After the conversion: |
R14 points to EBX000+8. EBW000 contains X'12713971'. R15 points to EBW000+4. R0 is zero (no bytes left to convert). |
MVC EBX000(8),=C'12713971' LA R14,EBX000 LA R15,EBW000 LA R0,8 #CONH INPUT=R14,TO=R15,MAX=R0
Before the conversion: |
R14 points to EBX000, which contains C'ACD9E7'. R15 points to EBW010. R0 contains 6. |
After the conversion: |
R14 points to EBX000+6. EBW010 contains X'ACD9E7'. R15 points to EBW010+3. R0 is zero (no bytes left to convert). |
MVC EBX000(6),=C'ACD9E7' SET UP INPUT STRING LA R14,EBX000 SET UP INPUT ADDRESS LA R15,EBW010 WHERE TO PLACE LA R0,6 NUMBER OF INPUT CHARS #CONH INPUT=R14,TO=R15,MAX=R0 HEXADECIMAL TO BINARY
Before the conversion: |
R14 points to EBX020, which contains C'AB35*CDE'. R15 points to EBW030. R0 contains 8. |
After the conversion: |
R14 points to EBX020+4 (C'*'). EBW030 contains X'AB35'. R15 points to EBW030+2. R0 contains 4. |
MVC EBX020(8),=C'AB35*CDE' SET UP INPUT STRING LA R14,EBX020 SET UP INPUT ADDRESS LA R15,EBW030 WHERE TO PLACE LA R0,8 NUMBER OF INPUT CHARS #CONH INPUT=R14,TO=R15,MAX=R0 HEXADECIMAL TO BINARY
Related Macros