Re: [cc65] Memory impact of Atari library compile time defines

From: Daniel Serpell <daniel.serpell1gmail.com>
Date: 2009-11-27 02:13:53
Hi!,

replying to myself...

On Thu, Nov 26, 2009 at 9:07 PM, Daniel Serpell
<daniel.serpell@gmail.com> wrote:
>
> As you see, the two bigger are "fdtable.o" and "ctype.o". The last one is
> used by the uppercasing, causing the program to get 256 bytes bigger when
> including the uppercasing routines. But ctype is also a very common module,
> I don't think is worth removing, but perhaps a simple code to substract 64 to
> all chars from 97-125 is better.

I implemented that on top of my previous patches, turns out that with the
simple comparisons the code is smaller than using ctype, so here is a
patch (over current SVN) that adds:

 - Use a fixed buffer in BSS for the uppercasing buffer,
 - Use a simple comparison (bmi followed by cmp and bcc) for the
   uppercasing.

With this, current sizes of my test programs are:

-rw-r--r-- 1 daniel daniel  284  2009-11-26 21:59 empty-atari
-rw-r--r-- 1 daniel daniel 1884  2009-11-26 21:59 fileio-atari
-rw-r--r-- 1 daniel daniel 2716  2009-11-26 21:59 printf-atari
-rw-r--r-- 1 daniel daniel  786  2009-11-26 21:59 put-atari
-rw-r--r-- 1 daniel daniel  335  2009-11-26 21:59 empty-c64
-rw-r--r-- 1 daniel daniel 1981  2009-11-26 21:59 fileio-c64
-rw-r--r-- 1 daniel daniel 2688  2009-11-26 21:59 printf-c64
-rw-r--r-- 1 daniel daniel  749  2009-11-26 21:59 put-c64

So, now fileio is smaller in atari than on c64!

    Daniel.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Nov 27 02:14:00 2009

This archive was generated by hypermail 2.1.8 : 2009-11-27 02:14:02 CET