1. List maximum value MAX/MAXD/MAXF
1. List maximum value MAX/MAXD/MAXF
1.1. Instruction Description
The maximum value of a single word list (MAX) is searched for in the list, the maximum value is returned in the (MAX) register, the first matching position and the total number of matches are returned in the (RES) register. The double character list lookup (MAXD) is for double characters, and the floating-point list lookup (MAXF) is for floating points. The index and quantity returned are always two single characters.
For example, MAX D10 D20 D120 K6, search for the maximum value from D10 to D15, store the search results in D20, and store the hit position and number of hits in D120 and D121.
图1 List maximum
1.2. The valid operands of the instruction
1.2.1. Maximum value of single word list(MAX)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| T | 16 bit integer | D | List |
| MAX | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | maximum |
| RES | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | result |
| N | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | length |
1.2.2. Maximum value of double words list(MAXD)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| T | 32-bit integer | D | List |
| MAX | 32-bit integer | D/CV, bit composite word (Y/M/C/T/S), local variable (LD) | maximum |
| RES | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | result |
| N | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | length |
1.2.3. Floating number list maximum value(MAXF)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| T | 32-bit Real Number | D | List |
| MAX | 32-bit real number | D, local variable (LF) | maximum |
| RES | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | result |
| N | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | length |
1.3. Example
command table:
NETWORK 000
LDP X000
MAX D10 D20 D120 K6 // Find the maximum value between D10 and D15, return the maximum value up to D20, hit position up to D120, and hit count up to D121.
图2 MAX