The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: axmt on June 22, 2006, 05:15:38 AM

Title: List?
Post by: axmt on June 22, 2006, 05:15:38 AM
Hi,
I want to dynamically populate a list of strings.
How do I go about doing it?
I want to do the following -
1. Create a List like structure whose size will be dynamic
2. Add custom structs to this list and traverse it forward and backward

Thanks,
axmt.
Title: Re: List?
Post by: gwapo on June 22, 2006, 05:33:11 AM
Generally these are implemented as a LinkedList or HashTable., I don't know of any assembly implementation though, probably there's one in MASM32.

\
-chris
Title: Re: List?
Post by: hutch-- on June 22, 2006, 06:29:29 AM
It sounds like a database design that has variable length fields in it. tell us a bit more about how you want to use it but it sounds like an algo design rather than just coding something.
Title: Re: List?
Post by: axmt on June 22, 2006, 06:37:56 AM
Hi,
I am trying to make a vocabulary builder utility.
So I have words and their meaning stored in a text file.
I read the File during initialization and want to store each word - meaning pair in an 'Entry' struct.
These structs will be added to the list.The number of entries will depend on number of pairs in text file hence the list size should be dynamic.
In the UI there will be a back and forward button to traverse through the list.

I am coming from a C,C++,Java background, there are List abstractions available in the libraries which are useful in a number
of scenarios.
So I am trying to figure out how to design a similar functionality in win32asm.

Thanks,
axmt
Title: Re: List?
Post by: asmfan on June 22, 2006, 06:51:03 AM
Just create an appropriate dynamic queue of structs. Each struct contain one or more pointers on neighbours and data itself of course. And may be some other info...hash or CRC...
Title: Re: List?
Post by: zooba on June 22, 2006, 10:13:57 AM
A while ago I created a generalised linked list implementation. In reality, it's a linked array list, in that each item is a fixed size array of the items, cutting down on fragmentation and allocation times.

I've attached the source, compiled library (LinkedList.lib) and a sample/test program (Tester.asm). Feel free to modify it for your own use, but it should be general enough to easily do what you want.

Cheers,

Zooba :U

[attachment deleted by admin]
Title: Re: List?
Post by: axmt on June 22, 2006, 11:22:11 AM
Thanks zooba  :U
Am checking it out.
Thanks for your help guys  :8)