Hi Privalov (and everybody else)!

What do you think about this (see attachment)?
Posted on 2003-04-25 16:02:20 by Tommy
...a little bit modified:
Posted on 2003-04-26 04:59:58 by Tommy
I fail to assemble it. Could you post the exe here?
Posted on 2003-04-26 15:02:46 by Delight
Me too, I think I have the "wrong" includes, I had the same problem w/ another fasm project, e.g. I have two import include files, two different versions, I think it's the same think this time.
Please include your include files and an pre-compiled exe.
Posted on 2003-04-26 16:05:57 by scientica
Here's the executable and the include-files....
Posted on 2003-04-26 16:10:16 by Tommy
and what a nice IDE, I'll look in to the sources asap. :)

Just compiled the sources w/ you includes, it compiled w/o any problems (as expected) :)
Posted on 2003-04-26 16:20:04 by scientica
Nice job:alright:
Posted on 2003-04-28 04:28:56 by Vortex
Thanks! I'll continue on it.... ;)

Cheers!
Posted on 2003-04-28 07:29:12 by Tommy
Hi everybody!

I have added some more small features... Here it is...
Note! Requires the new fixes in the resource macros i.e. support for exstyle...

Cheers!
Posted on 2003-04-29 15:27:36 by Tommy
One more fix:
Now support compiling from commandline. Just use the -m parameter in the commandline, and FASM will compile the last loaded file.

Have a nice day!
Posted on 2003-04-30 01:22:37 by Tommy
One more fix:
Now support compiling from commandline. Just use the -m parameter in the commandline, and FASM will compile the last loaded file. It also support to run a file from the commandline. Then use -r instead of -m...

Enjoy!
Have a nice day!
Posted on 2003-04-30 01:29:07 by Tommy
Tommy, it's a very nice feature (the maring enhacement), but you forgot to delete the brushes after use.
I discovered this bug when suddenlyevery graphic was, irradically painted (if painted at all). After some ( :rolleyes: , thanks for API monitors/loggers/spies/whatever-they're-called) debuging, I found that the margin enhancement was responsible for the error, the two brushes created for drawing the margin, wasn't delted after use, but a new one was created for each call to UpdateWindow (which sends a WM_PAINT, triggering the paint mechanism in AsmEdit.inc).
Here is the needed pathces to stop this leaking:
N.B: Add the lines with the comments ";>>!FIX: (scientica)..."



;Edit\AsmEdit.inc
.return_value dd ?
.background_brush dd ?
.selection_brush dd ?
[COLOR=red] .margin_brush dd ? ;>>!FIX: (scienitca) <- fix code[/COLOR]
[COLOR=red] .marginborder_brush dd ? ;>>!FIX: (scienitca) <- fix code[/COLOR]
...
.wmpaint:
....
invoke CreateSolidBrush,[.margin]
[COLOR=red] mov [.magrin_brush],eax ;>>!FIX: (scienitca) <- fix code[/COLOR]
invoke FillRect,ebx,rect,eax
mov eax,[rect.right]
mov [rect.left],eax
[COLOR=red] invoke DeleteObject,[.margin_brush] ;>>!FIX: (scienitca) <- fix code[/COLOR]
add [rect.right],1
invoke CreateSolidBrush,[.marginborder]
[COLOR=red] mov [.marginborder_brush],eax ;>>!FIX: (scienitca) <- fix code[/COLOR]
invoke FillRect,ebx,rect,eax
mov eax,[rect.right]
mov [rect.left],eax
[COLOR=red] invoke DeleteObject,[.marginborder_brush] ;>>!FIX: (scienitca) <- fix code[/COLOR]
add [rect.right],3
invoke FillRect,ebx,rect,[.background_brush]
pop [rect.right] [rect.left]
invoke SelectObject,ebx,[.editor_font]
mov esi,[.editor_screen]
mov eax,[.screen_width]
mul [.screen_height]
lea edi,[esi+eax]
mov [rect.top],0
mov eax,[.font_height]
mov [rect.bottom],eax
mov ecx,[.screen_height]
.paint_screen:
Posted on 2003-05-11 10:48:18 by scientica
Thanks Scientica!!! :stupid: I forgot that!

Cheers!
Posted on 2003-05-11 12:19:12 by Tommy
A new update... Bug fixes by Scientica... You should thank him! (the script-directive by JohnFound is also included) ;)

So long!
Posted on 2003-05-11 12:24:51 by Tommy

A new update... Bug fixes by Scientica... You should thank him!

:)

I've made some enhancement myslef (hopefully bug free, but if you find any please don't keep it to yourslef :tongue: ), here's an improvement of the "switch parsing".
I'm not attaching my version of the sources, since they're to hard to follow for others, plus that I think it's better to show what one has changed, it makes it easier to keep a track of enhancements/changes (IMO).
Cut 'n' Paste this procdeure in to you fasm.asm:
;---------------------------------------------------------------------------------------------

proc GetArgSetFlag, lpCmd , lpValidSwitch, lpFlag
enter
push ebx
push edi
push esi

mov ebx, [lpCmd]
mov edi, [lpValidSwitch]

mov ah, [ebx]
cmp ah, '-' ; test for "-foo" and "--foo" style
jnz .TestWinDos
mov ah,[ebx+1]
cmp ah,'-'
jnz .comp_arg ; is the arg in *nix styled "--foo"?
inc ebx ; skip the forst "-", so we get "-foo" instead of "--foo"
jmp .comp_arg ; and test it
.TestWinDos:
mov al, '-'
cmp ah, '/'
jnz @F
mov [ebx],al ; replace '/' with '-', so "/foo" becomes "-foo"
.comp_arg:
mov esi, [lpFlag]
invoke lstrcmpi,ebx,edi
;je set_make_flag
setz byte [esi] ; if equal, lpFalg=1, else lpFlag=0
jnz @F
xor eax,eax
jmp fi
@@: mov eax,-1
fi:
pop esi
pop edi
pop ebx
return
;---------------------------------------------------------------------------------------------

then change these lines:
        invoke  lstrcmpi,ebx,_cmd_make

je set_make_flag
invoke lstrcmpi,ebx,_cmd_run
je set_run_flag

to these:


; Search for switches like -r /m and --r
stdcall GetArgSetFlag, ebx, _cmd_make, bmake
jz load_ok
stdcall GetArgSetFlag, ebx, _cmd_run, brun
jz load_ok

And then finally, delete these lines:


set_make_flag:
mov [bmake], 1
set_run_flag:
mov [brun], 1

And voial?. now you can do all this: (first three lines do the same, and the last three do the same)
fasm -m file.asm
fasm --m file.asm
fasm /m file.asm
fasm -r file.asm
fasm --r file.asm
fasm /r file.asm
aplaude ;)


To add a new switch you can do the following:
under the lines:
  _cmd_make         db '-m',0

_cmd_run db '-r',0

add your switch (_cmd_youSwitch db '-YourSwitch',0)
N.B! the switch mist start with '-'!

under the lines:
  bmake              db 0

brun db 0

add your switch "flag" (b db 0)

under the lines:
        ; Search for switches like -r /m and --r

stdcall GetArgSetFlag, ebx, _cmd_make, bmake
jz load_ok
stdcall GetArgSetFlag, ebx, _cmd_run, brun
jz load_ok

add:
stdcall GetArgSetFlag, ebx,_cmd_youSwitch, b[YourSwitch]

jz load_ok


then under these lines (bare with me, we're almost done)
      command_line_ok:

invoke DragAcceptFiles,[hwnd],TRUE
cmp byte [bmake],1
je make_file
cmp byte [brun],1
je run_file

add:
        cmp     byte b[YourSwitch],1

je TheProcWhereYouDoIt


Then just add "TheProcWhereYouDoIt:" somwhere bellow and don't forget to make sure you do a "jmp finish" when you've done what you did. :)

(perhpas there should be a sub fourm here for "Customizations", what do you think privalov, you're the boss :))
Posted on 2003-05-11 13:29:02 by scientica
That's a bit funny, but it was implemented in the very similar way in the first versions of fasm (0.9x series) and then I removed it because I didn't find it necessary...
No, it was still a little different, because the first versions of "get_params" proc were creating two separate lists, one with standard params, and one with switches.
Posted on 2003-05-11 14:15:57 by Tomasz Grysztar
I want to contribute also. I take the last base prepared by Tommy and added the following:
+ Privalov's bugfix for "check_for_reserved_word"
+ Turn source tree to Privalov's way (easy to maintain)
+ Multiselect in open dialog (my 2 cents)

There is missing:
- scientica contribution (I find it only now)
- johnfound's scripting technology (under way)

Some ideas:

1. It is enough to pass command line the same way as in console fasm. If there are asm and exe filenames, the program will compile it without loading the IDE. If there are only asm files, the IDE will load them.

2. When program launched from command line needs to compile only, there is no need to load and process the GUI stuff.

3. To ease contributions to the IDE, please maintain the same source tree structure of Privalov, in order to follow better the upgrades.

Best Regards,
Posted on 2003-05-12 05:14:32 by pelaillo
Hi pelaillo!

Good work! But IMHO this is not good to change name of the "invoke" to "api" 3 char name is very similar to instructions mnemonics and this make source very unreadable.
Posted on 2003-05-12 06:00:42 by JohnFound
sinff :( I change it for readability. (and cause invoke is so ugly and long...)

However, you are right. I forget to change it back before posting. I like to keep fasm sources as standard as possible.

Thanks
Posted on 2003-05-12 06:44:11 by pelaillo
Following is the upgrade of the extended fasm IDE. I've added an environment variables overrride. Useful if you intend to use fasm in someone-else's computer or for testing (remember that changing the filename.exe you will have different filename.ini file)

Example (fasmex.ini)


...
[Help]
Path=E:\Help\X86EAS.HLP
....
[Environment]
include=A:\Fasm\Include
;Include=C:\Programs\Fasm\Include\
Platform=Win32
...


Attached are the sources (only those modified respect to the official base: fasm 1.46.9.4)

For more info see the file "fasmex.txt"

Best Regards,
Posted on 2003-05-28 09:22:10 by pelaillo