4

Example 1:

The array AR is defined as memory addresses %R0001 — %R0005. When EN is ON, the portion of the array between %R0004 and %R0005 is searched for an element whose value is equal to IN. If %R0001 = 7, %R0002 = 9, %R0003 = 6, %R0004 = 7, %R0005 = 7, and %R0100 = 7, then the search will begin at %R0004 and conclude at %R0004 when FD is set ON and a 4 is written to %R0101.

_____

 

 

%I0001

 

—— ———SRCH_

 

 

EQ_

 

 

INT

%Q0001

%R0001—AR FD————————————————————————————————————————————————————————————( )—

LEN

 

00005

 

CONST —NX NX— %R0101

 

00003

 

 

%R0100—IN

 

_____

 

 

 

 

Example 2:

Array AR is defined as memory addresses %AI0001 — %AI0016. The values of the array elements are 100, 20, 0, 5, 90, 200, 0, 79, 102, 80, 24, 34, 987, 8, 0, and 500. Initially, %AQ0001 is 5. When EN is ON, each sweep will search the array looking for a match to the IN value of 0. The first sweep will start searching at %AI0006 and find a match at %AI0007, so FD is ON and %AQ0001 is 7. The second sweep will start searching at %AI0008 and find a match at %AI0015, so FD remains ON and %AQ0001 is 15. The next sweep will start at %AI0016. Since the end of the array is reached without a match, FD is set OFF and %AQ0001 is set to zero. The next sweep will start searching at the beginning of the array.

_____

 

 

%I0001

 

—— ———SRCH_

 

 

EQ_

 

 

INT

%M0001

%AI0001—AR FD————————————————————————————————————————————————————————————( )—

LEN

 

00016

 

%AQ0001—NX NX—%AQ0001

 

 

 

CONST —IN

 

0000

_____

 

 

 

 

GFK-0467K

Chapter 4 Series 90-30/20/Micro Instructions Set

4-93

Page 174
Image 174
GE 90-30/20/Micro manual I0001 Srch