flat assembler
Message board for the users of flat assembler.

Index > Main > Can I declare a qqword label in struct?

Author
Thread Post new topic Reply to topic
tripledot



Joined: 06 Jan 2009
Posts: 49
tripledot 14 Apr 2012, 18:02
I'm sure I'm missing something obvious...

Code:
struct  Foo
        bar     dq      4 dup ?
ends

vmovapd ymm0, [Foo.bar] ; Error: operand sizes do not match
vmovapd ymm0, qqword [Foo.bar] ; Assembles OK
    


I'm getting a bit fed up of qualifying every memory operand with "qqword". Is there a way of defining a label inside a struct that fasm "knows" is a qqword, so I don't have to specify an operand size override?
Post 14 Apr 2012, 18:02
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 14 Apr 2012, 18:37
No, currently the "struct" macro does not have such facilities. You would have to go with the low-level "struc" approach:
Code:
struc Foo {
  label .bar qqword
             dq 4 dup ?
}

virtual at 0
  Foo Foo
end virtual

vmovapd ymm0,[Foo.bar]    
Post 14 Apr 2012, 18:37
View user's profile Send private message Visit poster's website Reply with quote
tripledot



Joined: 06 Jan 2009
Posts: 49
tripledot 14 Apr 2012, 18:40
Gotcha. I hardly ever use "struc"; I rely on "sizeof" quite a lot. I'll just grin and bear it, it was only a small gripe.

BTW, thanks for the latest version! Stupendously good service, as always! Smile
Post 14 Apr 2012, 18:40
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 14 Apr 2012, 19:10
Another way is to define the label independently:

Code:
struct  Foo
        bar     dq      4 dup ? 
ends
label Foo.qqBar qqword at Foo.bar

vmovapd ymm0, [Foo.qqBar]    
Post 14 Apr 2012, 19:10
View user's profile Send private message Reply with quote
tripledot



Joined: 06 Jan 2009
Posts: 49
tripledot 14 Apr 2012, 19:20
Aha! That I like. Thanks, l_inc!
Post 14 Apr 2012, 19:20
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.