Hamurabi, ZBasic from Applesoft, Part Two

I went back and looked at the file sizes of both the Applesoft and Zbasic from Applesoft versions of Hamurabi.

The Applesoft version was 8 blocks on the diskette.  Add to that 32 blocks for PRODOS and 21 blocks for BASIC.SYSTEM  you end up with a minimum of 61 blocks to run the Applesoft version of Hamurabi.

The Zbasic version takes 9 blocks before compiling.  If you want to run it as a standalone program it takes 27 blocks after compiling.  Now add 32 blocks for PRODOS, 13 blocks for RT.AUX.OBJ0, 14 blocks for RT.AUX.OBJ1, and 11 blocks for RT.MAIN.OBJ1 and you end up with 97 blocks.

The text version that I used to convert from Applesoft to Zbasic was 11 blocks meaning both versions use some sort of compression or tokenization to save 2 or 3 blocks with this program.

There is a size difference of 36 blocks between the Applesoft and the Zbasic version.

The Applesoft version is an interpreted program and the Zbasic version is compiled to machine code at this point and is presumably faster than the Applesoft version.  Can you tell the difference?  I don’t think there is any way to measure it with this program.

Is one version more readable than the other?  Not at this time.  There were virtually no real changes between them.  Is there any reason you would want to compile a program like this?  Yes, you might want to hide the code a little bit.  As with any programming project, you have to weight the pros and cons of the language, for your project.

 

Posted in Apple //c, Programming, Projects Tagged with: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*