Special Math Instructions; Find Maximum -- Max - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Flags

7-22 Special Math Instructions

7-22-1 FIND MAXIMUM - - MAX(- - - -)
MAX(----)
C
R
1
D
Limitations
Description
1, 2, 3...
ER:
Dr contains 0.
Indirectly addressed DM word is non-existent. (Content of
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is 0.
Ladder Symbols
@MAX(----)
C
R
1
D
This instruction is available in the CPM2A/CPM2C only.
N must be BCD between 0001 to 9999.
R
and R
+N--1 must be in the same data area.
1
1
DM 6144 to DM 6655 cannot be used for D.
When the execution condition is OFF, MAX(----) is not executed. When the
execution condition is ON, MAX(----) searches the range of memory from R
R
+N--1 for the address that contains the maximum value and outputs the maxi-
1
mum value to the destination word (D).
The address is identified differently for the DM area:
1. For an address in the DM area, the word address is written to C+1. For ex-
ample, if the address containing the maximum value is DM 0114, then #0114
is written in D+1.
2. For an address in another data area, the number of addresses from the be-
ginning of the search is written to D+1. For example, if the address contain-
ing the maximum value is IR 114 and the first word in the search range is
IR 014, then #0100 is written in D+1.
If bit 14 of C is ON and more than one address contains the same maximum val-
ue, the position of the lowest of the addresses will be output to D+1. The position
will be output as the DM address for the DM area, but as an absolute position
relative to the first word in the range for all other areas.
The number of words within the range (N) is contained in the 3 rightmost digits of
C, which must be BCD between 001 and 999.
When bit 15 of C is OFF, data within the range is treated as unsigned binary and
when it is ON the data is treated as signed binary.
15
14
13
C:
Not used -- set to zero.
IR, SR, AR, DM, HR, TC, LR, #
IR, SR, AR, DM, HR, TC, LR
IR, SR, AR, DM, HR, LR
12
11
Output address to D+1?
1 (ON):
0 (OFF): No.
Section

DM word is
Operand Data Areas
C: Control data
R
: First word in range
1
D: Destination word
00
Number of words
in range (N: 001 to 999 BCD)
Not used -- set to zero.
Yes.
7-22
to
1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Srm-v2Cpm1aCpm2aSrm1Cpm2c

Table of Contents