denbcd

Decimal Encode BCD

denbcd FRT, FRB, S

Encodes a DFP number into BCD format.

Details

The denbcd instruction encodes a Binary-Coded Decimal (BCD) value into a Data-Packed Decimal (DPD) format. It takes two operands, FRT and FRB, where FRT is the target register to store the result and FRB contains the BCD value to be encoded.

Pseudocode Operation

FRT ← EncodeBCDtoDPD(FRB)

Programming Note

The denbcd instruction is used to convert a Binary-Coded Decimal (BCD) value into Data-Packed Decimal (DPD) format. Ensure that the input BCD value in FRB is correctly formatted and aligned as required by the instruction. This operation does not raise exceptions for valid inputs but may require careful handling of special cases like overflow or invalid data.

Example

denbcd f1, f3, 0

Encoding

Binary Layout
59
0
FRT
6
S
11
FRB
16
834
21
/
31
 
Format X-form
Opcode 0xEC000684
Extension Decimal Floating-Point
Registers Altered FPSCR

Operands

  • FRT
    Target
  • FRB
    Source
  • S
    Sign Control