flat assembler
Message board for the users of flat assembler.

Index > Main > String Objects in fASM

Author
Thread Post new topic Reply to topic
r22



Joined: 27 Dec 2004
Posts: 805
r22
I'm making a String object dll thing in fasm.
It uses the VirtualAlloc api to make my String Obj structure

DLL...
String struct
.ptr dd 1 ;pointer to a string buffer
.len dd 1 ;length of string
.mem dd 1 ; memory used in buffer blocks of 512bytes
.hash dd 4 ; 16 byte hash of my own creation
ends
Functions...
StrNew - returns ptr to created str structure in memory
StrAdd(str struct address,buffer ptr, buffer len)
- add a buffer of specified length to str obj
StrAddStr(str struct A address, str struct B address) - append B to A
StrUpdate(str struct address) - updates the hash
- I'm using an MMX optimized 4 to 16 byte expansion of the djb hash
SCopyMem(ptr1, ptr2, len) - copy ptr2's data to ptr1
-This is an MMX optimized mem copy
...more string functions Compare, Len, Find, Replace etc.

When this is done I'm thinking about making it a C++ lib with dll2lib or some other program and then making a C++ class to wrap the functions in. I want a high speed string manipulation tool.

Any comments, input would be appreciated.
IE 'This is a waste of time' 'Good/Bad idea because ...'
Post 15 Apr 2005, 03:36
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Are you using VirtualAlloc for each string object? That would seem wasteful, not only because of the 4kb allocation granularity, but also because of the 64kb alignment and inability to easily ReAlloc...
Post 15 Apr 2005, 07:44
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy
I guess "dd 1" = "rd 1", "dd 4" = "rd 4" and so on? Very Happy
Post 15 Apr 2005, 11:02
View user's profile Send private message Visit poster's website Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
Yes Tommy I meant RD not DD Razz

F0dder then what would you suggest? Using heap or a filemapping?
Post 15 Apr 2005, 19:55
View user's profile Send private message AIM Address Yahoo Messenger 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.