🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm370
Article #433

Re: Writing double word binary numbers on screen

#433
From: XMAS
Date: Tue, 25 Sep 1990 19:46
28 lines
1319 bytes
>Hi 370 Assemblers..

Who, me? ;->

>I have a double word binary number, and I want to write it on screen in
>decimal form. How can I write it ? Any help would be appreciated.
> -Suleyman Kutlu
>System Programmer

Try the following code fragment:

* R3 contains the doubleword binary number
*
          CVD   R3,PAKNUM              Convert to decimal
          UNPK  DECNUM,PAKNUM          Unpack to character
          OI    LASTDIG,X'F0'          'Fix' last digit to positive
...
          DS    0D
PAKNUM    DC    CL8                    Packed decimal
DECNUM    DS    0CL15
          DC    CL14                   Unpacked decimal
LASTDIG   DC    CL1                    Last digit
...

I hope this helps.  Of course you should check out the above code with
your compiler.  ;-)

 ... Mark
Technical Details
Message-ID: <9009252307.AA23460@ucbvax.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!BOGECNVE.BITNET!XMAS

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!BOGECNVE.BITNET!XMAS
From: XMAS@BOGECNVE.BITNET
Newsgroups: comp.lang.asm370
Subject: Re: Writing double word binary numbers on screen
Message-ID: <9009252307.AA23460@ucbvax.Berkeley.EDU>
Date: 25 Sep 90 19:46:03 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: IBM 370 Assembly Programming Discussion List
              <ASM370@OHSTVMA.BITNET>
Distribution: inet
Organization: The Internet
Lines: 28