flat assembler
Message board for the users of flat assembler.
Index
> IDE Development > A problems for those want to help for developement of Fresh. Goto page Previous 1, 2 |
Author |
|
JohnFound 16 Sep 2003, 22:12
Thank you Blag.
BTW: Especially for me, there is no need to be very polite. I am not "easy offending" (I don't know exact english word ). Bye. I must go to sleep... |
|||
16 Sep 2003, 22:12 |
|
roticv 17 Sep 2003, 03:44
Actually I would be interested to help out on the string functions, but since it has already been taken up, so nevermind.
|
|||
17 Sep 2003, 03:44 |
|
JohnFound 17 Sep 2003, 10:11
roticv wrote: Actually I would be interested to help out on the string functions, but since it has already been taken up, so nevermind. Hi, roticv. In Bulgaria, we have one saying: "There is a work for whole china people". There is much work in the string library, so if you want simply begin to work. Just talk with decard what functions he will make and what you, to avoid double work. We need search functions (maybe some patern search or simple regular expresions search), file functions for manitulating text files, splitting, word functions, etc. etc. I think that string functions are very very important, because the string manipulation is one of the weak sides of the assembler. We need as much power as possible. regards. |
|||
17 Sep 2003, 10:11 |
|
roticv 17 Sep 2003, 12:01
Hey JohnFound,
If you do not mind would you give more details? But of course due to some technically difficulties I do not think I would have time to code till next week. I will see what I can do. |
|||
17 Sep 2003, 12:01 |
|
JohnFound 17 Sep 2003, 12:42
roticv wrote: If you do not mind would you give more details? But of course due to some technically difficulties I do not think I would have time to code till next week. I will see what I can do. Hi, roticv. It's great that the team grows. If you look at strlib.asm you can see that there is very little functions, mainly for creating and maintaining of dynamic strings and almost no functions about string manipulations. And existing functions are not systematized in some harmonious system. I will try to make some specification, but your (and others) opinion is important. regards. |
|||
17 Sep 2003, 12:42 |
|
roticv 17 Sep 2003, 16:23
Hi JohnFound,
Do you want it to be optimised (ie prehaps using mmx technology and so on)? If so speed or size? For example there are many variants of strlen. try this Code: strlen: call strptr mov ecx, eax @@: cmp byte [eax],0 lea eax,[eax+1] jnz @B sub eax, ecx dec eax ;return value in eax retn |
|||
17 Sep 2003, 16:23 |
|
JohnFound 17 Sep 2003, 16:42
roticv wrote: Do you want it to be optimised (ie prehaps using mmx technology and so on)? If so speed or size? For example there are many variants of strlen. try this... As primary goal, I want it to work But optimization is OK, IMHO for size. MMX and so on is not very good idea for standard library IMHO. FASM works on 486. On other hand, there is no computers without at least MMX, so, I simply don't know. Good commented code will be great. [EDIT] I simply don't understand an idea at first reading... The strlen returns the result in ecx by the reason that there are some other routines that have length of the string as input in ecx. Most of fundamental string functions use register calling convention because of the speed.[/EDIT] |
|||
17 Sep 2003, 16:42 |
|
decard 17 Sep 2003, 17:06
Hi John,
I have finished and tested two routines: StrCat that appends one string to other, and StrPos that searches for one string in another. What another search routines do you need? Do you want me to post this version of StrLib, or meaby to add some more functions? Now I'm working with StrDup routine that will duplicate given string (it should be very useful). roticv: Meaby you could take care about textfile routines (proably they would be kept in separate file, so it would be easier to work with them). If you want to code StrLib, write which functions you are going to provide, and then we'll think how to synchronize our work:) about the StrLen: I have a version that should be even faster (without any jumps): Code: StrLen: push eax edi call StrPtr mov edi,eax mov ecx,-1 xor al,al repne scasb not ecx dec ecx pop edi eax ret |
|||
17 Sep 2003, 17:06 |
|
decard 17 Sep 2003, 17:22
about the optimisation: IMO you can optimize it for 486, or Pentium, as proably there are no computers with Windows working on 486, but proably there could be some people who would need to use it eg. on Pentium 133. I am using P266MMX (don't laugh ), so eg. I can't run any code that uses SSE2.
|
|||
17 Sep 2003, 17:22 |
|
JohnFound 17 Sep 2003, 17:26
to decard:
You can post your changes to strlib, as often as you want. Just pack it in ZIP or RAR format and attach it to your post. I will download it and insert in the next "official" release. Of course if I, or someone else from the team needs some special string function we will post here a request. That both: StrCap and StrPos are good hit IMO. About search functions I think about some pattern matching function. Something like regular expresions in the Perl (if you don't know what is that, I can try to explain), but it is very hard to be written from scratch. Maybe it's possible to find some examples or libs with open source. Try to ask on win32asm board. regards. |
|||
17 Sep 2003, 17:26 |
|
JohnFound 17 Sep 2003, 17:48
When I looked at discution in "conference" thread, it occurs to me, that probably we will need some "word" functions:
proc WordCount, hString, hSeparators proc ExtractWord, hString, WordNum, hSeparators In this functions word separators should be set of chars, not single char. |
|||
17 Sep 2003, 17:48 |
|
decard 17 Sep 2003, 17:50
John,
OK, I will post StrLib tomorrow, when I will add some comments, and info about my routines (now I should do my homework, heh ). I'll post it in Windows forum, as it not only assigned to Fresh. Unfortunately I don't have any idea about that regural expressions in Perl (and about the Perl ), so you could write what exactly do you need. Last time I was on win32asm a long time ago, I am not even subscribed there (yes, I know I should). I will subscribe when I will have some more time. To the team, about the systemization of StrLib: IMO function names should begin with Str, eg. StrCopy, StrNew, etc. That would make them easier to remember, and if user would see "StrXXX", he would know that it is a part of StrLib. Also, different functions get their string parameters in different registers (eg NewStr in edi, and StrLen in eax). IMO it should also be systemized (meaby to pass string parameters in edi?) I that it would make additional fork for you (changing the names), but I thing it is worth coding. What do you think about it? regards, Decard |
|||
17 Sep 2003, 17:50 |
|
JohnFound 17 Sep 2003, 18:06
Quote: Unfortunately I don't have any idea about that regural expressions in Perl (and about the Perl ), so you could write what exactly do you need. Well, regular expressions are patters matching algorithm. Something like wildcards in filename searches, only more, more complex. For example you can make search of "something begining with digit, with length between 5 and 9 symbols and 3th symbol to be X". Unfortunately the full RE search algorithm is too complex, so I think we must forget about it for a while. For now Word functions will be enough. Quote: To the team, about the systemization of StrLib: IMO function names should begin with Str, eg. StrCopy, StrNew, etc. That would make them easier to remember, and if user would see "StrXXX", he would know that it is a part of StrLib. I tend to think that we must make all functions with StdCall convention using "proc" macro. It's true, that this is more slow, but it will be more standard. I am ready to remake whole project to use this string functions. It's not for first nor for last time I think. |
|||
17 Sep 2003, 18:06 |
|
decard 17 Sep 2003, 18:51
Fine, I'll convert those functions to the stdcall, and post the StrLib when finished. I will also change their names to StrXXX format, ok?
I will leave NumToStr by now, it requires more work than just changing to stdcall. I will try to post it tomorrow, but I don't know whether it would be possible. I don't understand one thing about those "word" functions. What is hSeparators? Is it a string containging chars that can separate the words (eg. " -=+,")? sorry that I'm asking about almost everything, but I just want to do it good. regards |
|||
17 Sep 2003, 18:51 |
|
JohnFound 17 Sep 2003, 19:43
decard wrote: I don't understand one thing about those "word" functions. What is hSeparators? Is it a string containging chars that can separate the words (eg. " -=+,")? Exactly. The "word" is part of the string that is enclosed in some chars from hSeparators string OR from begin or end of the string. Good night. |
|||
17 Sep 2003, 19:43 |
|
decard 19 Sep 2003, 05:25
John,
that's again MakeName, this time it is changed to work with stdcall version of StrLib. Code: proc MakeName, ptrTName .new_str dd ? .buf rb 12 ; the number can have max. 11 digits, it should be enough enter push ebx ecx esi edi xor eax,eax ; need to clear the buffer because mov dword[.buf],eax ; NumToStr doesn't put NULL mov dword[.buf+4],eax ; after the converted number mov dword[.buf+8],eax ; mov ebx,[ptrTName] inc dword[ebx+4] ; increase number in TName struc mov eax,[ebx+4] mov ecx,10 lea edi,[.buf] call NumToStr ; convert the number into a string mov ebx,[ptrTName] mov eax,[ebx] stdcall StrDup,eax ; duplicate preffix lea ebx,[.buf] stdcall StrCat,eax,ebx ; append number to the preffix pop edi esi ecx ebx return |
|||
19 Sep 2003, 05:25 |
|
JohnFound 19 Sep 2003, 05:44
Thanks.
Today I will rewrite Fresh to use new lib. |
|||
19 Sep 2003, 05:44 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.