Most of the time, people will do something like:
UNPK C_RC(L'C_RC+1),RC(L'RC)
TR C_RC,TOHEX-C'0'
...
TOHEX DC C'0123456789ABCDEF'
C_RC DS CL8
C_RC_1 DS C NEEDED FOR PADDING
RC DS F
RC_1 DS C NEEDED FOR PADDING
The above UNPK instruction places an F nybble in front of every nibble in RC
and reverses the nybbles in RC_1. The TR then translates the x'FA' through
x'FF' to the characters A through F, doing an idempotent translation of x'F0'
through x'F9' to x'F0' through x'F9'.
Having said that, I am amusingly(?) weird. I have gotten lazy. I now write all
my "application level" HLASM as LE enabled and "pure" (non self modifying).
Because I do the former (LE), I can use the C language subroutines "natively".
So I use the C runtime's SPRINTF subroutine to make "nice looking" output from
my input into an output buffer. I then actually write that output buffer.
Getting used to C's calling convention is a bit weird. But once learned, is not
really difficult.
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
[email protected] * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or
proprietary information. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original message.
HealthMarkets(r) is the brand name for products underwritten and issued by the
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The
MEGA Life and Health Insurance Company.SM
> -----Original Message-----
> From: IBM Mainframe Assembler List
> [mailto:[email protected]] On Behalf Of Bauer,
> Bobby (NIH/CIT) [E]
> Sent: Wednesday, August 08, 2012 8:07 AM
> To: [email protected]
> Subject: Printing a return code
>
> New to the list but been written assembler off and on for years.
> I'm writing some code using the BCPii API. The return codes
> from the CALLs are placed into storage in (to me) an unusual
> manner. In a full word that looks like:
> 00000301
> or
> 00000F01
>
> How can I make these printable? I'm using a SNAP to debug but
> getting the RC into a WTO would be a LOT easier. Any ideas?
>
> Bobby Bauer
> Center for Information Technology
> National Institutes of Health
> Bethesda, MD 20892-5628
> 301-594-7474
>
>