MIN
MIN, MINP, DMIN, DMINP
MIN instruction searches the minimum value from the source and saves the minimum value, the position number of the minimum value, and the total number of the minimum value to the Destination (assigned device address).
DMIN and DMINP are double words.
| |
S | Source |
D | Destination |
n | Number of data block to search |
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. |
| Error | Zero | Carry | ||
MIN MINP DMINX DMINP | S | o | o | o | o | o | o | o | o | - | o | o | o | - | 4 | o | - | - |
D | o | - | o | o | o | - | o | o | - | o | o | o | - | |||||
n | o | o | o | o | o | o | o | o | - | o | o | o | - |
MIN
MIN(P) searches the minimum value from the 16 bit data source and saves the minimum value (-5421) to D, the position number of the minimum value 2 (S+1, 2nd block from S) to D+1, and the total number of the minimum value (2) to D+2.
Example)
If X01 is ON, MIN instruction searches minimum values from D10 to D13 (4 blocks) and saves the minimum value 1324 to D200, the position number 4 (D13, 4th block from D10) where the minimum number is located to D201, and the total number of the minimum value 1 to D202.
DMIN
DMIN(P) searches the minimum value from the 32 bit data source and saves the minimum value (12638463) to D and D+1, the position number of the minimum value 2 (S+2 and S+3, 2nd block from S) to D+2, and the total number of the minimum value (1) to D+3.
Example)
If X01 is ON, DMIN instruction searches minimum values from D0 to D7 (4 blocks) and saves the minimum value -12332432 to D100 and D101, the position number 2 (D2and D3, 2nd block from D0) where the minimum number is located to D102, and the total number of the minimum value 1 to D103.