Mitsubishi — 5.6 Application Instructions

5 Categories and Use of Basic Application Instructions Operands: S : Device for byte swap. Explanations: 1. For 16-bit instruction, high byte and low byte of the register will be swapped. 2. For 32-bit instruction, byte swap is conducted on the 2 registers separately. 3. When SWAP is used as 16-bit instruction, Z device cannot be adopted; when SWAP is used as 32-bit instruction, V device cannot be adopted. 4. When specifying the bit device of KnX(Y/M/S), the starting No. should be a multiple of 16 in octal or decimal 5. This instruction adopts pulse execution instructions (SWAPP, DSWAPP) format. For example, K1X0, K4Y20 (octal); K1M0, K4S16 (decimal). Program Example 1:

When X0 = ON, high byte and low byte of D0 will be swapped. X0 D0 Program Example 2: When X0 = ON, high byte and low byte of D11 will be swapped as well as the high byte and low byte of D10. X0 D11 D 0 1 DVP-PM Operation Instruction 5-132 API Mnemonic Operands Function Controllers 20PM 10PM 147 D SWAP P Byte swap Typ OP e Bit Devices X Y M S Word devices Program Steps Y M S K H KnX KnY KnM KnS T C D V Z SWAP, SWAPP: 3 steps DSWAP, DSWAPP: 5 steps S * * * * * * * * * SWAPP D0 High Byte Low Byte DSWAP D10 High Byte Low Byte High Byte Low Byte