Looking at the Glulx specification section 2.16 Searching, it mentions that search opcodes can sometimes use options, one of which is
- ReturnIndex (0x04): This flag indicates that search should return the array index of the structure that it finds, or -1 (0xFFFFFFFF) for failure. If this flag is not used, the search returns the address of the structure that it finds, or 0 for failure.
The specification for the @linkedsearch opcode says:
linkedsearch L1 L2 L3 L4 L5 L6 S1
- L1: Key
- L2: KeySize
- L3: Start
- L4: KeyOffset
- L5: NextOffset
- L6: Options
- S1: Result
The structures need not be consecutive; they may be anywhere in memory, in any order. They are linked by a four-byte address field, which is found in each struct at position NextOffset. If this field contains zero, it indicates the end of the linked list.
The KeyIndirect and ZeroKeyTerminates options may be used.
ReturnIndex flag is specifically not listed; I assume that this is intentional. Is there some technical reason that this option is omitted for @linkedsearch?