Re: [cc65] ca65 syntax problems

Date view Thread view Subject view

From: Mike McCarty (jmccarty_at_ssd.usa.alcatel.com)
Date: 2001-11-07 17:39:55


On Wed, 7 Nov 2001, Ullrich von Bassewitz wrote:

> On Tue, Nov 06, 2001 at 02:00:23PM -0600, Mike McCarty wrote:

> [...]
> > In this way, file1.asm does not have to have embedded knowledge of the
> > names of the external addresses used, or even which ones are actually
> > present.
> 
> Well, yes. One could use it for this purpose. But the problem is rare and can
> be solved by other means.

I was addressing the question as asked: What possible use is there? This
is one use I have put such a feature to.

> > Another, more mundane use, is to implement placing things in a
> > relocatable area, but on an address which is divisible by some
> > particular size, especially if the assembler does not support an .align
> > to that size. For example, suppose some piece of the code must reside at
> > an address divisible by 16, and no .align 16 directive exists.
> 
> This is hard to solve, since the assembler does not know how much space is
> actually inserted by such an .org command. We had this problem some time ago,
> when we talked about short branch optimization in the assembler: The assembler
> has to emit completely relocatable code (that is no constant values at all)
> and all address resolving has to be done by the linker. This would add
> complexity and delay several warnings/errors until linking occurs. 

"Hard" is not the word I would use. I would say "Lots of work to add."
I recall the discussion very well.

> And ca65 does allow .align in powers of two up to 2^16.

That's nice. Why the restriction to powers of 2? Why not allow

    .align  27

if the size of a structure happens to be 27? It seems to me that the
code in the assembler would be the same.

Since CC65 and the ancillary tools are freeware, and you own them, then
they contain exactly those features which you are sufficiently
motivated to put in. This is as it should be. If this is one which you
prefer not to put in, that's fine. This does not mean that the feature
is a useless one. There are other uses I could list, but I think that
these two are sufficient to show that it is not useless.

Mike
-- 
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 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 : 2001-12-14 22:05:44 CET