Chapter 6 Applied Instructions 5. 32-bit binary division: Quotient S 1 S 2 S 1 S 2 +1 D+1 D +1 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 / = D occupies two consecutive devices. The quotient is stored in ( D +1, D ). Example When M0 is ON, the instruction divides the dividend in D0 by the divisor in D10, and stores the quotient D20. Whether the quotient is a positive value or a negative value depends on the leftmost bit in D20. Additional remarks 1. If the device is not available, the instruction is not executed, SM0 will be ON, and the error code stored in SR0 is 6_ 16#2003. 2.
If the divisor is 0, the instruction is not executed, SM0 will be ON, and the error code stored in SR0 is 16#2012. 3. If you want to store the remainder, use the “/” instruction (Dividing binary values). Refer to the explanation for the “/” instruction (API 0103) for more information. 6-77