Re: [cc65] statics in zero page

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-05-21 17:13:15


Hi!

On Tue, May 21, 2002 at 04:49:19PM +0200, Christian Krüger wrote:
> In my opinion the option is like 'register' ore 'inline' just a
> recommendation
> for the compiler to do things in users mind...

Yeah, but the compiler does not know how much zero page space is available -
this is only known to the linker. And the linker on the other side is not able
to change zero page addresses back to absolute ones.

> BTW: 'inline' would be a very neat cc65 enhancement, since there are many
> disadvantages in using macros...

Yes, I agree.

> Of course. I also think that things get a little bit more complicated for
> the linker (what ZP's are necessary which are only nice to have...), 

How do you think the linker should handle the case "48 bytes of zero page
space were allocated, but only 35 bytes are available"? I would say, any other
solution than just refusing to link successfully is much more than just "a
little more complicated":-)

> but
> from an other point of view: Why should I abstain from a little speed gain
> if there is zero page space left?

A possible solution is to declare and export the variables from an assembler
file, and import them as zero page variables into the C modules by using the
"#pragma zpsym" statement.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-05-21 17:13:19 CEST