Chapter 6 Applied Instructions API 1112 Symbol: D : Initial device involve in the shift Bit n : Data length Word 1. The states of the n bit devices starting from D are shifted by one bit to the right. The state of D + n -1 is cleared to 0, and the state of D is transmitted to the carry flag SM602. 2. Generally, the pulse instruction BSFRP is used. 3. The operand n should be within the range between 1 and 1024. Explanation: Example: When X0.0 is ON, the states of M0~M5 are shifted by one bit to the right, the state of M5 is cleared to 0, and the state of M0 is transmitted to the carry flag SM602.
M0 M1 M2 M3 M4 M5 Carry flag After the shift Carry flag M0 M1 M2 M3 M4 M5 1 Being cleared to 0 Additional remark: 1. If D + n -1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 2. If n is less than 1, or if n is larger than 1024, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B. 6-257 Instruction code Operand Function BSFR P D, n Shifting the states of the n bit devices by one bit to the right Device X Y M S T C HC D L SM SR E PR K 16# “$” DF D n Pulse instruction 16-bit instruction (5 steps) 32-bit instruction AH500 AH500 - 0 0 0 1 0 1 0 0 0 0 1 0