flat assembler
Message board for the users of flat assembler.
Index
> Main > "strstr" - string searching |
Author |
|
Borsuc 27 May 2009, 02:20
It would be really slow to compare the two strings sequentially without aborting immediately when there's no match, and I don't think it's possible with rep to "break" out of it, is there?
|
|||
27 May 2009, 02:20 |
|
pete 27 May 2009, 06:53
Don't you want to use the special string instructions (stos) and registers (edi,esi) for those tasks?
|
|||
27 May 2009, 06:53 |
|
revolution 27 May 2009, 06:56
Borsuc wrote: ... I don't think it's possible with rep to "break" out of it, is there? Code: repz cmpsb |
|||
27 May 2009, 06:56 |
|
pal 27 May 2009, 14:57
Hmm, I'm thinking that to get the offset of a possible occurance I am going to have to manually do it as cmpsb will increment both values, which I do not want obviously. From there it should be simple.
Push the placement, do a repz cmpsb (the only problem is if both of the strings are the same and have null chars after then then it will carry on incrementing for ages), once it breaks compare the value in the needle string to 0, if it is then it is the occurance, if not then go back to finding an occurance. Or something like that. Thats what I think it should be anyway. |
|||
27 May 2009, 14:57 |
|
Madis731 27 May 2009, 16:56
More help for people with i7: http://www.strchr.com/strcmp_and_strlen_using_sse_4.2
|
|||
27 May 2009, 16:56 |
|
bitshifter 27 May 2009, 21:50
Check out the BlackBook chapter 9 for some nice tricks.
_________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
27 May 2009, 21:50 |
|
Borsuc 27 May 2009, 22:51
revolution wrote:
_________________ Previously known as The_Grey_Beast |
|||
27 May 2009, 22:51 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.