🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm370
Article #962

Re: hex to decimal

#962
From: Tony D'Amato
Date: Fri, 09 Feb 1990 20:26
30 lines
1832 bytes
On Fri, 9 Feb 90 12:58:52 EST Adam Cohen SPGAAC@UCCVMA.UCOP.EDU (415)987-0346
said:
> 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?

I'm not sure what you are asking -- if you want to print it out in
decimal, here's a good way to do it:

         L     R15,NUMBR            Load number
         CVD   R15,DOUBLE           Convert number to packed
         MVC   TEXT,PREFIX          Move edit prefix to buffer
         ED    TEXT,DOUBLE+5        Edit number to prefix
         ....
PREFIX   DS    X'402020202120'
NUMBR    DS    H'123456'            number to convert
DOUBLE   DS    D
TEXT     DS    CL6

At the end, TEXT will contain your decimal number.

I hope this helped...

|========================================================================|
| Tony D'Amato                     |                                     |
| Computer Systems Engineer        | "Deesclaimer! I don't neeed no      |
| Old Dominion University          |  steenkin' deesclaimer!"            |
| E-Mail: NAD100T@ODUVM.BITNET     |                                     |
| -or-    nad100t@oduvm.cc.odu.edu |   -- with apologies to Mel Brooks   |
|========================================================================|
Technical Details
Message-ID: <9002092229.AA21360@lilac.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ODUVM.BITNET!NAD100T
References: <SPGAAC@UCCVMA>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ODUVM.BITNET!NAD100T
From: NAD100T@ODUVM.BITNET (Tony D'Amato)
Newsgroups: comp.lang.asm370
Subject: Re: hex to decimal
Message-ID: <9002092229.AA21360@lilac.berkeley.edu>
Date: 9 Feb 90 20:26:35 GMT
References: <SPGAAC@UCCVMA>
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: 30