[cc65] Re: The most critical operations of the C runtime

From: Emanuele Fornara <emanuele.fornara1gmail.com>
Date: 2007-09-21 08:53:29
Thank you all for your suggestions.


1) open/close/read/write - dynamic module - loadable drivers

My idea was to provide a couple of high level operations:

jar_load(0x2000, "module.rom"); // map the whole file
jar_load_ex(0x2000, 10000UL, 200, "module.rom"); // map 200 bytes

I haven't looked yet into how/if can I use these for dynamic modules.
However, I don't think I would be able to provide "standard" drivers;
even the joystick driver would be hard to implement (some weird
latching behavior in MIDP2); more on TGI below.


2) memset, memcpy, DMA

For a while I toyed with the idea of letting the IO chip only access
page 2, but I already let the genie out of the bottle with the latest
version of the VM; FILL/COPY are pretty much a given now.


3) math operations

I was sort of planning to put a register-based math subsystem in the
IO chip; I wasn't so sure, but I agree that it would really help to
calculate array offsets.  I guess it would be helpful to have some
pseudo-registers pointing to a bank of 16-bit slots on page 0 (some of
them would "happen" to coincide with locations used by cc65).


4) low level C runtime

(I actually posted a message about this, I guess it got lost
somewhere... never mind, my opinion has changed since then anyway)

Here is where I struggle; at the end probably the best way for me to
proceed is to write a little game and see which functions are actually
called.

I recompiled a program (pngtest.c) with optimizations enabled (I've
released the test programs without compiling them with '-O'! This
should speak volumes about how much I cared about performance until
now...) and now I have some hints:

- pushax, if you are careful and use chars, is less used than I thought.

- enter/leave, if you are careful, are less used then I thought.

- pusha/incsp* are probably too short.

All in all the generated code, with '-O' ;-), doesn't look bad to me.


Some notes about math and TGI here (WARNING! page with Applet):

http://jbit.sourceforge.net/demo/sdk_mandelbrot.html



Emanuele
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Sep 21 08:53:43 2007

This archive was generated by hypermail 2.1.8 : 2007-09-21 08:53:46 CEST