Search List (SLT)/OP=64

Format

OP AF BF A Syllable B Syllable C Syllable

OP = 64

AF Unused and reserved. AF can be indirect, but a literal flag causes an invalid instruction fault (IEX=21).
BF Search variant. Can be specified as an indirect field length. The following variants can be specified by this field after any indirect field length has resolved:

BF MSD (BIT) Meaning
3 Reserved
2 Store IX2 (Delink)
1 Pointer and Links length
0 Reserved
BF LSD (DIGIT) Meaning
9 Search Lowest
8 Search Highest
7 No bit equal
6 Any bit equal
5 A greater than or equal to B
4 A greater than B
3 A less than or equal to B
2 A less than B
1 A not equal to B
0 A equal to B

All other BF values are reserved and cause an invalid instruction fault (IEX=26).

A Syllable - Address of the key field can be indexed, indirect, or extended. The final address controller specifies the data type for both the key (A) and the comparison. The address controller must specify UN or UA. An SN controller causes an invalid instruction fault (IEX=03).
B Syllable - Address of the list entry pointer can be indexed, indirect, or extended. The final address controller must equal UN or cause an invalid instruction fault (IEX=03). This six digit field contains an address that is relative to the same memory area as the B-address. This address is a pointer to the first list entry. A value of EEEEEE indicates an empty or NULL list.
C Syllable - Address of the list descriptor can be indexed, indirect, or extended. The final address controller must equal UN or an invalid instruction fault (IEX=03) occurs. The length of this field is always 18 digits and in the following format:

Digits Information
00-05 Link Offset (digits)
06-11 Comparison Offset (digits)
12-17 Key Length (digits)

Note: The lowest memory address is 00.

Function

SLT is a general search instruction for linked lists that can reside in more than one memory area.

The B-address specifies a location in memory that contains the address of the list entry pointer. The list entry link field is located in the list entry at an offset specified by the link offset field in the list descriptor.

The list entry pointer and link fields describe addresses that can be of two different formats and are controlled by BF MSD bit 1. If the bit is reset, the format is a 6-digit field, AAAAAA. The address is relative to the same area base as the B-address. If the bit is set, the format is an 8-digit field, CiAAAAAA, where i represents a base indicant with a value that can be from 0 through 7, and C is the positive sign.

If the initial value of the list field entry pointer (B) is equal to EEEEEE or CiEEEEEE, the list is empty. If BF MSD bit 1 is reset, the value CiEEEEEE, where i represents the base indicant of the resolved B-operand, is stored in IX1, and the comparison flags are set to NULL. If BF MSD bit 1 is set, the list entry pointer itself (CiEEEEEE) is stored in IX1, and the comparison flags are set to NULL. If the store of IX2 is specified by BF MSD bit 2, the address of the list entry pointer (B), relative to the same base as the resolved B-operand, is stored in IX2 (format = CiAAAAAA).

If the list is not empty, the data contained in the key (A) with a length as specified by the key length (C 12:6), is compared with the data located in a specified list entry key field. This list entry key field is found by adding the comparison offset (C 06:6) to the value of the list field entry pointer. The result of the comparison causes one of two actions.

  1. Except in the case of search lowest or search highest, if the selected comparison condition is met, the list entry pointer is stored in IX1 (format = CiAAAAAA). If BF MSD bit 1 is set, the value stored is the 8-digit list entry pointer itself. If BF MSD bit 1 is reset, AAAAAA is the list entry pointer, i is the base indicant of the resolved B-operand, and C is the positive sign.

    In the case of search lowest or search highest, the entire list is examined before the address of the entry with the lowest or highest value is stored in IX1.

    If the store of IX2 is specified by BF MSD bit 2 and this is the first comparison, the address of the list entry pointer is stored in IX2 (format = CiAAAAAA); i is the base indicant of the resolved B-operand.
    If it is other than the first comparison, the address of the previous link entry field is stored in IX2 (format = CiAAAAAA).
    If BF MSD bit 1 is set, the value stored is the 8-digit address of the previous list entry link field.

    If BF MSD is reset, AAAAAA is the address of the previous link address field, i is the base indicant of the resolved B-operand, and C is the positive sign.
  2. If the selected comparison condition is not met, the list entry link field contains the address of the next list entry to be examined. This procedure is repeated until the comparison condition is met or the link address is equal to EEEEEE of CiEEEEEE.

    If the link address is EEEEEE or CiEEEEEE, the NULL list value (CiEEEEEE) is stored in IX1. If the store of IX2 is specified by BF MSD bit 2, the address of the previous list entry link is stored in IX2.

    Refer to 1 for details on the format of data stored in IX1 and IX2.

Variants

The variants are described as follows:

  • Any Bit Equal

    Any bit equal requires that the key (A) field be added with the comparison field, by using the AND instruction, to determine if the the result is zero. If the result is not zero, a match occurred.
  • No Bit Equal

    No bit equal requires that the key (A) field be added with the comparison field, by using the AND instruction, to determine if the result is zero. If the result is zero, a match occurred.
  • Search Lowest

    A search lowest function terminates only when a NULL link is reached. It searches through the list for the lowest comparison field entry that is also less than the key (A). If at least one entry is found, then it stores the address of the first such entry in IX1.

    If the store of IX2 is specified by the most significant digit of BF, the address of the previous link address field (list field entry point plus the link offset) is stored in IX2.

    If no entries less than the key (A) are found, the NULL list value (CiEEEEEE) is stored in IX1. If the store of IX2 is specified by the most significant digit of BF, the address of the link address field (list field entry point plus the link offset) in the last entry of the list is stored in IX2.
  • Search Highest

    A search highest terminates only when a NULL link is reached. It searches through the list for the highest comparison field entry that is also higher than the key (A). If at least one entry is found, then the address of the first such entry is stored in IX1.

    If the store of IX2 is specified by the most significant digit of BF, the address of the previous link address field (list field entry point plus the link offset) is stored in IX2.

    If no entries are greater than the key (A), the NULL list value (CiEEEEEE) is stored in IX1. If the store of IX2 is specified by the most significant digit of BF, the address of the link address field (list field entry point plus the link offset) in the last entry of the list is stored in IX2.

Comparison Flags

Set the Comparison Flags to HIGH if the A-string is of greater value than the B-String.

If the comparison condition is met on the first entry, the Comparison Flags are set LOW. If the comparison condition is met on other than the first entry, the comparison flags set to EQUAL. If the comparison condition is not met, the comparison flags set to HIGH.

If the list is empty, the Comparison Flags are set to NULL.

instructions/slt.txt · Last modified: 2009/07/11 07:22 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