flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > how do i do it?

Author
Thread Post new topic Reply to topic
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 25 Feb 2011, 17:53
Code:

struc _struct
{
.x dw ?
.y dw ?
.sizeof = $ - .
}



virtual at bx

_ms _struct

end virtual



mov ax, [_ms.sizeof]

    

I need to know how large is structure. How do i do it?

btw, what common/forward/reverse do to structure?
Post 25 Feb 2011, 17:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20449
Location: In your JS exploiting you and your system
revolution 25 Feb 2011, 18:04
You need to define the _ms label:
Code:
struc _struct
{
     .:
      .x dw ?
     .y dw ?
     .sizeof = $ - .
}    
b1528932 wrote:
btw, what common/forward/reverse do to structure?
Same as inside macro
Post 25 Feb 2011, 18:04
View user's profile Send private message Visit poster's website Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 25 Feb 2011, 19:06
ok, but in example is:

struc db [data]
{
common
. db data
.size = $ - .
}

ah ok, its a declatarion along with assignment, equal to .:, db data, .size.

thx.


is there any use for reverse/common/forward in struct? I know how to use it in macro, but in struct? I dont see the point.
Post 25 Feb 2011, 19:06
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.