Hmmm... this version would avoid possible S0C4 in the general case:
*
CnvrtHex DS 0H
MVC ArgCopy,0(R1)
UNPK WorkArea(9),ArgCopy(5)
TR WorkArea,=C'0123456789ABCDEF'-240
LA R1,WorkArea
BR R14
*
ArgCopy DS CL4
WorkArea DS CL8 "Unpacked" hex
DS CL1 Garbage byte for UNPK
At 04:25 PM 11/21/2005, I wrote:
>I didn't see the original post (was it sent to the listserv?) but
>here's how I convert "internal hex" to "external hex" in assembler.
>It shouldn't be too hard to get COBOL to do the same kind of thing:
>
>* At entry, R1 contains the address of a 4-byte field to be
>* converted to external hex. At exit, R1 contains the address
>* of the 8-byte return value.
>*
>CnvrtHex DS 0H
> UNPK WorkArea(9),0(5,R1)
> TR WorkArea,=C'0123456789ABCDEF'-240
> LA R1,WorkArea
> BR R14
>*
>WorkArea DS CL8 "Unpacked" hex
> DS CL1 Garbage byte for UNPK
>
==================================================
Art Celestini Celestini Development Services
Phone: 201-670-1674 Wyckoff, NJ
============= http://celestini.com =============
Mail sent to the "From" address used in this post
will be rejected by our server. Please send off-
list email to: ibmmain<at-sign>celestini<dot>com.
==================================================
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html