Re: [cc65] Regbank

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-01-02 22:32:09


Hi!

On Thu, Jan 02, 2003 at 10:02:54PM +0100, Debrune Jérôme wrote:
> What does regbank in crt0.s ?

regbank is no longer in crt0.s, it has been moved into a separate module
called zeropage.s. It is used for register variables (which are kept in the
zero page for the 6502).

> I mean, is it possible to use regbank without troubles, in asm routine and
> restore old values in regbank (At the end of the function) ?

Yes. The calling function expects the values in regbank to survive a function
call, so as long as you save the space on function entry and restore it on
function exit, you may use regbank as you want.

> how can grab zp variables if ptr1,2,3,4,tmp1,tmp2,tmp3,tmp4 are used in a
> routine ? (That is why i would like to use regbank).

"sreg" is one more zero page location that is safe to use. It contains the
high word of a long value and is not expected to be saved across a function
call. If you need even more zeropage locations, it depends on your code: If
you want to write portable code, your only choice is to use regbank, and
accept the overhead of saving and restoring it. If your code is written for
one machine only, you can also use additional zero page locations that are
known to be available on this specific machine. Either use numeric addresses,
or create a special zero page segment and extend the linker config
accordingly.

> BTW, is it possible to have a 2.9.0 release for atmos on cc65 ?

There is no separate Atmos package, because this package would only consist of
the startup file. The startup file alone is not of much use, because there is
not a single chance to do I/O, not even a "Hello world" program can be
written. On the other side, the "atmos" target is understood by all tools,
including the linker, so cc65 *can* generate code for the Atmos.

> If something  is missing for this release ask me

Having some code to do I/O would be useful (either file support, so printf()
and friends would work, or conio support, so cprintf() and cgetc() would
work). Once there is at least rudimentary library support, I will generate a
separate Atmos package containing atmos.o and atmos.lib.

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 : 2003-01-02 22:32:14 CET