5 Categories and Use of Basic Application Instructions API 49 Operands: S : Source device D : Device for storing the conversion result Explanations: 1. Only 32-bit instructions DFLT and DFLTP are applicable 2. FLT instruction converts BIN integer in S into binary floating point value in D 3. Flags: d) If the absolute value of the converstion result > max. floating point value, carry flag will be ON. e) If the absolute value of the conversion result f) If the conversion result is “0”, zero flag will be ON. Program Example 1: 1. When X11 = ON, D1 and D0 (BIN integers) are converted into D21 and D20 (binary floating point values). 2. Assume 32-bit register D0 (D1) = K100,000.
When X11 = ON, the the converted 32-bit floating point value will be H’4735000 and stored in the 32-bit register D20 (D21). X11 Program Example 2: Apply FLT instruction to complete the following operation: (D21,D20) binary floating point 6 7 (D31,D30) decimal floating point (for monitoring) 8 (D41,D40) 32-bit integer (D401,D400) binary floating point DVP-PM Operation Instruction 5-70 Mnemonic Operands Function Controllers 20PM 10PM D FLT P Floating Point Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D V Z DFLT, DFLTP:
6 steps S * * * D * OX O100 Zero flag M1808 M1968 Borrow flag M1809 M1969 Carry flag M1810 M1970 DFLT D0 D20 K61.5 (D11,D10) (X7~X0) 32-bit BIN 2-digit BCD 1 2 5 D100) (D201,D200) BIN ting point 3 (D203,D202) binary floating point