Chapter 6 Applied Instructions API 0308 Symbol: S : Data source Word/Double word Explanation: 1. When the 16-bit instruction is executed, the data in the low byte in S is exchanged with the data in the high byte in S . 2. When the 32-bit instruction is executed, the data in the low byte of the high word in S is exchanged with the data in the high byte of the high word in S , and the data in the low byte of the low word in S is exchanged with the data in the high byte of the low word in S . 3. Only the 32-bit instructions can use the 32-bit counter. Example 1: When X0.0 is ON, the data in the low byte in D0 is exchanged with the data in the high byte in D0. D0 High byte Low byte Example 2:
When X0.0 is ON, the data in the low byte in D11 is exchanged with the data in the high byte in D11, and the data in the low byte in D10 is exchanged with the data in the high byte in D10. D11 D10 6-129 Instruction code Operand Function D SWAP P S Exchange the high byte with the low byte Device X Y M S T C HC D L SM S R E P R K 16# “$” DF S Pulse instruction 16-bit instruction (3 steps) 32-bit instruction (3 steps) AH500 AH500 AH500 High byte Low by High byte