Chapter 6 Applied Instructions API 0307 Symbol: S 1 : Data which will be exchanged Word/Double word S 2 : Data which will be exchanged Word/Double word n : Data length Word/Double word Explanation: 1. The data in the devices specified by S 1 ~ S 1 + n -1 is exchnaged with the data in the devices specified by S 2 ~ S 2 + n -1. 2. The operand n used in the instruction should be within the range between 1 and 256. S1 S1 +1 S1 +2 .... S1 +n-1 S2 S2 +1 S2 +2 .... S2 +n-1 S1 S1 +1 S1 +2 .... S1 +n-1 S2 S2 +1 S2 +2 .... S2 +n-1 Example: When X0.0 is ON, the data in D10~D14 is exchanged with the data in D100~D104.
D10 D11 D12 D13 D14 D100 D101 D102 D103 D104 After the instruction is executed D10 D11 D12 D13 D14 D100 D101 D102 D103 D104 6-127 Instruction code Operand Function BXCH P S , S , n 1 2 Exchanging all data Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 n Pulse instruction 16-bit instruction (7 steps) 32-bit instruction AH500 AH500 - 1 2 3 4 5 16 17 18 19 20 16 17 18 19 20 1 2 3 4 5