The LazyBoy Library Manual - StrByteLookup

Part of the Strings group.

%imacro StrByteLookup 3
Prefers: ES:DI, ES:DI, AL

Lookup string in byte indexed table.

No, Prefers: ES:DI, ES:DI, AL is not a typographic error. Instead of requiring %1 to always be a pointer and used for input and output values, they were broken into two separate parameters. This permits %1 to not have an initial value and the table to be a constant (label). Otherwise, you would need to set the pointer separately before calling the macro.

%1 is the returned pointer to the string in the table. If the index was not found, the CF will be set and pointer will be set to the default string.

%2 is the pointer to the byte indexed table. If no segment is provided, DS is assumed. Unless %2 is a LABEL, then CS is assumed.

%3 is the index of the string requested.

The Carry Flag will be set if the string is not found.

Examples:

    StrByteLookup es:di, MY_STRS, al   ; Lookup string index AL in table CS:MY_STRS

See also: StrByteTable.