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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<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 />

168 D MVM P Transfer Designated Bits<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 1 * * * * * * * * *<br />

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

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

MVM, MVMP: 7 steps<br />

DMVM,DMVMP:<br />

13 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 />

Operands:<br />

S 1 : Source device 1 S 2 : Bits to be masked (OFF) D: D =( S 1 & S 2 ) | ( D & ~ S 2 )<br />

Explanations:<br />

1. The instruction conducts logical AND operation between S 1 and S 2 first, logical AND operation<br />

between D and ~S 2 secondly, and combines the 1 st and 2 nd results in D by logical OR<br />

operation.<br />

2. Rule of Logical AND operation: 0 AND 1 = 0, 1 AND 0 = 0, 0 AND 0 = 0, 1 AND 1 = 1<br />

3. Rule of Logical OR operation: 0 OR 1= 1, 1 OR 0 = 1, 0 OR 0 = 0, 1 OR 1 = 1.<br />

Program Example 1 :<br />

When X0 = ON, MVM instruction conducts logical AND operation between 16-bit register D0 and<br />

H’FF00 first, logical AND operation between D4 and H’00FF secondly, and combines the 1 st and 2 nd<br />

results in D4 by logical OR operation.<br />

X0<br />

MVM D0 HFF00 D4<br />

執 行 前<br />

b15<br />

b0<br />

D0=HAA55 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1<br />

AND<br />

HFF00 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0<br />

b15<br />

b0<br />

D4=H1234 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0<br />

AND<br />

H00FF 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1<br />

HAA00<br />

1 0 1 1 0 1 0 0 0 0 0 0 0 0 0<br />

H0034<br />

0 0 0 0 0 0 0 0 0 1 1 0 1 0 0<br />

執 行 後<br />

D4=HAA34<br />

OR<br />

1 0 1 1 0 1 0 0 0 1 1 0 1 0 0<br />

Program Example 2 :<br />

Simplify instructions:<br />

X0<br />

WAND<br />

X0<br />

HFF00 D110 D110 MVM<br />

=<br />

D110 HFF00 D120<br />

WAND H00FF D120 D120<br />

WOR D100 D120 D120<br />

3-386

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

Saved successfully!

Ooh no, something went wrong!