DVP-ES2/EX2/SS2/SA2/SX2/SE&TP Operation Manual - Programming API 168 Operands: S 1 : Source device 1 S 2 : Bits to be masked (OFF) D : D =( S 1 & S 2 ) | ( D & ~ S 2 ) Explanations: 1. The instruction conducts logical AND operation between S 1 and S 2 first, logical AND operation between D and ~ S 2 secondly, and combines the 1 st and 2 nd 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 results in D4 by logical OR operation.
H’FF00 first, logical AND operation between D4 and H’00FF secondly, and combines the 1 st and 2 nd X0 D4 b15 b0 b15 b15 b0 D4=H1234 Before the execution S 1 D0=HAA55 1 AND AND S 2 HFF00 0 H00FF HAA00 0 H0034 OR After the execution D D4=HAA34 Program Example 2 : Simplify instructions: X0 D110 X0 = D120 D120 3-422 Mnemonic Operands Function Controllers D MVM P Transfer Designated Bits ES2/EX2 SS2 SA2 SX2 SE Type OP Bit Devices Word devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F MVM, MVMP: 7 steps DMVM,DMVMP:
13 steps S 1 * * * * * * * * * S 2 * * * * * * * * * * * D * * * * * * * * * PULSE 16-bit 32-bit S SS2 A2 SA2 SA2 ES2/EX2 SX2 E S2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE MVM D 0 H F F 00 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 0 0 WAND HFF00 D110 MVM D 1 1 0 H F F 00 D120 WAND H00FF D120 WOR D100 D120