Article View: comp.lang.asm370
Article #964hex to decimal
From: SOMITCW
Date: Sat, 10 Feb 1990 03:05
Date: Sat, 10 Feb 1990 03:05
25 lines
1417 bytes
1417 bytes
>say you've got a hex value in a register and
>want to convert it to decimal. isnt there
>a quick way to do this with shifts?
If by HEX to DECIMAL, you mean convert a register value to
a HEX display format, use UNPK and TR.
Example:
ST Rx,WORK1 Put the register in storage for UNPacK
UNPK OUTPUT(9),WORK(5) UNPacK the register's data
TR OUTPUT(8),TABLE Translate X'FA'-X'FF' to C'A'-C'F'
*
OUTPUT DS CL8,CL1 Output area for HEX in display format
*
WORK DS XL4 Register hold area
*
TABLE EQU *-240 TRANSLATE TABLE
DC CL16'0123456789ABCDEF'
*
Notes: The 5th byte of WORK is referenced by UNPK.
The 9th byte of OUTPUT is garbage.
The programs base register must point more than 240 bytes
before where TABLE is defined.
Technical Details
Message-ID:
<9002100327.AA24770@lilac.berkeley.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!VCCSCENT.BITNET!SOMITCWShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!VCCSCENT.BITNET!SOMITCW From: SOMITCW@VCCSCENT.BITNET Newsgroups: comp.lang.asm370 Subject: hex to decimal Message-ID: <9002100327.AA24770@lilac.berkeley.edu> Date: 10 Feb 90 03:05:24 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: IBM 370 Assembly Programming Discussion List <ASM370%UCF1VM.bitnet@lilac.berkeley.edu> Distribution: inet Organization: The Internet Lines: 25