3. Instruction

Set

API

Mnemonic

 

Operands

 

 

 

Function

 

 

 

 

Controllers

 

17

D

XCH

 

P

 

 

 

 

Exchange

 

 

 

 

 

ES2/EX2 SS2

SA2

SX2

 

 

 

 

 

 

 

 

 

 

SE

 

Type

Bit Devices

 

 

 

 

Word devices

 

 

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F

XCH, XCHP: 5 steps

 

 

D1

 

 

 

 

 

 

 

*

 

*

*

*

*

*

*

*

DXCH, DXCHP: 9 steps

 

D2

 

 

 

 

 

 

 

*

 

*

*

*

*

*

*

*

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

16-bit

 

 

 

32-bit

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2 SS2

SA2

SX2

 

 

 

 

 

 

SE

SE

SE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Operands:

D1: Device to be exchanged 1

D2: Device to be exchanged 2

Explanations:

1.The contents in the devices designated by D1 and D2 will exchange

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

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

Program example:

When X0=OFFON, the contents of D20 and D40 exchange with each other.

X0

XCHP D20 D40

BeforeAfter

execution execution

D20

120

40

D20

D40

40

120

D40

Points to note:

1.As a 16-bit instruction, when the devices designated by D1 and D2 are the same and M1303

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

2.As a 32-bit instruction, when the devices designated by D1 and D2 are the same and M1303

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

3.When X0 = ON and M1303 = ON, 16-bit contents in D100 and those in D101 will exchange with each other.

 

X0

 

 

 

Before

After

 

 

 

 

 

execution

execution

 

 

 

 

 

M1303

 

 

D100L

9

8

D100L

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DXCHP

D100

D100

D100H

20

40

D100H

 

 

 

 

 

 

 

 

 

 

 

 

 

D101L

8

9

D101L

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D101H

40

20

D101H

3 - 7 1

Page 187
Image 187
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Mnemonic Operands Function Controllers, Xch