flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > struc + virtual

Author
Thread Post new topic Reply to topic
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 04 Mar 2011, 05:01
i want to define a structure, and access it using a register.
Code:
use16


struc s1 _at*
{
virtual at _at

.:
.a dw ?
.b dw ?
.c dw ?

end virtual
}


struc s2 _at*
{
virtual at _at

.:

.mys1 s1 $ - .
.mys11 s1 $ - .
.mys111 s1 $ - .


end virtual
}



mys2 s2 di

mov ax, [mys2.mys11.c]

purge mys2

    

is it a good way? can i nest virtual inside struc, and is i nest this struct in another use $?
when i have multiple nested structures, address of each one is equal to sum of passed elements. is my code ok?
Post 04 Mar 2011, 05:01
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.