Why not use "ED" with a 24-byte mask : (example with lengths on field names to 
make things clear)

        LG      GR1,WA_BINARY_8
        CVDG    GR1,WA_PACKED_16
        MVC     WA_ANSWER_24,LC_MASK_24
        ED      WA_ANSWER_24,WA_PACKED_12

LC_MASK_24      DC      X'40',22X'20',X'21'


WA_ANSWER_24    DS      CL24
WA_PACKED_16    DS      0PL16
WA_PACKED_HI    DS      XL4
WA_PACKED_12    DS      XL12
WA_BINARY_8             DS      FL8

Rob Scott
Lead Developer
Rocket Software
77 Fourth Avenue . Suite 100 . Waltham . MA 02451-1468 . USA
Tel: +1.781.684.2305
Email: rsc...@rs.com
Web: www.rocketsoftware.com


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Donald Likens
Sent: 20 March 2013 09:03
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Convert 64 bit to decimal in Assembler

Has anyone come up with a better way to convert a 64 bit binary number to 
decimal then the way I did it?

Here is what I did:

        LG    R1,WKCELLD                                        
        CVDG  R1,LONG                                           
       * UNPK  0(11,R7),LONG(6)   FIRST 6 BYTES ARE ALWAYS ZERO  
        UNPK  0(11,R7),LONG+5(6)                                
        UNPK  10(11,R7),LONG+10(6)                              
        OI    20(R7),X'F0'                                      
                                             

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to