Re: [cc65] More size reductions to atari libs

From: Daniel Serpell <daniel.serpell1gmail.com>
Date: 2009-12-05 22:33:01
Hi!

On Sat, Dec 5, 2009 at 5:45 PM, Shawn Jefferson <sjefferson@shaw.ca> wrote:
> Nice work!  I was wondering though, about :
>
>>  p2: Don't use _strupr to uppercase filename, use shorter inlined loop.
>
> Would this make programs that use strupr to become slightly larger than
> otherwise?  Not that I think it makes much difference really, and would be
> compensated by the other size savings, in the case that someone uses that
> function.

Yes, but in the third patch I merged the copy loop with the uppercasing
loop, so at the end I'm replacing the 7 bytes of the call:

       ldx     sp+1
       lda     sp
       jsr     _strupr

with the 10 bytes of the added code inside the copy:

       bmi     L1
       cmp     #'a'
       bcc     L1
       and     #$DF
       sta     (sp),y

So, a program that uses strupr will be exactly 3 bytes larger than
before.

The problem is that strupr is a lot bigger because it needs to work
with strings of more than 256 bytes, and also uses ctype to be
general.

    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 Sat Dec 5 22:33:16 2009

This archive was generated by hypermail 2.1.8 : 2009-12-05 22:33:18 CET