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.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

17 D XCH P Exchange<br />

Controllers<br />

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

SE<br />

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

Type Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F XCH, XCHP: 5 steps<br />

D 1 * * * * * * * * DXCH, DXCHP: 9 steps<br />

D 2 * * * * * * * *<br />

PULSE 16-bit 32-bit<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<br />

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

SE<br />

Operands:<br />

D 1 : Device to be exchanged 1 D 2 : Device to be exchanged 2<br />

Explanations:<br />

1. The contents in the devices designated by D 1 and D 2 will exchange<br />

2. It is better to apply a pulse execution for this instruction (XCHP).<br />

3. If operand D1 and D2 use index register F, only 16-bit instruction is available.<br />

Program example:<br />

When X0=OFF→ON, the contents of D20 and D40 exchange with each other.<br />

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

SE<br />

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

X0<br />

XCHP<br />

D20<br />

D40<br />

Before<br />

execution<br />

D20 120<br />

After<br />

execution<br />

40 D20<br />

D40<br />

40<br />

120<br />

D40<br />

Points to note:<br />

1. As a 16-bit instruction, when the devices designated by D 1 and D 2 are the same and M1303<br />

= ON, the upper and lower 8 bits of the designated devices exchange with each other.<br />

2. As a 32-bit instruction, when the devices designated by D 1 and D 2 are the same and M1303<br />

= ON, the upper and lower 16 bits in the designated device exchange with each other.<br />

3. When X0 = ON and M1303 = ON, 16-bit contents in D100 and those in D101 will exchange<br />

with each other.<br />

X0<br />

M1303<br />

D100L<br />

Before<br />

execution<br />

9<br />

After<br />

execution<br />

8<br />

D100L<br />

DXCHP D100 D100<br />

D100H<br />

20<br />

40<br />

D100H<br />

D101L<br />

8<br />

9<br />

D101L<br />

D101H<br />

40<br />

20<br />

D101H<br />

3-71

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

Saved successfully!

Ooh no, something went wrong!