flat assembler
Message board for the users of flat assembler.

Index > Windows > How do I define an array of structs?

Author
Thread Post new topic Reply to topic
pinny_woman



Joined: 29 Mar 2008
Posts: 9
pinny_woman
Hi,

I have this structure
Code:
struct TILE_INFO
        Hnd   dd ?
        x       dd ?
        y       dd ?
ends
    


I need to define Tile1, Tile2 ..... Tilex as TILE_INFO but can't figure how to do it Embarassed

There must be an easier way than
Code:
Tile1          TILE_INFO
Tile2          TILE_INFO
.
.
.
Tilex          TILE_INFO
    
Post 31 Mar 2008, 15:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17658
Location: In your JS exploiting you and your system
revolution
Code:
rept 10 x:1 {
  Tile#x TILE_INFO
}    
Post 31 Mar 2008, 15:51
View user's profile Send private message Visit poster's website Reply with quote
pinny_woman



Joined: 29 Mar 2008
Posts: 9
pinny_woman
omg, that was so quick Wink

Many thanks again revolution
Post 31 Mar 2008, 15:52
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17658
Location: In your JS exploiting you and your system
revolution
Your Q's can be answered from the fasm pdf in the download. But it seems it is sometimes faster to ask here Wink
Post 31 Mar 2008, 15:54
View user's profile Send private message Visit poster's website Reply with quote
pinny_woman



Joined: 29 Mar 2008
Posts: 9
pinny_woman
The main trouble I find with the manual, is knowing what to look for. Once you gave me the 'rept' then it's easy to get all the rest of the info from the manual Wink

Many thanks again
Post 31 Mar 2008, 16:32
View user's profile Send private message Reply with quote
pinny_woman



Joined: 29 Mar 2008
Posts: 9
pinny_woman
Having used the above, I don't think I asked for what I actually needed, lol.

My app will return an integer value as a pointer into the array of TILE_INFO structs, so, unless I go about it the long way

if eax==1 then tile1
else if eax==2 then tile2
etc

I have no way of making use of the structure.
Is there some way of defing the array so that if the returned value is 13 then I can access

tile.13.Hnd
tile.13.x
Tile.13y

thanks again
Post 01 Apr 2008, 07:38
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17658
Location: In your JS exploiting you and your system
revolution
Use an offset.
Code:
tile_array: rb 10*sizeof.TILE_INFO
...
imul eax,sizeof.TILE_INFO
mov ecx,[tile_array+eax+TILE_INFO.Hnd]    
Post 01 Apr 2008, 07:50
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Maybe we need another manual, a kind'o cheat-sheet. Some A4-formatted-PDF, where you have some tips.
Post 01 Apr 2008, 07:52
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17658
Location: In your JS exploiting you and your system
revolution
Madis731 wrote:
Maybe we need another manual, a kind'o cheat-sheet. Some A4-formatted-PDF, where you have some tips.
Yeah, that would be nice, do you have one prepared? Post it!
Post 01 Apr 2008, 07:54
View user's profile Send private message Visit poster's website Reply with quote
pinny_woman



Joined: 29 Mar 2008
Posts: 9
pinny_woman
Do you never sleep Rev¿
Seriously, when you come out of hiding I'll have to buy you a drink or 3.

Thanks for coming to the rescue again
Post 01 Apr 2008, 07:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17658
Location: In your JS exploiting you and your system
revolution
My auto answer robot software is working it's magic. I just sleep all day long and let the robot do the posting. So that means you will have to buy me an electron or 3. I like 100-240Vac, 50-60Hz.
Post 01 Apr 2008, 08:02
View user's profile Send private message Visit poster's website Reply with quote
pinny_woman



Joined: 29 Mar 2008
Posts: 9
pinny_woman
will 3-Phase do¿
Post 01 Apr 2008, 08:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17658
Location: In your JS exploiting you and your system
revolution
pinny_woman wrote:
will 3-Phase do¿
I only got three prongs on my feeding connector. The human here (sleeping at the moment) says one is called Earth, another called Neutral and one more called Phase. Phase is my favourite, it tastes yummy, so if you have three of them that sounds just super, but there is no where to put them all, only one Phase input Sad
Post 01 Apr 2008, 08:09
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:  


< 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.