17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

147 D SWAP P Byte swap<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Type<br />

Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F<br />

S * * * * * * * *<br />

Operands:<br />

S: Device for byte swap.<br />

SWAP, SWAPP: 3 steps<br />

DSWAP, DSWAPP: 5<br />

steps<br />

PULSE 16-bit 32-bit<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE SE SE <strong>SX2</strong><br />

Explanations:<br />

1. For 16-bit instruction, high byte and low byte of the register will be swapped.<br />

2. For 32-bit instruction, byte swap is conducted on the 2 registers separately.<br />

3. This instruction adopts pulse execution instructions (SWAPP, DSWAPP)<br />

4. If operand D uses device F, only 16-bit instruction is available<br />

Program Example 1:<br />

When X0 = ON, high byte and low byte of D0 will be swapped.<br />

X0<br />

SWAPP<br />

D0<br />

D0<br />

High Byte Low Byte<br />

Program Example 2:<br />

When X0 = ON, high byte and low byte of D11 will be swapped as well as the high byte and low byte<br />

of D10.<br />

X0<br />

DSWAP D10<br />

D11<br />

High Byte Low Byte<br />

D10<br />

High Byte Low Byte<br />

3-328

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!