Chapter 6 Applied Instructions Symbol: D : Device which is rotated Word/Double word n : Number of bits forming a group Word/Double word Explanation: 1. The values of the bits in the device specified by D are divided into groups ( n bits as a group), and these groups are rotated to the left. 2. Only the 32-bit instructions can use the 32-bit counter. 3. The operand n used in the 16-bit instruction should be within the range between 1 and 16. The operand n used in the 32-bit instruction should be within the range between 1 and 32. 4. Generally, the pulse instructions ROLP and DROLP are used. Example:
When X0.0 is switched from OFF to ON, the values of the bits in D10 are divided into groups (four bits as a group), and these groups are rotated to the left. (The value of the bit marked ※ is transmitted to the carry flag SM602.) Carry flag b0 b15 ※ After the rotation is executed Carry flag 1 b0 b15 6-221 API Instruction code Operand Function 0902 D ROL P D, n Rotating to the left 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 (5 steps) AH500 AH500 AH500 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1