BSS section affecting tap file size

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
sdolotom
New member
Posts: 7
Joined: Mon Mar 08, 2021 1:15 pm

BSS section affecting tap file size

Post by sdolotom »

Hi, I was under impression that BSS section just declares a size of memory to allocate on start without actually saving any data to the result binary.
For example:

Code: Select all

    uint8_t buffer[1000];
should not affect the result binary size. However, that's not the case for my code, 1000 zeros are added to the result. I also tried to explicitly define the section:

Code: Select all

SECTION bss_user
PUBLIC _buffer

_buffer: defs 1000
with the same result. What am I missing?
sdolotom
New member
Posts: 7
Joined: Mon Mar 08, 2021 1:15 pm

Re: BSS section affecting tap file size

Post by sdolotom »

ORG -1 in the bss section seems to solve it, is that the correct way?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: BSS section affecting tap file size

Post by dom »

I think BSS has always been included in the binary unless a ROM is being generated.

For RAM compiles I can see why it's annoying. I have a hunch that adding an option to do as you're doing may cause issues for some classic platforms: in particular those ones that rearrange the binary on load to resolve paging conflicts which I'd need to check out before officially adding this feature.
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: BSS section affecting tap file size

Post by Timmy »

If you just make it optional (and NOT default) then it's probably fine.

I'm certainly not planning to use this feature, how well intentioned that may be. The tap filesize is the only way I have, to see how large the loading part is, I'd rather not want to sacrifice it.
Post Reply