Re[2]: [cc65] Graphics library

Date view Thread view Subject view

From: groepaz (
Date: 2001-08-17 11:16:28

Hello Ullrich,

Friday, August 17, 2001, 10:59:59 AM, you wrote:

UvB> On Wed, Aug 15, 2001 at 11:46:00PM +0200, groepaz wrote:
>> yes, i am thinking about converting those case-constructs to
>> jump-via-function-pointers aswell... BUT what i am asking is, would
>> the linker be able to fill out that jumptable at link-time? or would
>> an init-function that checks the modules included and sets up the
>> jumptable accordingly ALWAYS be needed anyway (thats what i'd like to
>> get off without).

UvB> The assembler has a feature named module constructors and destructors. It
UvB> works as follows: Labels in one module may be marked as constructors or
UvB> destructors. The linker is able to generate tables containing all of these
UvB> routines from all modules that are part of the executable. Currently this
UvB> feature is used to call initialization routines in the startup code.

UvB> An example is the heap code: If a program uses the heap, it must be
UvB> initialized. For programs that don't use the heap, the initialization is dead
UvB> code which is actually never used. So the heap initialization code is a
UvB> constructor. If any program references the heap routines, the linker will know
UvB> that, and will add the heap initialization routineto the constructor table, so
UvB> it will be called on startup. This way, the code is only included if it is
UvB> actually used.

ah nice.... sounds like exactly the functionality i wanted ,=)

UvB> This feature may be used for the graphics stuff as well, however, it is only
UvB> available on the assembler level, not on the C level. But this shouldn't be a
UvB> problem, since most of the graphics stuff will be written in assembler anyway.

mmmh too bad.... will still take some time until that part of the
filestuff will be rewritten in asm i guess ;/

UvB> The documentation has some more information on this.

rtfm eh? ,o)

Best regards,

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:41 CET