Search Link Delink (SLD)/OP=38

Format

OP AF BF A Syllable B Syllable

OP = 38

AF is the length of the A Syllable field. AF may be indirect or may indicate the A Syllable is a literal. A value of 00 is equal to a length of 100 units.
BF is the amount of offset in units from the B Syllable address to the field to be searched. BF is typically six digits or more to allow for the link address at “B”. A value of 00 is equal to an offset of zero units. BF may be indirect.

The A Syllable is the address of the key to which the B Syllable data field will be compared. Address may be indexed, indirect or extended. The final address controller specifies the format for both the A Syllable and B Syllable fields and must be UN or UA. If the address controller specifies SN, cause an Invalid Instruction fault (IEX = 03). See Compatibility Notes A.26.2.
The B Syllable is the address of the first list entry. The initial address may be indexed or extended. Indirect addressing is not allowed. The data format is that of the final A Syllable address controller. The B Syllable address controller bits determine the type of comparison to be made:

B Address Controller Search Type
00 (UN) Search Equal. Set the comparison flags to equal when the entire key field is equal to the B Syllable data field.
01 (SN) Search Any Bit Equal. Set the comparison flags to equal when andy one bit of the key field is equal to the corresponding bit of the B Syllable data field.
02 (UA) Search Less than or Equal To. Set the comparison flags to LOW when the key field is algebraically less than the B Syllable data field. Set the comparison flags to EQUAL when the key field is equal to the B Syllable data field.
03 (IA) Search No Bit Equal. Logical sums of corresponding bits of the A Syllable and B Syllable fields are compared. The logical sum is formed for each pair (all B Syllable field bits are examined). If the logical sums are zero (bit pairs 00, 01 or 10) for ail pairs, set the comparison flags to EQUAL.

Function

The Search Link Delink instruction compares the key with the data located at B + BF or B + 2BF, as specified by the A Syllable address controller. If the comparison condition is met, set the Comparison Flags, as indicated above, If the conditions is met the first time, store the respoved B address, with its associated Base Indicant, in both index register one IX1 and two IX2. On any other time, store the current B address into index register one IX1 and store the previous B address into index register two IX2. The standard EBCDIC sign is stored in the sign digit of IX1 and IX2. See Compatibility Notes A.26.1.

The first six digits of the B Syllable data field contain the address of the next list entry. In UA format, the address is in the first three characters.

If the conditions are not met, read the next list entry from the B Syllable data field. This list entry is a link to the new data field which replaces the original B Syllable data field address, however the Base Indicant remains the same as the original B Syllable data field. BF is used in the same manner as it was with the original B Syllable data field. Continue this process until the list entry address is zero; at that time set the Comparison Flags to HIGH and terminate the instruction without storing into index register one.

The final B Syllable address will be checked for undigits (new link-list addresses will also be checked for undigits).

Comparison Flags

The Comparison Flags are set as described above.

Examples

Example (1) Search Equal

OP AF BF A Syllable B Syllable
38 05 06 A field UN B field UN
                    BEFORE         AFTER
  A FIELD           12345        unchanged
  B FIELD     00400012345        unchanged
  004000      00500012345        unchanged
  IX1             nnnnnnn     B-FIELD ADDRESS
  IX2             nnnnnnn     B-FIELD ADDRESS
  COMPARISON          nn           EQUAL

Example (2) Search Any Bit Equal, None found

OP AF BF A Syllable B Syllable
38 01 06 A field UN B field SN
                    BEFORE         AFTER
  A FIELD               6        unchanged
  B FIELD         0000009        unchanged
  IX1             nnnnnnn        unchanged
  IX2             nnnnnnn        unchanged
  COMPARISON          nn           HIGH

Example (3) Search Less than or Equal to

OP AF BF A Syllable B Syllable
38 05 06 A field UN B field UA
                    BEFORE         AFTER
  A FIELD           12345        unchanged
  B FIELD     00400012345        unchanged
  004000      00500012345        unchanged
  IX1             nnnnnnn     B-FIELD ADDRESS
  IX2             nnnnnnn     B-FIELD ADDRESS
  COMPARISON          nn           EQUAL

Example (4) Search No Bit Equal

OP AF BF A Syllable B Syllable
37 01 06 A field UN B field IA
                    BEFORE         AFTER
  A FIELD               6        unchanged
  B FIELD         0040006        unchanged
  004000          0050009        unchanged
  IX1             nnnnnnn         C0004000
  IX1             nnnnnnn     B-FIELD ADDRESS
  COMPARISON          nn           EQUAL
instructions/sld.txt · Last modified: 2008/07/30 16:56 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki