Re: [cc65] Lynx target

Date view Thread view Subject view

From: Ullrich von Bassewitz (
Date: 2003-02-26 00:43:37


On Tue, Feb 25, 2003 at 01:32:46PM -0800, Shawn Jefferson wrote:
> Could you clarify this for me?  I am running into some problems, namely that
> simple code that looks good (to me) will not run in Handy.  Sometimes turning
> on optimizations -O will cause it to start functioning.  Should I compile the
> runtime stuff without the --cpu 65C02 switch?

The optimizer has knowledge about runtime functions. And this knowledge may be
wrong when the runtime library is translated for the 65C02, because

    (a) register usage differs, and
    (b) no one has ever tested a library compiled for the 65C02.

But since these problems are triggered by using the optimizer, and you state
that the problems vanish when doing so, I would say that your problems have a
different cause.

> So if I have a function that is somefunc(char a, char b) and use popax I can
> get both arguments with one call?  The arguements are pushed on the stack a, b
> so would I be right in assuming that the A register contains b and the X
> register contains a?


> Hmmmm, any reason *not* to use __fastcall__ ?

Fastcall functions may not called without a prototype in scope. This is also
true for most non fastcall functions, but with a fastcall function it will
definitely fail. And, there may be problems with function pointers when mixing
__fastcall__ and non __fastcall__ functions. But programs experiencing
problems should be *really* rare.

> Another question: I have setup a _mikey.h and _suzy.h file with a struct
> layout of the hardware address used by those chips (as per the _antic.h file)
> and I have a #define SUZY (*(struct __suzy *) 0xFC00) in my lynx.h file.  How
> do I use this structure?  If I do var = SUZY.joystick in my code the compiler
> complains bitterly.

Just using the struct as any other struct variable should work. You may have
an error somewhere in your definition, but since "the compiler complains
bitterly" is just as good as "it does not work", I'm not able to diagnose
anything else:-)



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to 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-26 00:45:16 CET