Path: 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: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: IBM 370 Assembly Programming Discussion List Distribution: inet Organization: The Internet Lines: 30 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 | |========================================================================|