Re: [cc65] Loadable overlays

From: Maciej Witkowiak <ytm1elysium.pl>
Date: 2006-07-30 12:58:48
Ullrich von Bassewitz dnia 30 lip 2006 o 11:54 +0200 napisał:
> > But as I said, it will have a big performance impact
> > given that cc65 calls some library routines quite
> > often.
> 
> Not only that there is a performance impact, there's also the problem of the
> jump table size. As I said, the runtime consists of several hundred functions.
> This means that you will have spend about 1K just for the jump table.

LUnix uses something what was called a virtual jump table. There is include file
with a list of kernel functions, starting with magic value and incrementing by
two:

.import LUNIXKERNEL
lkf_set_zpsize   = LUNIXKERNEL+0
lkf_get_moduleif = LUNIXKERNEL+2
...

The kernel has a table with actual addresses of these functions:

kfunc_tab:
	.word	set_zpsize
	.word	get_modueif
...

The o65 loader replaces all LUNIXKERNEL references with the addresses from
kfunc_tab so there is no runtime performance penalty.

LNG's jump table has only 70 entries, that is much less than hundreds of C
lib runtime functions so the argument about the sacrificed space stands.

M.

----------------------------------------------------------------------
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 Jul 30 12:58:59 2006

This archive was generated by hypermail 2.1.8 : 2006-07-30 12:59:01 CEST