DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

API

168

Mnemonic

Operands

Function

Controllers

D

MVM

P

Transfer Designated Bits

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

 

MVM, MVMP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

 

 

*

*

 

*

 

*

 

*

*

*

*

 

*

 

DMVM,DMVMP:

 

 

S2

 

 

 

 

*

*

*

*

 

*

 

*

 

*

*

*

*

*

 

 

 

 

 

 

 

 

 

 

 

13 steps

 

 

D

 

 

 

 

 

 

*

*

 

*

 

*

 

*

*

*

*

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

16-bit

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

SE

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1: Source device 1 S2: Bits to be masked (OFF)

D: D =( S1 & S2) ( D & ~ S2)

 

 

Explanations:

1.The instruction conducts logical AND operation between S1 and S2 first, logical AND operation between D and ~S2 secondly, and combines the 1st and 2nd results in D by logical OR operation.

2.Rule of Logical AND operation: 0 AND 1 = 0, 1 AND 0 = 0, 0 AND 0 = 0, 1 AND 1 = 1

3.Rule of Logical OR operation: 0 OR 1= 1, 1 OR 0 = 1, 0 OR 0 = 0, 1 OR 1 = 1.

Program Example 1 :

When X0 = ON, MVM instruction conducts logical AND operation between 16-bit register D0 and H’FF00 first, logical AND operation between D4 and H’00FF secondly, and combines the 1st and 2nd results in D4 by logical OR operation.

X0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MVM

 

 

D0

 

 

HFF00

 

 

D4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

b15

 

 

 

 

 

 

 

 

 

 

 

 

 

b0

b15

 

 

 

 

 

 

 

 

 

 

 

 

 

b0

D0=HAA55 1

 

1

0

1

0

1

0

0

1

0

1

0

1

0

1

D4=H1234 0

 

0

1

0

0

1

0

0

0

1

1

0

1

0

0

執行前

 

 

 

 

 

 

AND

 

 

 

 

 

 

 

 

 

 

 

 

 

AND

 

 

 

 

 

 

 

HFF00 1 1

1

1

1

1

1

1

0

0 0

0

0

0

0

0

H00FF 0 0

0

0

0

0 0

0

1

1 1

1

1

1

1

1

HAA00 1

0

1

 

1

0

1

0

0

0

0

0

0

0

0

0

H0034 0

0

0

 

0

0

0

0

0

0

1

1

0

1

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

執行後

 

 

D4=HAA34

 

1

0 1

 

1

0 1

0 0 0 1 1 0 1 0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

Program Example 2 :

Simplify instructions:

X0

X0

WAND HFF00 D110 D110 = MVM D110 HFF00 D120

WAND H00FF D120 D120

WOR D100 D120 D120

3 - 386

Page 502
Image 502
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Mvm, Dmvm,Dmvmp