From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2001-11-07 17:53:12
On Wed, Nov 07, 2001 at 10:39:55AM -0600, Mike McCarty wrote:
> 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.
For one, just the exponent of the alignment is stored in the object file which
saves a byte here and there. Second, for the alignment to work, the base
address of the segment that contains the alignment, must be aligned itself.
Allowing arbitrary alignments requires a lot more checking. If for example
your code contains alignments of 27, 23 and 7, the linker has quite some work
to figure out the necessary alignment for the segments base address. This is
easier when using powers of two, since all that is needed is to use the
largest exponent. And least, I didn't see any special need for other
alignments. One can always put the data in it's own segment and use the linker
config to place this segment wherever it is needed.
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.
This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:44 CET