Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
compiled size

 
Post new topic   Reply to topic    Forum Index -> ZBasic IDE
Author Message
DH*
Guest





Posted: 07 January 2006, 15:21 PM    Post subject: compiled size Reply with quote

I have a >2550 line BX-24 project which compiled to ~26K with BasicX.

It compiles to 16K with ZBasic.

Is this for real?
Back to top
mikep



Joined: 24 Sep 2005
Posts: 771
Location: Austin, TX

Posted: 07 January 2006, 16:54 PM    Post subject: Reply with quote

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/.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 07 January 2006, 17:05 PM    Post subject: Reply with quote

The size difference that you observed is atypical. It is more common to see a reduction in the 10% to 25% range but in some cases I have seen a very large difference and in some, virtually no difference.
Back to top
DH*
Guest





Posted: 07 January 2006, 21:23 PM    Post subject: Reply with quote

I'm impressed. I use the free EEPROM for data and was hoping to gain 1-2K but this will let me add some desired features as well.
Back to top
DH*
Guest





Posted: 13 January 2006, 20:00 PM    Post subject: Reply with quote

Now I'm confused.

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.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 13 January 2006, 20:25 PM    Post subject: Reply with quote

Quote:
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.


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.

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic IDE Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group