flat assembler
Message board for the users of flat assembler.

Index > Main > Array of struc?

Author
Thread Post new topic Reply to topic
d0z



Joined: 11 Oct 2005
Posts: 11
Location: Sweden
d0z 12 Oct 2005, 16:22
I guess this is a typical flaming subject but you can atleast give some usefull advice if you chose to do so.

I can't figure out how to setup an array of struc and then use them. This is what I have come up with so far.

Code:
struc Star_struct
{
        .X dw ?
        .Y dw ?
        .Z dw ?
        .old_pos dw ?
}                    
SizeofStar equ 8
MaxStars equ 200   
Star rb MaxStars*SizeofStar
    


This way Star reserves 200 Star_struct. And I have to increase Star's address to get to next element. But I want to use [Star.X] as addressing mode and only increase base address when I change to next Struc in the chain.

/Thanks
Post 12 Oct 2005, 16:22
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 12 Oct 2005, 18:19
Post 12 Oct 2005, 18:19
View user's profile Send private message Reply with quote
d0z



Joined: 11 Oct 2005
Posts: 11
Location: Sweden
d0z 12 Oct 2005, 19:42
It did, it's a little abstract using virtual but it works great.
Post 12 Oct 2005, 19:42
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.