Re: [cc65] Graphics library

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2001-08-17 10:59:59


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).

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

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

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

The documentation has some more information on this.

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.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:41 CET