Chapter 5 Applied Instructions S 1 : Multiplicand; S 2 : Multiplier; D : Product S 1 and S 2 can be floating-point values. S 1 and S 2 can be floating-point values, or data registers in which floating-point values are stored. If S 1 and S 2 are data registers in which floating-point values are stored, the function of API 172 DMULR is the same as the function of API 122 DEMUL. The floating-point value in S 1 is multiplied by the floating-point value in S 2 , and the product is stored in D . S 1 and S 2 can be the same register.
If the instruction DSUBR is used under the circumstances, the value in the register is multiplied by itself whenever the conditional contact is ON in a scan cycle. Generally, the pulse instruction DMULRP is used. If the absolute value of an oepration result is greater than the maximum floating-point value available, a carry flag will be ON. If the absolute value of an oepration reuslt is less than the minimum floating-point value available, a borrow flag will be ON. If an operation result is 0, a zero flag will be ON. SM1064 is the zero flag in an Ox motion subroutine, and SM968 is the zero flag in O100.
SM1065 is the borrow flag in an Ox motion subroutine, and SM969 is the borrow flag in O100. SM1066 is the carry flag in an Ox motion subroutine, and SM970 is the carry flag in O100. Explanation When X0.0 is ON, the floating-point value F1.23456 is multiplied by the floating-point value F1.0, and the product F1.23456 is stored in (D11, D10). Example 1 X0.0 Example 2 When X0.0 is ON, the floating-point value in (D1, D0) is multiplied by the floating-point value in (D11, D10), and the product is stored in (D21, D20).
5-107 API Instruction code Operand Function Floating-point 174 D MULR P S , S , D 1 2 multiplication Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1 S 2 D Pulse instruction 16-bit instruction 32-bit instruction (9 steps) – .0 DMULR F1.23456 F1.0 D10 0.1 DMULR D0 D10 D20