I have a >2550 line BX-24 project which compiled to ~26K with BasicX.
It compiles to 16K with ZBasic.
Is this for real?
compiled size
Yes this is for real. ZBasic produces much more compact code than BasicX. The reason is that many functions in BasicX are expanded out to inline code. BasicX has 122 system library functions, 48 of which are implemented as extra code.
ZBasic has a much larger flash memory so these functions and more are all implemented in the runtime - hence the compiled code is much smaller.
I have examined the details of the BasicX internals and explain more about this in part 3 and part 4 of my series of articles http://home.austin.rr.com/perks/micros/Articles/.
ZBasic has a much larger flash memory so these functions and more are all implemented in the runtime - hence the compiled code is much smaller.
I have examined the details of the BasicX internals and explain more about this in part 3 and part 4 of my series of articles http://home.austin.rr.com/perks/micros/Articles/.
Mike Perks
That's because with BasicX the .bxb file is a memory image whereas with ZBasic the .zxb is an Intel Hex format file. This standard format (with some extensions) was chosen because it is checksummed. The disadvantage is that downloading takes longer.With BasicX the reported compile size and .bxb file size were the same. With ZBasic the IDE reports 16K but the .zxb file is 47K.
Each record holds a maximum of 16 data bytes and there are 13 bytes of overhead for each record. Consequently, the size of a .zxb file will be approximately (size * 2) + INT((size +15) / 16) * 13.
- Don Kinzer