Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!UMDD.BITNET!BRUCE From: BRUCE@UMDD.BITNET (Bruce Crabill) Newsgroups: comp.lang.asm370 Subject: hex to decimal Message-ID: <9002100138.AA24120@lilac.berkeley.edu> Date: 9 Feb 90 22:05:03 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: IBM 370 Assembly Programming Discussion List Distribution: inet Organization: The Internet Lines: 18 If by hex you mean a binary value, then the following will work (and without shifts too): The following code will convert a binary value into a string of EBCDIC numbers. The binary value is assumed to be positive. In any case, the sign will be ignored. The value to convert is loaded into R1. The result is left in the area labeled DECOUT. DECTMP is a scratch area and must be 8 bytes long. DECOUT can be up to 10 bytes long. L R1, CVD R1,DECTMP UNPK DECOUT,DECTMP OI DECOUT+L'DECOUT-1,X'F0' DECTMP DS D DECOUT DS CL8 Bruce