Kaiyi — 6.9.2 Explanation of Logic Instructions

AH500 Programming Manual Symbol: S 1 : Matrix source 1 Word S 2 : Matrix source 2 Word D : Operation result Word n : Length of the array Word Explanation: 1. The operator XOR takes the n rows of binary representations in S 1 and the n rows of binary representations in of S 2 , and performs the matrix exclusive OR operation on each pair of corresponding bits. The operation result is stored in D . 2. The result in each position is 1 if the two bits are different, and 0 if they are the same. 3. The operand n should be within the range between 1 and 256. Example:

When X0.0 is ON, the operator XOR takes the data in the 16-bit devices Y0~Y2 and the data in 16-bit devices Y10~Y12, and performs the matrix exclusive OR operation on each pair of corresponding bits. The operation result is stored in the 16-bit devices Y20~Y22. After the instruction is executed Before the instruction is executed Additional remark: 1.

If S 1 +n-1 , S 2 +n-1 , or D+n-1 exceeds the device range, the instruction is not executed, SM0 is 6-189 API Instruction code Operand Function 0805 MXOR P S , S , D, n 1 2 Matrix exclusive OR operation Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1          S 2          D         n            Pulse instruction 16-bit instruction (9 steps) 32-bit instruction AH AH - S1 b15 b0 Y0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Y1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Y2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 S2 b15 MXOR b0 Y100 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 Y11 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 Y120 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 0 0 0 1 0 0 1 1 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D b15 b0 Y200 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 Y210 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 Y220 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0