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.

Beginners > What defines the output image size?

#11269 - yaustar - Tue Sep 30, 2003 4:36 pm

Is it the amount of code or the operations used witin the code?
_________________
[Blog] [Portfolio]

#11270 - sajiimori - Tue Sep 30, 2003 7:31 pm

Are you asking what determines the size of a compiled ROM image? The final size is essentially the sum of the sizes of the objects you link in. Object files contain code and/or data, so their size obviously depends on how much code or data there is.

It seems like you're looking for some other answer, but I'm not sure what it is.

If you're interested in code size, it's pretty easy when it comes to ARM or Thumb assembly. The size of a set of 32-bit ARM instructions is the number of instructions times 4 bytes, and obviously half that for Thumb.

If you're interested in how many instructions a C file will compile to, it depends on the file and the compiler, but you'd normally expect longer C files to compile to more assembly code.

#11271 - yaustar - Tue Sep 30, 2003 7:48 pm

thanks, if the image depends on the amount of code then that's the answer to my question.

Cheers
_________________
[Blog] [Portfolio]

#11277 - tepples - Wed Oct 01, 2003 12:44 am

In general, the amount of space taken up by assets (art, maps, audio samples, and music) will overwhelm the amount of space taken up by code. Even in a simple game such as Tetanus On Drugs, I have 37 KB of code and 115 KB of assets.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.