Delta AH500 — 6.12.2 Explanation of Shift Instructions

AH500 Programming Manual Symbol: S : Initial device Word D : Device in which the data is shifted Word n : Data length Word Explanation: 1. The data in the n word devices starting from the device specified by S is defined as a first in, first out data type, and the device specified by S is taken as a pointer. When the instruction is executed, the value in the device specified by S decreases by one, the data in the device specified by S + 1 is written into the device specified by D , the data in the devices specified by S + n -1~ S +2 is shifted to the right, and the data in the device specified by S + n -1 is unchanged.

When the value in the device specified by S is equal to 0, the instruction does not process the reading of the data, and the zero flag SM600 is ON. 2. Generally, the pulse instruction SFRDP is used. 3. The operand n should be within the range between 2 and 512. Example: 1. When X0.0 is switched from OFF to ON, the data in D21 is written into D0, the data in D29~D22 is shifted to the right, the data in D29 is unchanged, and the value in D20 decreases by one. 2. The data in the word device is shifted and read in the following way.  The data in D21 is read and shifted to D0.  The data in D29~D22 is shifted to the right.  The value in D20 decreases by one. The data is read.

6-246 API Instruction code Operand Function 1105 SFRD P S, D, n Shifting the data and reading it from the word device Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S         D          n         Pulse instruction 16-bit instruction (7 steps) 32-bit instruction AH500 AH500 - n=10 D0 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20 Pointe D0 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20 Pointe