flat assembler
Message board for the users of flat assembler.

Index > IDE Development > FASMW: auto completion

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin
ive been thinking about putting auto completion into FASMW.
what i mean is when im coding i press CTRL+SPACE and a listbox
drops down with a list of words to auto complete what im typing.
or even finish the word if theres only one choice.

you could load the contents of the drop down list in a file say "dropdown.txt"
that way it can be customised.
mainly i would like it for the windows api commands as the assembly
instructions are typed easy enough.

now, the implementation.
have to parse the text file and load each line into a listbox.
the listbox is initiallity hidden, but when CTRL+SPACE is pressed
unhide it and place it at current position in the FASMW text control.

im a beginner at assembly, however i do have some experience with the windows api but my problems are.
getting the current position to place the listbox.
understanding FASMW source code to place my code in the right places
and making sure i dont mess up FASM and its compiling.

efficient text file parsing. and also the listbox.
because how would the listbox know which word to highlight as you edit
the textbox contents.

im very keen to see this, as the other IDE's/ editors out there do not suit my taste even though they have the drop down feature.
FASMW would be ideal for me with this.
Post 18 Jul 2005, 09:57
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 604
Location: Germany
MCD
Have you any idea of how much memory it takes to add all words contained in a file as items to a list box? Moreover if the source file is rather long (say, the Fasm core "X86_64.INC" file Very Happy ).

This would be possible, but would need a lot of dynamical memory and is kinda hard to do, also to add new words which are typed in or inserted.

I have some more feature request, I could also imagine myself on working on them:
-Add a redo feature. That wouldn't too hard to add, since FasmW already has an undo function and a command history buffer.
-The maximum line length should also decrease when the maximum line length shrinks.
(-File history)

Anyway, this topic should be moved to the "IDE Developpment" section.
Post 18 Jul 2005, 10:23
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Code completion is implemented in Fresh already...
Post 18 Jul 2005, 11:55
View user's profile Send private message Visit poster's website Reply with quote
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin
MCD i would only like to add the main ones like windows api functions,
especially really common ones like MessageBox and CreateWindowEx and the like.
its just a bit tedious to keep writing them.
but yeh i dont want to add everyword in a file. and although adding new
words dynamically could be good, i dont want that either. both to cut down on memory usage and development time Smile

i mainly like small, quick and simple things, and i like FASMW. its like notepad with source colouring, which is good. but notepad with source colouring and a drop down which i can customise would be better for me.
i have tried several IDE's and they just havent been what im looking for.

decard, i remember trying fresh a while ago and not been too keen on it. i seen the screenshots on the homepage and it does have the drop down but overall its not what im looking for. im not discouraging it, it looks impressive and well done to the author! just too much for what i need.

sorry about the placement in the "windows" section. my mistake, i was unsure.

MCD i like your redo feature so would like to see that.
what is the command history buffer you are on about, i seem to have missed that feature in FASMW but sounds interesting. is it like in command prompt when you press down/up arrows to see previous commands you have entered.
Post 18 Jul 2005, 15:21
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
There's no command history buffer in fasmw, the undo buffer just keeps the modified segments of lines and stored editor status, and on "Undo" just restores those segments to their contents one step back. This is universal and doesn't care what operation what actually done

Quote:
The maximum line length should also decrease when the maximum line length shrinks.

Such feature would need scanning all the lines on such operation (since you don't know how many lines with the maximum length are there at the moment) and would seriosly decrease performance on large files. Also I personally take advantage the feature of the "peak length", like increasing it to get the area inside which I can move with arrows freely. In old editor control (imitating the DN's editor) all lines had the fixed length of 256 characters, and you could move around freely in that area - the new one doesn't impose any limits on the line length, so I had to implement this "peak length" feature, which just traces how many space you needed at most and provides this space for you.
Post 18 Jul 2005, 15:53
View user's profile Send private message Visit poster's website Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 604
Location: Germany
MCD
Tomasz Grysztar wrote:
There's no command history buffer in fasmw, the undo buffer just keeps the modified segments of lines and stored editor status, and on "Undo" just restores those segments to their contents one step back. This is universal and doesn't care what operation what actually done

I was a bit wrong. But it would still be quiet easy add a redo feature.

Tomasz Grysztar wrote:

Quote:
The maximum line length should also decrease when the maximum line length shrinks.

Such feature would need scanning all the lines on such operation (since you don't know how many lines with the maximum length are there at the moment) and would seriosly decrease performance on large files.

Not really, it would be enough to not only have the maximum line number length, but also at which line this occurs and then just check the line(s) that are actually modified.

_________________
MCD - the inevitable return of the Mad Computer Doggy

-||__/
.|+-~
.|| ||
Post 19 Jul 2005, 13:36
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Remember there can be more than one line with maximum length. And even if you keep record of all such lines, when the last of them gets edited to be smaller, you will need to make list of all lines with the new, smaller, maximum length. Scanning all the lines cannot be avoided. Well, unless you make some data structure to hold information about all the lines for each possible length, and moving the lines between the blocks when they get edited - but it would be actually simpler to design some other edit control from scratch. And - as I said, this feature actually works like I'd like it to work - well, it was designed to exactly as is.
Post 19 Jul 2005, 13:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
OK, I was a bit wrong on this one - donkey7 pointed out to me that it would be just enough to hold the count of lines for each length in the table. I tried implementing it in the latest (0.92.7) version of fasmw's interface. Please check it out.
Post 28 Sep 2005, 11:27
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7
yeah, it works Wink
but sometimes FASMW crashes or dosen't show eding characters in long lines. both issues takes place only on lines of huge (unusual) lengths.
some people are used to set an 'free area' using previous behaviour of asmedit. now it's impossible without adding some long line (maybe comment), so i propose to add an 'minimum_line_length' feature. it would be even more convenient than old control.


Last edited by donkey7 on 28 Sep 2005, 20:20; edited 1 time in total
Post 28 Sep 2005, 13:48
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Can you find out some how to reproduce the crash?
Post 28 Sep 2005, 13:55
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
I'm uploading the 0.92.8 - fixed one critical bug and the "free area" is now always at least filling the whole editor window width - the best of two worlds, in my opinion.
Post 28 Sep 2005, 14:24
View user's profile Send private message Visit poster's website Reply with quote
Frank



Joined: 17 Jun 2003
Posts: 100
Frank
Screen-shot from the download page:


Description:
Filesize: 953 Bytes
Viewed: 5841 Time(s)

fasm downloads.png


Post 28 Sep 2005, 14:49
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
This means that the new version of file was being uploaded - just wait for the upload to finish when you see it. Wink My connection is kind of slow.
Post 28 Sep 2005, 15:02
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7
the bugs i've written about are still present.
one of them is crashing when pasting repeatedly some string of characters (thus making an huge line). interestingly, fasmw crashes on rather random line lengths, but not less than 240.

i'm using athlon 2200+, 512ram, win98se pl with unofficial service pack and of course latest (0.92.8) version of FASMW editor.


Description: sample file. on my computer FASMW doesn't show end of first line in this file.
Download
Filename: ankieta.txt
Filesize: 5.67 KB
Downloaded: 282 Time(s)


_________________
Keep coding!
Post 28 Sep 2005, 20:31
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Try the 0.92.9.


Last edited by Tomasz Grysztar on 29 Sep 2005, 09:18; edited 1 time in total
Post 28 Sep 2005, 22:22
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
for me it shows (w2k sp4 ru)


Description:
Filesize: 8.67 KB
Viewed: 5804 Time(s)

eol.gif



_________________
UNICODE forever!
Post 29 Sep 2005, 05:29
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7
yep, latest version of FASMW shows entire line (as versions 0.92.6 and below), but still crashes.
i discovered that FASMW crashes only when we are at the end of line and we are pasting an string and current line length is LCM(240,length_of_string_to_paste). (LCM - least common multiply)
then FASMW shows an error (i have polish windows):
Code:
FASMW spowodowaB bBd: nieprawidBowa strona w
module FASMW.EXE przy 016f:0040ecac.
Rejestry:
EAX=000000f0 CS=016f EIP=0040ecac EFLGS=00010206
EBX=00d56300 SS=0177 ESP=0056f9d8 EBP=0056fc84
ECX=000000f0 DS=0177 ESI=0000000e FS=0f47
EDX=00000000 ES=0177 EDI=00d56310 GS=0000
Bajtów w CS:EIP:
f3 a4 8b 0c 24 e3 25 e8 bf f6 ff ff 0f 82 a3 f7 
Stos:
0052f760 0040f2d8 0000000e 0052f85e 0040d4d3 0052f850 0056fcb0 00008d1e 00000a14 00ca0000 50300135 00ca0100 00000001 00000690 00000690 00ca0100 
    
Post 29 Sep 2005, 13:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Oh, this was an older bug actually (but for older versions the value was 248 instead of 240) - great thanks for finding it out. Please try the latest version - I simplified some of the code and fixed the above problem.

BTW, have you tried using OllyDbg as a JIT (to replace the standard Windows message like above)? I find it really useful.
Post 29 Sep 2005, 14:29
View user's profile Send private message Visit poster's website Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7
it seems to be fixed now, but i found one more bug.

fasmw hangs up and crashes when i make some very long line (several dozen thousands of chars). i think that before the crash happens, fasmw allocates huge amounts of memory - just after crash my disk was fullfilled by windows swap file (i had have about 300mb of free disk space) and after a moment swap file was cleaned.

i'm not using any debugger. when my program crash, i run disassembler (actually wdasm) and find where is the problem, then put an int3 instruction in source code and look what windows prints in error message. this may look rather complicated but i usually don't need to debug my program. i'm testing my progams after almost every change so i know what most likely can cause the problem.
Post 29 Sep 2005, 17:54
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
Yeah, forgot to check it with such huge lines myself. Again thanks for all the testing. It's fixed now, I hope you won't find much more. Wink

As for debugging, I was also used to the methods similar to yours, especially when debugging things in DOS, where often you couldn't afford any debugger (also under some extenders or with unreal mode the programs simply cannot be debugged). However in Windows I've chosen to use the Ollydbg, because it often saves me switching between programs - I've got the disassembly and the register contents just at the time of crash, if some registers contain pointers, I can go to that memory area immediatelly and analyze some data structures to see better what would have caused the problem, etc.
Post 29 Sep 2005, 18:45
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:  
Goto page 1, 2  Next

< 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-2020, Tomasz Grysztar.

Powered by rwasa.