Re: [cc65] calling conventions

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-03-07 06:07:55
Good morning!

On Sat, Mar 07, 2009 at 01:38:54AM +0100, Groepaz wrote:
> i have a dumb question... a function written in assembler (which is called
> from C) that returns an unsigned char, does it have to set the Y register to
> 0 before returning? so far i assumed yes, is that true? and does that
> requirement change if the function is declared __fastcall__ ?

If you're talking about the X register, then yes. The compiler assumes that
the default promotions are already done, so when returning chars, the X
register has to be set. This does not depend on the __fastcall__ property of
the function.

If you're really talking about the Y register then no, it does not have to be
set on return.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Mar 7 06:08:20 2009

This archive was generated by hypermail 2.1.8 : 2009-03-07 06:08:22 CET