Techniques for Converting From Binary to Packed-Decimal

If you are generating a binary result in a register and converting the result back to packed-decimal, you need to be keenly aware of the limitations of each of these data types. For large binary values, you will need some conversion techniques that aren’t found in Principles of Operation. This article discusses several approaches for converting double-precision binary back to packed-decimal.

2 Comments

Filed under IBM Mainframe Assembler

2 responses to “Techniques for Converting From Binary to Packed-Decimal

  1. John Dravnieks

    Hello David
    I just have a minor comment on the last example where you store r4 and then load it into the upper half of R5 with a ICMH.
    A while ago the hardware added ROTATE THEN INSERT SELECTED BITS HIGH which you might think what use is that? Well HLASM also added some useful extended mnemonics that use this opcode – in my version of the POP (SA22-7832-12) they are on page 7-372.
    so you could code this LHLR R5,R4 to load the low half of R4 directly in to the high half of R5.
    Kind regards
    John

Leave a Reply to dwoolbright Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.