News:

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

Boyer Moore implementation

Started by Bertram, May 11, 2007, 05:20:39 PM

Previous topic - Next topic

Bertram

Hi
I hope I will not be shot down in smoke and flames for being presumtuous, particularly as I am completely new to this forum and pretty inexperienced in assembly language programming.

I needed a fast string search routine and found one in bmh.asm in the masm library. I installed it in my program (which I hope is permitted) and it is all I could have hoped for. However I found that if the search string comprises the very last characters in the buffer through which the file is being passed, it gets missed, as the routine seems to stop one character short of the full length of the buffer.

Changing line 99 from 'jl Main_Loop' to 'jle Main_Loop' extends the search by one byte to the end of the buffer and all is sweetness and light again.

I may well be in error about this but if so I hope you will blame rather my lack of wit than goodwill.

Does anyone know of a good case insensitive adaptation?
:red
Bertram

Tedd

Convert the search string to uppercase, convert the string being search in to uppercase. Search as before.
No snowflake in an avalanche feels responsible.

hutch--

Bertram,

Thanks for the effort, it certainly is not wasted. The problem for me is to make the time to set up a test piece to see what is happening with the algo as I have not touched it for years. Havew you tested either of the other two BM algos, the one you are using is the Horspool variation but there is a simplified version and a complete version as well. Usually the complete version has the fastest averages.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php