Kaiyi — 6.13.2 Explanation of Data Processing Instructions

AH500 Programming Manual Symbol: S : Data source Word/Double word n : Data length Word/Double word D : Operation result Double word/Long word Explanation: 1. The signed decimal values in S ~ S + n -1 are added up, and the sum is stored in the register specified by D . S +1 S +2 S Binary values +3 S +5 S +4 S S +1 S Binary values 2. The operand n used in the 16-bit instruction should be within the range between 1 and 256, and the operand n used in the 32-bit instruction should be within the range between 1 and 128. 3. Only the 32-bit instructions can use the 32-bit counter. Example: When the instruction WSUM is executed, the values in D0~D2 are added up, and the sum is stored in D10.

6-279 API Instruction code Operand Function 1217 D WSUM P S, n, D Getting the sum Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S          n             D          Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (7 steps) AH AH AH D +1 D n Binary value D +1 D n D +3 D+2 Binary value S+3 S+2 S+5 S+4 S+7 S+6 S+9 S+8