AH500 Programming Manual
6-224
API Instruction code Operand
Function
0904 MBR P
S, D, n
Rotating the matrix bits
Device
X Y M S T C HC D L SM SR E PR K 16#
“$” DF
16-bit instruction (7 steps)
Symbol:
S
:
Matrix source Word
D
:
Operation result Word
n
:
Length of the array Word
Explanation:
1. The values of the n rows of bits in S are rotated to the right or to the left. When SM616 is OFF,
the values of the bits are rotated to the left. When SM616 is ON, the values of the bits are
rotated to the right. The vacancy resulting from the rotation is filled by the value of the bit
rotated last, and the operation result is stored in D. The value of the bit rotated last not only fills
the vacancy, but also is transmitted to the carry flag SM614.
2. The operand n should be within the range between 1 and 256.
3. Generally, the pulse instruction MBRP is used.
Example 1:
When X0.0 is ON, SM616 is OFF. The values of the bits in the 16-bit registers D0~D2 are rotated to
the left, and the operation result is stored in the 16-bit registers D20~D22. The value of the bit
marked ※ is transmitted to the carry flag SM614.