Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
19 Applied Instructions (Data Operation 2)
19.7 SORT2 / Sort Tabulated Data 2
514
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
2. 32-bit operation (DSORT2)
This instruction sorts the data rows of data table (sorting source) of (m1×m2) points from the device specified
by in the ascending order/descending order on the basis of group data of n rows, and stores in data
table (after sorting) of (m1×m2) points from the device specified by .
As for operation example, refer to 3. Operation examples.
The data table is composed of m1=K3, m2=K4 in the sorting source as explained in this case. In the data
table after sorting, exchange and .
1) Sorting is set depending on the ON/OFF state of M8165.
2) When using data register D or extension register R for m1, the data length is 32 bits. For example, when
m1 is specified by D0, m1 is 32-bit data of [D1, D0].
3) Data sorting is started when the instruction input is ON, and is completed after m1 scan, and instruction
execution complete flag M8029 is turned ON.
As for the manner of using the instruction execution complete flag, refer to section 1.3.4.
Number of groups m2 (in the case of m2=K4)
Column
number
1 2 3 4
Row
number
Management number Height Body weight Age
In the
case of
number of
data m1=3
1
[ +1, ] [ +3, +2] [ +5, +4] [ +7, +6]
2
[ +9, +8] [ +11, +10] [ +13, +12] [ +15, +14]
3
[ +17, +16] [ +19, +18] [ +21, +20] [ +23, +22]
Sorting order
M8165=ON Descending
M8165=OFF Ascending
DSORT2
EN
s
m1
ENO
d
m2
n
Command
input
Head device for storing data table
Number of data (rows)
Number of group data (columns)
Columns of group data (columns)
as reference for sorting
Head device for storing
operation result
Instruction execution complete flag
M8029
M