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

From: Daniel Serpell <>
Date: 2009-11-27 01:07:58

On Thu, Nov 26, 2009 at 1:16 PM, Ullrich von Bassewitz <> wrote:
> I see the portability argument (thanks for pointing this out), so contrary
> what I wrote before, I do now opt to leave the uppercasing in place. I'm still
> concerned about the size of the routine, but maybe we can get this under
> control by other measures.

But currently, the size of ucase_fn is not that big, after my las patch that
allocates a fixed 128 byte buffer for the uppercased filename in BSS, this
is the sizes of the bigger modules loaded in my "fileio.c" test:

  45  atari.lib(rwcommon.o):   CODE
  48  atari.lib(dosdetect.o):  INIT
  56  fileio.o:                CODE
  66  atari.lib(getfd.o):      CODE
  70  atari.lib(ucase_fn.o):   CODE
  80  atari.lib(getdefdev.o):  CODE
 106  atari.lib(fputs.o):      CODE
 118  atari.lib(crt0.o):       STARTUP
 123  atari.lib(_fopen.o):     CODE
 173  atari.lib(open.o):       CODE
 256  atari.lib(ctype.o):      RODATA
 408  atari.lib(fdtable.o):    CODE
2133  TOTAL

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.

> Another idea (just for discussion) is to supply two modules: A do-nothing one,
> which is enabled by default, and a second one, that may be linked in using -u
> on the linker command line. Linking in the second module will enable
> uppercasing of filenames. This is similar to the current solution, but the
> programmer may choose without having to use a modified runtime library. This
> would need a highlighted warning in the Atari docs: "If you want to support
> SpartaDOS 2.5 (or whatever it was), you MUST link with -u foobar".

In fact, the prepending of the drive letter is necessary on all DOSs,
so the only
way the "simple" code could work is using "D:" in front of every filename,
including the  tgi drivers, etc. And if we need prepending something to the
filename string, uppercasing it is not a big deal, I think.

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Nov 27 01:08:08 2009

This archive was generated by hypermail 2.1.8 : 2009-11-27 01:08:10 CET