News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A demonstration of indexed lookup

Started by Larry Hammick, December 13, 2009, 02:40:24 PM

Previous topic - Next topic

Larry Hammick

Quote from: z941998 on December 16, 2009, 06:10:23 AM
@Larry: Question:  Your first listing had a cmp 0A0Ah, if zero then exit out.  Does this mean a match was found?
Yes. The strings have been trimmed and the line-ends have been replaced with the line feed character 0Ah.

Larry Hammick

#16
http://www3.telus.net/ldh/asm/WORDLIST.ZIP

That zip contains the source code and build files for wordlist.dll, wordlist.inc, wordlist.lib, and demo.exe. The dll contains the indexing and lookup routines, and demo.exe specifies a text file (included) of 90,000+ sorted strings, and calls the dll to look up specific strings or determine if they are not present.

Update: that demo breaks down for bigger text files, because of these errors in wordlist.asm:
    jc   short IL_look_higher
;IL_look_lower:
    movsx eax,word ptr[esi+8*ebx+4]
    jmp  short IL_adjust
IL_look_higher:
    movsx eax,word ptr[esi+8*ebx]
IL_adjust:

Should be:
    jc   short IL_look_higher
;IL_look_lower:
    mov eax,[esi+8*ebx+4]
    jmp  short IL_adjust
IL_look_higher:
    mov eax,[esi+8*ebx]
IL_adjust:


I used my old friend QBasic to generate a text file of 450,000+ "words", and after a test or two, I'll upload the demo for files of that size.

Update:
Okay, the above zip file is now corrected and contains the new and bigger word list.

ecube

Outstanding work  :U I tested and it seems to work correctly :bg this would be great on databases, I think with your permission Hutch should try and add to masm32 so all can benefit from blazing fast searches

Larry Hammick

Quote from: E^cube on December 25, 2009, 09:32:15 PM
Outstanding work  :U I tested and it seems to work correctly :bg this would be great on databases, I think with your permission Hutch should try and add to masm32 so all can benefit from blazing fast searches
Anybody can do anything he likes with that one.

z941998

I took the next step to creating an automatic platform for handling Trees/Indexed Lookups for my own library of tools.

I added a few extra features, like being able to control the terminator value when normalizing and added more compare routines (ones that can handle numeric data - integer format at this time).

I can load my test data, create the tree/index's with no apparent problems, however, when I perform the lookup, I am getting GPFs.

I think this is a result of not understanding how each designed level (ie: byte, word, and dword) of Trees/index's should be controlled.  I am thinking I may have an issue with creating the Tree and also the lookup to sync with the tree.

I need to get back on track, so have a crack and provide me your feedback.  See attachment.  Thanks Steve