Re: [cc65] size of .enum?

From: <silverdr1wfmh.org.pl>
Date: 2013-03-31 16:57:36
On 2013-03-31, at 12:06, Ullrich von Bassewitz wrote:
>> On 2013-03-30, at 18:26, Ullrich von Bassewitz wrote:
>>> .segment        "MYZP" : zeropage
>>> var0:   .res    1
>>> var1:   .res    2
>>> var2:   .res    4
>>> ...
>>> varn:   .byte   0
>> 
>> Unfortunately it doesn't look so nice when I want to .exportzp this. In file
>> "zp_variables.s" I have now something like:
> 
> Use an include file like this:
> 
> ---------------------------------- zp.inc ----------------------------------
> .globalzp       te_counter
> .globalzp       he_counter
> ----------------------------------------------------------------------------
> 
> You might have noticed that I hadn't used .res in my example above,

Actually I thought I noticed that you did ;-)

> and this
> is also my suggestion for you, since .word etc. are more readable in my eyes.

I agree. It is just in a WIP state now.

> So your .s file will look like this:
> 
> ----------------------------------- zp.s -----------------------------------
> .include        "zp.inc"
> 
> .segment        "ZP_VARIABLES": zeropage
> 
> te_counter:     .byte   0
> he_counter:     .byte   0
> ----------------------------------------------------------------------------
> 
> Doesn't this look clear and well arranged? :-)

Definitely! It looks much better. But my problem with this approach is that it is not DRY, which is what I am always aiming at. Especially when codebase is far from being stable and is very likely to be changed multiple times soon.

> As thefox has already noted, __XXX_LAST__ is defined for the memory area, not
> for the segment. Be sure to discard the contents of this memory area by
> specifying an empty file name.

I placed

file = ""

in the linker config but now I checked and didn't notice any difference in the final executable size with and without this "file" attribute.
-- 
SD!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Mar 31 16:57:46 2013

This archive was generated by hypermail 2.1.8 : 2013-06-15 17:37:38 CEST