denbcdq
Decimal Encode BCD Quad-Precision
Encodes 128-bit DFP to BCD.
Details
Encodes a 128-bit decimal floating-point number from vB into binary-coded decimal (BCD) format, storing the result in vD. The sign field S specifies how the sign is encoded. The instruction converts the DFP representation to BCD digits with appropriate sign handling. The instruction is part of the Decimal Floating-Point extension.
Pseudocode Operation
vD ← EncodeBCDDFP128(vB, S)
Programming Note
The denbcdq instruction is used to convert BCD values into DPD format, which is essential for handling high-precision decimal arithmetic. Ensure that the input data is correctly aligned and formatted as BCD before encoding. This instruction operates at user privilege level and may raise exceptions if the input data contains invalid BCD values.
Example
Encoding
Operands
-
vD
Target -
vB
Source -
S
Sign