flat assembler
Message board for the users of flat assembler.

Index > Main > Specifying struct type in "extrn"

Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 09 Feb 2010, 08:31
Hi guys,

(another question from a former MASM user Smile)

Is it possible in FASM to declare the type for an "extrn" variable?


Code:
extrn  p1:sMyStruct


mov  eax, [p1.field_in_MyStruct]

    


It seems that FASM doesn't like the "extrn p1:sMyStruct" Sad

Not sure if there is a workaround for it.

Thanks!
Post 09 Feb 2010, 08:31
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 09 Feb 2010, 09:06
alorent,

FASM doesn't like p1.field_in_MyStruct too, unless told to. Wink
Use something like
Code:
extrn "p1" as extrn_p1
virtual at extrn_p1
  p1 sMyStruct
end virtual    
Post 09 Feb 2010, 09:06
View user's profile Send private message Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 09 Feb 2010, 10:45
Thanks baldr!

You are very good Wink

I was wondering if there is any way to overload the "extrn" macro so it contain all your above code.

I guess that it doesn't look nice to declare 10 extern symbols and we have to include all your above code for each extrn Wink

Anyway, thanks again!
Post 09 Feb 2010, 10:45
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.