Re: [cc65] Problem with .align

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2011-06-09 13:00:35
Hi!

On Thu, Jun 09, 2011 at 06:56:47AM +0300, thefox xofeht wrote:
> Kind of related... is it possible to find out somewhere how many bytes
> are wasted because of aligning?

Inside the module: Just look at the assembler listing. 

Alignment added by the linker: Generate a map file and enable "verbose map" by
-vm. The modules list will show the offsets and sizes of date that goes into a
specific segment. For your example, it looks like this:

Modules list:
-------------
collision.o:
    CODE              Offs = 000000   Size = 000000
    RODATA            Offs = 000000   Size = 000000
    BSS               Offs = 000000   Size = 000000
    DATA              Offs = 000000   Size = 000000
    ZEROPAGE          Offs = 000000   Size = 000000
    NULL              Offs = 000000   Size = 000000
    CODE1             Offs = 000000   Size = 0002A3
map.o:
    CODE              Offs = 000000   Size = 000000
    RODATA            Offs = 000000   Size = 000000
    BSS               Offs = 000000   Size = 000000
    DATA              Offs = 000000   Size = 000000
    ZEROPAGE          Offs = 000000   Size = 000000
    NULL              Offs = 000000   Size = 000000
    CODE1             Offs = 000400   Size = 001792

What you can see is that collision.o starts the CODE1 segment at offset $0 and
emits $2A3 bytes, but the following module, map.o starts at offset $400, so
actually $400-$2A3 = $15D bytes are wasted (this is also the number I
mentioned in my previous mail:-).

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jun 9 13:00:48 2011

This archive was generated by hypermail 2.1.8 : 2011-06-09 13:00:51 CEST