flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > data and code section combining

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 28 Jan 2005, 22:29
Is there a way to make FASMW combine all like sections '.code' and '.data' sections into one 'area'? Smile Like if I have 3 data sections in my program, fasm would combine them all into one, same thing with code sections. Would this be to complicated to do? Confused
MadMatt
Post 28 Jan 2005, 22:29
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 28 Jan 2005, 23:32
No. At least there is no general way.
But IMHO, you wrongly ask here for a means, not for an aims.
What you actually want to achieve?
Probably there is pretty good solution in FASM style. Smile

Regards.
Post 28 Jan 2005, 23:32
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin 29 Jan 2005, 06:20
madmatt,
for data section there is a good way to use 'globals.inc' from Freshlib Smile It can be easily used. And I think in that way you can write your own macros for code sections Smile Thanx JohnFound for this macros and for all Freshlib! Smile
Post 29 Jan 2005, 06:20
View user's profile Send private message ICQ Number Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 29 Jan 2005, 06:55
any linker can do that Smile
Post 29 Jan 2005, 06:55
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 29 Jan 2005, 10:43
The reason I ask is because when working on the .dll library for the Windows game programming for dummies examples, I had multiple .data sections, and when I combined them into a single one it saved me ~3kb from a 55kb sized file. So that is why I ask.
MadMatt
Post 29 Jan 2005, 10:43
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8357
Location: Kraków, Poland
Tomasz Grysztar 29 Jan 2005, 11:23
Post 29 Jan 2005, 11:23
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 29 Jan 2005, 11:28
madmatt wrote:
The reason I ask is because when working on the .dll library for the Windows game programming for dummies examples, I had multiple .data sections, and when I combined them into a single one it saved me ~3kb from a 55kb sized file. So that is why I ask.
MadMatt


As iklin said, "globals.inc" was writen exactly with purpose to solve the problems with data definitions, spreaded in the source. It automatically order your data definitions to put undefined data at the end.

You can use "globals.inc" with every source, it is not depending on FreshLib.

Regards.
Post 29 Jan 2005, 11:28
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 30 Jan 2005, 01:27
Looked at the message threads, and see some macro's there. So these macro's will gather all my data sections into one data section when I use them?
Post 30 Jan 2005, 01:27
View user's profile Send private message Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin 30 Jan 2005, 10:26
madmatt wrote:
Looked at the message threads, and see some macro's there. So these macro's will gather all my data sections into one data section when I use them?


Yes. Use
Code:
uglobal
...
endg

iglobal
...
endg
    

in any place of sources and
Code:
IncludeAllGlobals
    

in place there you want your data.


Description: globals.inc from freshlib
Download
Filename: globals.rar
Filesize: 1.65 KB
Downloaded: 855 Time(s)

Post 30 Jan 2005, 10:26
View user's profile Send private message ICQ Number Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 31 Jan 2005, 09:25
All Right, downloaded the macros, will give them a try shortly.
Thanks to everyone,
MadMatt
Post 31 Jan 2005, 09:25
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.