flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > A field of a structure of type of other structure

Author
Thread Post new topic Reply to topic
jorido



Joined: 23 Jan 2017
Posts: 35
A field of a structure of type of other structure
How can I define or declare a structure in which some members are of type of a pointer other structure? Something like:


Code:

; these are defined
;MyStruct2
;MyStruct3



struc MyStruct {
    .a db ?
    .b dw ?
    .c MyStruct2 ;??? pointer to MyStruct2
    .d MyStruct3 ;??? pointer to MyStruct3
}





1. Should ib be "dd ?" ?
2. What if it were not a pointer, but just a struct itself -- value in C?
Post 04 Feb 2017, 18:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14585
Location: Planet Dirt
For struc you can just use .c dd ? to point to somewhere.

If you want to embed the structure then just do what you have above .c SomeStruc <optional parameters>

BTW: This is one of the areas where struct and struc differ.
Post 05 Feb 2017, 03:50
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.