Re: [cc65] Directory/Drive functions

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-06-11 22:21:32


On Wed, Jun 11, 2003 at 02:50:04PM -0400, Greg King wrote:
> I am not talking about a programmer's individual code for a specific
> program.  I am talking about the "universal" library-code.  It should not
> get in the way when programmers do make re-runnable programs.  (The library
> already restores other things, such as the stack-pointer, zero-page,
> vectors, a scroll-flag, and a margin.)  It takes only a few extra bytes to
> restore DEVNUM.  I see no valid reason to leave it out.

And I see no reason to restore it, since no one relies on it. The other
variables you have mentioned are saved and restored, because they must keep
their values for some reason or the other. This is not the case for DEVNUM and
several other things. One example is the video screen: One could argue that
the screen contents should be saved and restored, but the runtime library
doesn't do it - there's simply no reason for it.

My suggestion would be to ask the following question (in fact, this is the
question, I've asked when deciding if a save/restore of other variables is
necessary): Is there a need to save and restore this variable? If not, why
bother? Or better: Why waste code on it? I've put quite some work in sqeezing
out bytes from library functions. Why should we waste code in other areas?
IMHO "because there's no reason not do do it" is not a good reason.

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 : 2003-06-11 22:21:43 CEST