The Punctilious Programmer IBM Mainframe Assembler Techniques for Converting From Binary to Packed-Decimal

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 thoughts on “Techniques for Converting From Binary to Packed-Decimal”

  1. 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

Leave a Reply