Chapter 6 Applied Instructions API 1205 Symbol: S : Initial device in which the original data is stored Word/Double word m 1 : Number of rows of data Word/Double word m 2 : Number of columns of data Word/Double word D : Initial device in which the sorted data is stored Word/Double word n : Reference value involved in the sorting of the data Word/Double word Explanation: 1. The data which is sorted is stored in the m1Чm2 registers starting from the register specified by D . If S and D specify the same register, the sorted data is the same as the original data in the register specified by S . 2. The operand m 1 should be within the range between 1 and 32.
The operand m 2 should be within the range between 1 and 6. The operand n should be within the range between 1 and m 2 . 3. It is better that the rightmost number of the device number of the register specified by S is 0 4. If the value in n is altered during the execution of the instruction, the data is sorted according to the new value. 5. When SM604 is OFF, the data is sorted in ascending order. When SM604 is ON, the data is sorted in descending order. 6. To prevent the data from being sorted repeatedly, it is suggested that users use the pulse instruction. 7. Only the 32-bit instruction can use the 32-bit counter. Example: 1. Suppose SM604 is OFF.
When X0.0 is switched from OFF to ON, the data is sorted in ascending order. When the sorting of the data is complete, SM603 is ON. 6-256 Instruction code Operand Function D SORT S, m , m , D, n 1 2 Sorting the data Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S m 1 m 2 D n Pulse instruction 16-bit instruction (11 steps) 32-bit instruction (11 steps) - AH AH