(171)
EMBC #0003
0000
00
(164)
SRCH #0010 D00000 0500
0000
00
365
Example When CIO 000000 is ON in the following example, the current EM bank is
changed to bank 3. The contents of A511 would change to “8003” to indicate that
bank 3 is the current bank.
Address Instruction Operands
00000 LD 000000
00001 EMBC(171)
#0003
5-27-7 DATA SEARCH: SRCH(164)
Variations
j SRCH(164)
(164)
SRCH N R
1
Cd
R
1
: 1
st
word in range CIO, G, A, T, C, DM
Cd: Comparison data CIO, G, A, T, C, #, DM, DR, IR
N: Number of words CIO, G, A, T, C, #, DM, DR, IR
Operand Data AreasLadder Symbol
When the execution condition is OFF, SRCH(164) is not executed. When the ex-
ecution condition is ON, SRCH(164) searches the range of memory from R
1
to
R
1
+N–1 for addresses that contain the comparison data (Cd).
If the content of an address within the range match the comparison data, the EQ
Flag (A50006) is turned ON and the address is written to index register IR0. If
more than one address contains the comparison data, the EQ Flag (A50006) is
turned ON and only the lowest address containing the comparison data is writ-
ten to IR0.
If none of the addresses within the range contain the comparison data, the EQ
Flag (A50006) is turned OFF, and IR0 is left unchanged.
N must be BCD between 0001 and 9999.
R
1
and R
1
+N–1 must be in the same data area.
Note Refer to page 115 for general precautions on operand data areas.
Flags ER (A50003): N is 0000 or is not BCD.
Content of *DM word is not BCD when set for BCD.
EQ (A50006): An address within the range contains the comparison data.
Example In the following example, the 10-word range from D00000 to D00009 is
searched for addresses that contain the same data as CIO 0500. Since two ad-
dresses within the range contain the same data as CIO 0500, the EQ Flag
(A50006) is turned ON, and the lowest address containing the comparison data
is written to IR0.
Address Instruction Operands
00000 LD 000000
00001 SRCH(164)
#0010
D00000
0500
Description
Precautions
Special Instructions Section 5-27