Re: [cc65] Lynx target

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-02-20 22:13:17


On Wed, Feb 19, 2003 at 09:56:24AM -0800, Shawn Jefferson wrote:
> You are a genius, Ullrich, to make this compiler so easy to use.  I've
> managed to write a crt0.s and config file using Bastian Schick's runtime code
> and the atari crt0.s as templates.  I've converted a couple of the lynx
> library modules and I can get a program running in Handy!  Whoohoo!  I just
> compiled the whole runtime directory with -t none --cpu 65C02 and everything
> looks to be working.

There may be problems with some runtime functions. The compiler has knowledge
about the register usage of most runtime (not C) functions, and register usage
may be different for a few functions when compiled for the 65C02. If you're
experiencing difficulties, look out for this.

> A question: is it better to use the popa, popax routines rather than
> manipulate the stack yourself?  I notice that the lynx routines do a lot of
> this work themselves... I've been converting them to popa, popax since it is
> easier for me to understand what is going on then (cleaner code.)

First rule when interfacing with assembly functions: Use __fastcall__ whenever
possible. This will pass the rightmost parameter in registers instead over the
stack. In the assembly function it is often simpler to use popa/popax, but the
overhead associated with the function call is also larger. So if you're
hunting for cycles you should access the stack directly and use incsp() later
if the alternative is two or more calls to popa/popax. You can also replace
two calls to popa by one call to popax (the high byte is then in the X
register).

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-02-20 22:13:39 CET