Delta DVP-ES2 User Manual
Page 535
3 . I n s t r u c t i o n S e t
3 - 4 1 9
API Mnemonic
Operands
Function
188
MBS P
Matrix bit shift
Controllers
ES2/EX2 SS2 SA2
SE
SX2
Bit Devices
Word devices
Program Steps
Type
OP
X Y
M S K H KnX KnY KnM KnS T C D E F
S
*
*
*
*
*
*
*
D
*
*
*
*
*
*
n
*
*
*
MBS, MBSP: 7 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2
Operands:
S: Matrix source device D: Operation result n: Matrix length (K1~K256)
Explanations:
1.
MBS instruction shifts the bits in the matrix to the left or the right. M1097 = OFF, bits shift to
the left, M1097 = ON, bits shift to the right. The empty bit (left shift: b0; right shift: b16n-1)
after every bit is shifted once will be filled with the value of M1096 (Borrow flag for matrix
operation). The bit which is shifted out of the matrix (left shift: b16n-1; right shift: b0) will be
sent to M1095 (Carry flag for matrix operation) and operation result is stored in D.
2.
The pulse execution instruction (MBSP) is generally adopted.
3. If
operands S or D use KnX, KnY, KnM, KnS format, only n = 4 is applicable
4. Associated
flags:
M1095: Carry flag for matrix rotation/shift/output
M1096: Borrow flag for matrix rotation/shift/input
M1097: Direction flag for matrix rotation/shift
Program Example 1:
When X0 = ON, M1097 = OFF, indicating a left matrix shift is performed. Assume matrix borrow
flag M1096 = OFF (0) and the 16-bit registers D0 ~ D2 will perform a left matrix shift and the result
will be stored in the matrix of the 16-bit registers D20 ~ D22, meanwhile the matrix carry flag
M1095 will be ON (1). .
X0
RST
MBSP
D0
D20
K3
M1097