dtstdc

Test Data Class

dtstdc BF,FRA,DCM

Tests the data class of a DFP operand and sets the CR field.

Details

The dtstdc instruction tests the data class of the DFP operand in FRA[p] against the mask specified by DCM. The CR field BF and FPSCR FPCC are set to indicate the sign of the DFP operand and whether its data class matches any of the classes specified by DCM.

Pseudocode Operation

if 'dtstdc' then
    if (sign of FRA[p] is positive) and (data class of FRA[p] matches any bit in DCM) then
        BF <- 0010
    else if (sign of FRA[p] is positive) and (data class of FRA[p] does not match any bit in DCM) then
        BF <- 0000
    else if (sign of FRA[p] is negative) and (data class of FRA[p] matches any bit in DCM) then
        BF <- 1010
    else if (sign of FRA[p] is negative) and (data class of FRA[p] does not match any bit in DCM) then
        BF <- 1000

Programming Note

The dtstdc instruction is used to test the data class of a decimal floating-point operand against a specified mask. Ensure that the DFP operand is correctly aligned and that the DCM mask accurately reflects the desired data classes for testing. The instruction updates the CR field BF and FPSCR FPCC based on the sign and data class match, which can be used in conditional logic within your program.

Example

dtstdc cr0, f2, 0

Encoding

Binary Layout
0
0
BF
6
FRA
9
DCM
11
194
16
 
Format Z22-form
Opcode 0xEC000184
Extension Decimal Floating-Point
Registers Altered CR, FPSCR

Operands

  • BF
    Condition Register Field
  • FRA
    Floating-Point Register A
  • DCM
    Data Class Mask