flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > IDE Development > Replace bug?

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4102
Location: brighter future, please.
Replace bug?
given this code

Code:

        dd minicube,300,3200,400
        dd minicube,300,3200,400
        dd minicube,300,3200,400




when i try to replace 0,400 by 0,400,Blue

only the first line will be replaced. if the first line don't end with 0,400 it will replace nothing at all...
here the gif of the problem: http://fool.codercat.org/fasmreplacebug.gif
tested with the very last version of fasm

it happens with the file uploaded, never saw this bug before.

thanks.
You are not allowed to download the files attached to this post. You may need to log in in order to do so.
Post 08 Feb 2012, 17:11
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4641
Location: Argentina
The problem can be more easily seen by just trying to find the following string patterns:
(always without qoutes)
"400" : no problems
",400" : finds the occurrences, but if you open the search dialog again it shows "400" (i.e. it removes the comma)
"0,400" : finds nothing.

By some quick testing, it seems that searches like x,y are converted into y the next time you open the search dialog. The "0,400" and "0,Blu" patterns fail, but "0,4", "0,40", "0,B", "0,Bl" and "0,Blue" all work.
Post 08 Feb 2012, 19:02
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4102
Location: brighter future, please.
tested with:

Code:

0,000
0,000
0,000



replace 0,000 by 0,00 OK

Code:

0,000,123
0,000,123



replace 0,123 by 0,00 OK

Code:

0,00,400
0,00,400



replace 0,400 by 0,00 OK

Code:

0,222,400
0,222,400



replace 2,400 by 0,00 OK

Code:

0,000,400
0,000,400



replace 0,400 by 0,00 notfound

Code:

0,000,100
0,000,100



replace 0,100 by 0,00 notfound

Code:

0,222,122
0,222,122



replace 2,122 by 0,00 not found


Code:

0,222,122
0,222,122
22*2,122   



replace 2.122 by 0,00 Ok, one replace here->*

Code:

;CURSOR position->*
0,22*2,122
0,222,122



replace 2,122 by 0,00 replace ok, 1 replace

but what is the limit?
Post 08 Feb 2012, 20:50
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 5459
Location: Kraków, Poland
Quick fix: in SEARCH.INC find this section

Code:
    match_part_of_suffix:
        mov     eax,[esp]
        push    ecx esi edi
        xchg    eax,esi
        sub     eax,esi
        sub     ecx,eax
        repe    cmpsb
        pop     edi esi ecx
        jne     suffix_match_shifts_table_done
    store_suffix_match_shift:

and replace "sub ecx,eax" with "add ecx,eax".

I will upload the corrected package later.
Post 09 Feb 2012, 15:45
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4102
Location: brighter future, please.
thank you so much Smile
Post 09 Feb 2012, 22:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2013, Tomasz Grysztar.