Re: [cc65] Variables + Local Static

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2007-08-21 12:49:43
On Mon, Jul 23, 2007 at 02:53:30PM -0400, German Gonzalez wrote:
> in different functions, but I got an error "too many local variables"
> then I use the -Cl to make local variables static.

There is a bug in cc65 that causes it to allocate space on the stack even if
locals should be made static.

> 1. if I used a global variable, may it be more efficient regarding
> memory management, because a reuse the same memory address for my
> calculation (the loops themselves).

Accessing static variables is cheaper, because no index register is involved.
Auto variables (on teh stack) are also reused.

> 2. if I used too many "static local variables" then the linker doesn't
> found more labels, that's because I run out of memory?

See above, it's a bug.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Aug 21 12:49:54 2007

This archive was generated by hypermail 2.1.8 : 2007-08-21 12:49:57 CEST