Re: [cc65] 6502.h

Date view Thread view Subject view

From: Piotr Fusik (P.Fusik_at_elka.pw.edu.pl)
Date: 2003-01-13 18:44:05


Hi,

My "philosophy" is that if I don't know how something works, I keep it
unchanged, not clear it. :)
In 65CE02 bit 5 enables 8-bit stack pointer (default compatibility mode).
If you clear it, you enable 16-bit stack pointer.
So why not change:
	lda	(ptr1),y
	and	#%11001111
to:
	php
	pla
	eor	(ptr1),y
	and	#%00110000
	eor	(ptr1),y
? That's only 4 bytes and 12 cycles more.

Piotr

On Thu, 9 Jan 2003, Ullrich von Bassewitz wrote:

> On Thu, Jan 09, 2003 at 03:20:42PM +0100, Piotr Fusik wrote:
>
> > Ok, but why do you think that clearing (and not setting) them is always
> > good?
>
> This is getting more and more a philosophical discussion, since these values
> are ignored by a 6502 CPU anyway:-) I'm resetting anything that I don't want
> to be set. I think this is good practice, even if it may be superflous in the
> given case. Why do you think that the AND is evil in this place?
>
> > Maybe we should dig in some 65xx docs to know possible uses of these bits?
>
> They are only used on CPUs not supported by cc65, so we don't need to care
> about that, I think.
>
> 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.
>

----------------------------------------------------------------------
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-01-13 18:46:23 CET