flat assembler
Message board for the users of flat assembler.

Index > IDE Development > [BUG](maybe) .ash?

Author
Thread Post new topic Reply to topic
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 28 Jul 2010, 22:53
When saving a file(asm source presumably) with FasmW and no extension is provided, is suffixes '.ash' instead of '.asm' is this intended or a bug?
Post 28 Jul 2010, 22:53
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 30 Jul 2010, 00:25
Um... Anyone there?
Post 30 Jul 2010, 00:25
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Jul 2010, 01:00
Could you provide exact steps? I can't reproduce that behavior here (FASMW 1.69.14)
Post 30 Jul 2010, 01:00
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Jul 2010, 01:46
I've just debugged a bit and I see that it is the GetSaveFileName API function that fills the extension when missing. The filter is ['Assembler files',0,'*.ASM;*.INC;*.ASH',0,'All files',0,'*.*',0,0], and it seems that in your PC the last extension from "Assembler files" is picked while in my WinXP SP3 the first one is picked (even if I select "All files" in the drop-down list before saving).

Not sure if qualify this as a bug, but if you're doing exactly the same steps than I do (File>New, File>Save, and then using an extension-less file name), then perhaps the extension auto-filling should be revised.

BTW, while looking at the code I found this:
Code:
        xor     esi,esi
      check_if_overwritten: ; It is referenced by the jump in this loop only (Not Tomasz's comment)
        cmp     esi,ebx
        je      not_overwritten
        mov     [ei.header.mask],TCIF_PARAM
        invoke  SendMessage,[hwnd_tabctrl],TCM_GETITEM,esi,ei
        or      eax,eax
        jz      save_ok
        invoke  lstrcmpi,[ei.pszpath],[lparam]
        or      eax,eax
        jz      remove_overwritten
      not_overwritten:
        inc     esi
        jmp     check_if_overwritten    

To make the loop iterate once the xor esi, esi could be replaced with mov esi, ebx as for all values of ESI < EBX the loop does nothing but incrementing ESI. Still it seems there is a problem, if lstrcmpi does not return zero I think it is very likely this will loop indefinitely unless the SendMessage causes some indirect fixing (changing ei.pszpath) when reentering the WindowProc (but still it will freeze for some seconds as getting ESI equal to EBX again will take 2^32 iterations). If you don't take this problem into consideration this loop could be removed and references to ESI should be changed to EBX (including a call below this loop).

[edit]Ignore my comments about the code above completely.[/edit]


Last edited by LocoDelAssembly on 30 Jul 2010, 03:08; edited 1 time in total
Post 30 Jul 2010, 01:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 30 Jul 2010, 02:02
LocoDelAssembly: It looks to me like the loop is searching for a tab window with the name equal to lparam. I assume ebx contains the count of tabs?


Last edited by revolution on 30 Jul 2010, 02:03; edited 1 time in total
Post 30 Jul 2010, 02:02
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 30 Jul 2010, 02:03
I noticed it while running FasmW under Wine 1.2. Maybe it's a bug in Wine... I'll test in Vista SP2 when/if I reboot into.

My steps:
  • Open Fasmw
  • Save as "test"("test" being all that I type.)
  • "test.ash" appears in my CD


Last edited by Tyler on 30 Jul 2010, 02:06; edited 1 time in total
Post 30 Jul 2010, 02:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 30 Jul 2010, 02:04
WINE != Windows
Post 30 Jul 2010, 02:04
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 30 Jul 2010, 02:09
Did I say it occurred on Windows? Anyway, Wine ~= Windows Smile.
Post 30 Jul 2010, 02:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 30 Jul 2010, 02:11
fasmw is designed for Windows so naturally we will all test with Windows.
Post 30 Jul 2010, 02:11
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Jul 2010, 02:13
I see. But then, is the behavior of this API clearly specified in this cases? If it is the case then you should notify WINE authors about this issue.

revolution,
Code:
  save_file_as:
        invoke  SendMessage,[hwnd_tabctrl],TCM_GETCURSEL,0,0
        mov     ebx,eax     
But note that the two INVOKEs in the loop are not executed until EBX==ESI, so it is not really scanning the tabs.
Post 30 Jul 2010, 02:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 30 Jul 2010, 02:19
LocoDelAssembly wrote:
But note that the two INVOKEs in the loop are not executed until EBX==ESI, so it is not really scanning the tabs.
Erm, I see the opposite, the two INVOKEs are executed each time ESI!=EBX.
Post 30 Jul 2010, 02:19
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Jul 2010, 03:07
It is official, I'm a fucking blind!
Post 30 Jul 2010, 03:07
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 30 Jul 2010, 11:04
and me fucking ignorant, what is .ASH extention for?

OK, is for ASm Header.... got it!
Post 30 Jul 2010, 11:04
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Jul 2010, 11:24
I would say "Asm header".
Post 30 Jul 2010, 11:24
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6115
Location: Poland
MHajduk 30 Jul 2010, 12:16
".ASH" file is exactly what you get when you burn a print-out with your '.ASM' source file. Wink
Post 30 Jul 2010, 12:16
View user's profile Send private message Visit poster's website 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 can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.