flat assembler
Message board for the users of flat assembler.

Index > Windows > External Data

Author
Thread Post new topic Reply to topic
msmith



Joined: 22 Jun 2003
Posts: 40
Location: Missouri
msmith
How do you declare data (initialized or uninitialized) in a dll that will actually reside in the the calling program?
Post 14 Jun 2006, 05:20
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Data in dlls is relocated each run. It means there's no fixed pointer to such memory place. One solution I see is exporting a function which will return a pointer to the data.
Post 14 Jun 2006, 15:23
View user's profile Send private message Visit poster's website Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav
i think he means how to export constant variable from '.data' section
Post 15 Jun 2006, 11:12
View user's profile Send private message Reply with quote
msmith



Joined: 22 Jun 2003
Posts: 40
Location: Missouri
msmith
I use FASM as a backend to my compiler. The compiler handles both console and graphic mode.

An example of what I was asking about might be a prestored CRLF string and its dope block.

Like Reverend says, the data is reloaded each time the pgm is run, so if the code in the dll tries to reference the CRLF dope block in the calling pgm, it wont know where it is (or if it even exists).

It looks like the best thing to do is create the prestored stuff in each dll so each dll has its own copy of all the common compiler vars.

Another one is STATUS which is a global var (dword) that stores the result of many functions (especially I/O) for reference by the compiler user to see if the operation was successful.

I hope this explains it better.
Post 16 Jun 2006, 02:47
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.