Ch a pt er 6 Ap p l i ed I ns t ruc t i ons6 - 2 3 56.12.2 Explanation of Shift InstructionsAPI Instruction code Operand Function1100 SFTR P S, D, n 1 , n 2Shifting the states of thedevices to the rightDevice X Y M S T C HC D L SM SR E PR K 16# “$” DFS D n1 n2 Pulse instruction 16-bit instruction (9 steps) 32-bit instructionAH500 AH500 -Symbol:S : Initial device in which the value is shifted BitD : Initial device in which the value is shifted Bitn 1 : Length of the data which is shifted Wordn 2 : Number of bits forming a group WordExplanation:1. The states of the n 1 bit devices starting from D are divided into groups (n 2 bits as a group), andthese groups are shifted to the right. The states of the n 2 bit devices starting from S are shiftedto the devices starting from D to fill the vacancy.2. Generally, the pulse instruction SFTRP is used.3. The operand n 1 should be within the range between 1 and 1024. The operand n 2 should bewithin the range between 1 and n 1.Example 1:1. When X0.0 is switched from OFF to ON, the states of the sixteen bit devices starting from M0are divided into groups (four bits as a group), and these groups are shifted to the right.2. The shift of the states of the bit devices to the right during a scan is illustrated as follows. M3~M0 → Being carried M7~M4 → M3~M0 M11~M8 → M7~M4 M15~M12 → M11~M8 X0.3~X0.0 → M15~M12