[cc65] Optimization ideas

From: Dan <opendtv1yahoo.com>
Date: 2007-06-21 09:16:54
Here are some ideas for optimizations that could be
implemented relatively easily:

1. Save/restore "register" (zero page) variables with
a JSR to a subroutine, such as:

[...more...]
save3:
    dey
    lda regbank+2
    sta (sp),y
save2:
    dey
    lda regbank+1
    sta (sp),y
save1:
    dey
    lda regbank
    sta (sp),y
    rts
[...more...]
restore3:
    lda (sp),y
    sta regbank+2
    dey
restore2:
    lda (sp),y
    sta regbank+1
    dey
restore1:
    lda (sp),y
    sta regbank
    rts

I wonder if there's any way to trick the linker into
automatically selecting a routine of exactly the right
size?

2. Implement a second "register" area in zero page
that would only be used by leaf functions (i.e.
functions that don't call other functions). These
would not need to be saved/restored.

3. Automatically assign local pointer/char/int
"register" status, and increase the default maximum
(only 6 bytes?)

Comments?

Dan



       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jun 21 09:17:05 2007

This archive was generated by hypermail 2.1.8 : 2007-06-21 09:17:08 CEST