Kaiyi — 6.2.2 Explanation of Arithmetic Instructions

Chapter 6 Applied Instructions Execution result D1 D0 1 SM600 D2 D3 D4 Example 2: When X0.0 is ON, the subtrahend 1 is subtracted from the binary values in D0~D4, and the differences are stored in D100~D104. D0 10 1 D100 Execution result 9 D1 9 1 D101 8 D2 D3 7 8 - 1 1 D102 D103 6 7 D4 6 1 D104 5 Additional remark: 1. If the devices S 1 ~ S 1 +n -1, S 2 ~ S 2 +n -1, or D ~ D+n -1 exceed the device range, the instruction is not executed, SM is ON, and the error code in SR0 is 16#2003. 2. If n n >256, the instruction is not executed, SM0 is ON,and the error code in SR0 is 16#200B. 3.

If S 1 ~ S 1 +n -1 overlap D ~ D+n -1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200C. 4. If S 2 ~ S 2 +n -1 overlap D ~ D+n -1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200C. 5. If S 1 ~ S 1 +n -1 overlap S 2 ~ S 2 +n -1, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200C. 6-64 5 D10 D11 - D12 D13 D14 1 D100 D101 D102 D103 D104 4 4 2 2 3 3 0 2 4 - 2 1 5 - 4