🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm370
Article #434

Re: Writing double word binary numbers on screen

#434
From: Valdis Kletnieks
Date: Tue, 25 Sep 1990 23:10
38 lines
1816 bytes
On Tue, 25 Sep 90 14:46:03 -0500 <XMAS%BOGECNVE.BITNET@OHSTVMA.IRCC.OHIO-STATE.E
>* R3 contains the doubleword binary number
Must be some S/390 exetension that allows a 32-bit register to hold a 64-bit
quantity. :-)

Note that a 64-bit signed quantity can be as high as 9,233,372,036,854,775,808.

We can pretend that a 64-bit signed quantity is really equal to
(high4byte * 2**32) + low4byte.

So, closer to reality would be:

            LM   R2,R3,BIT64
            CVD  R2,FIELD1
            CVD  R3,FIELD2
            MP   FIELD1,OFF32   (OFF32 is a packed decimal form of 2**32)
            AP   FIELD1(..),FIELD2(..)
            UNPK FIELD1,PRINTABLE

You'll have to actually do the MP and AP in several stages, since it can
only do 15 digits at a time, and you'll have to handle 20 digits.

Cheat sheet:  Back in elementary school, you probably did stuff like:

       1234
      X  56
     ------
       7404
      6170.
     ------
      69104

Remember to keep track of the sign on the low 4 bytes.. ;)


                                  Valdis Kletnieks
                                  Computer Systems Engineer
                                  Virginia Polytechnic Institute
Technical Details
Message-ID: <9009252330.AA24101@ucbvax.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!VTVM1.CC.VT.EDU!VALDIS
References: <XMAS%BOGECNVE.BITNET@OHSTVMA.IRCC.OHIO-STATE.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!VTVM1.CC.VT.EDU!VALDIS
From: VALDIS@VTVM1.CC.VT.EDU (Valdis Kletnieks)
Newsgroups: comp.lang.asm370
Subject: Re: Writing double word binary numbers on screen
Message-ID: <9009252330.AA24101@ucbvax.Berkeley.EDU>
Date: 25 Sep 90 23:10:35 GMT
References: <XMAS%BOGECNVE.BITNET@OHSTVMA.IRCC.OHIO-STATE.EDU>
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: IBM 370 Assembly Programming Discussion List
              <ASM370@OHSTVMA.BITNET>
Distribution: inet
Organization: The Internet
Lines: 38