Kaiyi — 6.2.2 Explanation of Arithmetic Instructions

Chapter 6 Applied Instructions 1 Execution result D1 D0 2 D11 D10 10 11 D101 D100 11 13 D2 3 + D12 12 D102 15 D3 D4 4 5 D13 D14 13 14 D103 D104 17 19 Example 2: When X0.0 is ON, the addend 10 is added to the binary values in D0~D4, and the sums are stored in D100~D104. Execution result D0 1 10 11 D100 D1 2 10 D101 12 D2 3 4 + 10 D102 14 13 D3 D4 5 10 10 D103 D104 15 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-62