Re: [cc65] optimizer?

Date view Thread view Subject view

From: Mike McCarty (
Date: 2001-06-25 19:57:52

On Sun, 24 Jun 2001, Ullrich von Bassewitz wrote:

> Hi!
> On Sun, Jun 24, 2001 at 05:55:45PM +0200, groepaz wrote:
> > just a quick question.... when i am using the assembler directly,
> > writing hand-coded assembler, am i able to use the peephole-optimizer
> > of the compiler ?
> >
> > i am asking because if not, i am going to convert the standalone
> > optimizer i was using before to support ca65's syntax ;=)
> The optimizer is built into the compiler and it makes several assumptions
> about the generated code, so it may not be used for generic assembler code. On
> the other side, I cannot remember having a need to run an optimizer over hand
> written assembler code. 
> As far as I understand it, the whole thing with hand written assembler code
> is, that it is optimized by the programmer.
> What would you expect such an optimizer to do? Can give me an example from
> your standalone optimizer? Maybe I need such a thing and don't know it:-)
> Regards

The kinds of "optimizations" I have used with hand-coded assembler are
those of selecting any of several equivalent instructions which take
less space or use fewer bytes. An example of this is automatically
selecting either "long" or "short" form jumps automatically, depending
on how far away the destination is from the jump.

char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I don't speak for Alcatel      <- They make me say that.

To unsubscribe from the list send mail to 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 : 2001-12-14 22:05:40 CET