588
Table Data Processing Instructions Section 3-16
Description SWAP(637) switches the position of the two bytes in all of the words in the
range of memory from R1 to R1+N–1. This instruction can be used to reverse
the order of ASCII-code characters in each word.
Flags
Examples When CIO 0.00 is ON in the following example, SWAP(637) switches the data
in the leftmost bytes with the data in the rightmost bytes in each word in the
10-word range from W0 to W9.
3-16-10 FIND MAXIMUM: MAX(182)
Purpose Finds the maximum value in the range.
Ladder Symbol
Variations
Applicable Program Areas
N
R1
Byte position is swapped.
Name Label Operation
Error Flag ER ON if the N is 0000.
ON if the Communications Port Enabled Flag for the com-
munications port number specified as the Com Port num-
ber for Background Execution is OFF when background
processing is specified (CP1H only).
OFF in all other cases.
&10
N
R1
0.00
W0
W0
W1
W2
W9
W0
W1
W2
W9
to to to to
MAX(182)
C
R1
D
C: First control word
R1: First word in range
D: Destination word
Variations Executed Each Cycle for ON Condition MAX(182)
Executed Once for Upward Differentiation @MAX(182)
Executed Once for Downward Differentiation Not supported.
Immediate Refreshing Specification Not supported.
Block program areas Step program areas Subroutines Interrupt tasks
OK OK OK OK