The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Ghirai on January 02, 2006, 11:17:37 AM

Title: Strings array question
Post by: Ghirai on January 02, 2006, 11:17:37 AM
Hey, i'd like some opinions/suggestions.

I have an array of say 3 strings, and another array with 3 dwords.
The strings in the array have different lenghts.

What would be the best way to extract pairs (2nd string and 2nd dword)?

I was thinking of declaring the string array something like aaa db 4,"Blah",9,"Something",5,Hello" (each string len is known at compile time).

What do you think? How do you suggest i do this?

Thanks.
Title: Re: Strings array question
Post by: ramguru on January 02, 2006, 12:33:05 PM
Hi, I like your idea, so I've coded it. Don't know is it fast or not, have a look at attachment... BTW there is a limitation string can't exceed 0ffh characters, but of course it's piece of cake to set the limit to 0ffffh characters...

[attachment deleted by admin]
Title: Re: Strings array question
Post by: hutch-- on January 02, 2006, 12:39:33 PM

.data
  st1 db "string1",0
  st2 db "string2",0
  st3 db "string3",0

  pstr dd st1,st2,st3  ; string array.
Title: Re: Strings array question
Post by: Ghirai on January 02, 2006, 05:01:50 PM
Great, thanks guys :U