Chapter 6 Applied Instructions Symbol S : Matrix source D : Operation result n : Length of the array Explanation 1. This instruction shifts the values of the n rows of bits in S to the right or to the left. When SM616 is OFF, the 6_ instruction shifts the values of the bits to the left. When SM616 is ON, the instruction shifts the values of the bits to the right.
The instruction fills the vacancy (b0 when shifting to the left, and b16n-1 when shifting to the right) resulting from the shift with the state of the borrow flag SM615.The instruction transmits the value of the bit shifted last (from shifting to the left is b16n-1 and from shifting to the right is b0) to the carry flag SM614, and stores the operation result in D . 2. The operand n must be between 1–256. 3. In general, the MBSP pulse instruction is used. Example 1 When M0 is ON, SM616 is OFF. The instructions shifts the values of the bits to the left. Suppose SM615 is OFF.
After the instruction shifts the values of the bits in the 16-bit registers D0–D2 to the left, it stores the operation result in the 16-bit registers D20–D22, and SM614 is ON. 6-327 API Instruction code Operand Function 1109 MBS P S, D, n Shifting matrix bits Device X Y M S T C HC D FR SM SR E K 16# “$” F S D n BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S D n Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 -