gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Question about the influence of includes to the Binaries

#87225 - Edelnutte - Mon Jun 12, 2006 7:08 pm

Hello it may be a question easy to answer but I have no Idea about Compilers or how they work.
I know that the use of include files slows down the Compiling process (I don't care I run a pretty fast processor)
But does the use also slows down the Binary file? Someone told me that but I'm a little bit sceptic. It would be very nice to get an answer on that Question and maybe someone could even give me a link so I can Understand Compilers an Linkers and Stuff.

Edit: I would use the Include files for copying data to V-ram because I have to switch the Tiles very often and I also mix up the palettes so I have much and big functions

#87241 - Cearn - Mon Jun 12, 2006 8:24 pm

Edelnutte wrote:
Hello it may be a question easy to answer but I have no Idea about Compilers or how they work.
I know that the use of include files slows down the Compiling process (I don't care I run a pretty fast processor)
But does the use also slows down the Binary file? Someone told me that but I'm a little bit sceptic.
In principle, the data is still the same no matter how its compiled (would be odd if it were, no?). In practice, #including data may be slower because of other things like alignment problems. Data that's put on word boundaries (addresses divisible by 4) allow for faster copies. #including isn't directly responsible for mis-alignments, but it does make it more likely than having separate files for data.

Edelnutte wrote:
It would be very nice to get an answer on that Question and maybe someone could even give me a link so I can Understand Compilers an Linkers and Stuff.

tonc:on data.
Everything you never wanted to know about data and build steps. Well alright maybe not, but it might help you get an idea of what goes on.

#87263 - tepples - Mon Jun 12, 2006 11:19 pm

If you have a lot of data, and you would otherwise want to convert it to C and #include it, you'd probably have an easier time converting it to assembly language using the 'bin2s' tool.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.