3. Instruction Set Operands: S : Source of data D : Conversion result Explanations: 1. The content in S (BIN value) is converted into BCD value and stored in D 2. As a 16-bit (32-bit) instruction, when the conversion result exceeds the range of 0 ~ 9,999 (0 ~ 99,999,999), and M1067, M1068 = ON, D1067 will record the error code 0E18 (hex) 3. If operand S and D use index register F, only 16-bit instruction is available. 4. Flags: M1067 (Program execution error), M1068 (Execution error locked), D1067 (error code) Program example: 1.
When X0 = ON, the binary value of D10 will be converted into BCD value, and the 1s digit of the conversion result will be stored in K1Y0 (Y0 ~ Y3, the 4 bit devices). X0 2. If D10=001E (Hex) = 0030 (decimal), the result will be Y0~Y3 = 0000(BIN). 3-71 API Mnemonic Operands Function Controllers SA2 ES2/EX2 SS2 SX2 SE Controllers 18 D BCD P Convert BIN to BCD ES2/EX2 SS2 SA2 SX2 SE Type OP Bit Devices X Y M S Word devices Program Steps Y M S K H KnX KnY KnM KnS T C D E F BCD, BCDP: 5 steps DBCD, DBCDP: 9 steps S * * * * * * * * * D * * * * * * * * PULSE 16-bit 32-bit SA2 SX2 SS2 SA2 SA2 SX2 ES2/EX2 SS2 ES2/EX2 SX2 ES2/EX2 SS2 SE SE SE BCD D10 K1Y0