Re: [cc65] assembly functions

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2004-01-05 10:30:58


On Mon, Jan 05, 2004 at 10:25:56AM +0100, carlos wrote:
> so an assembly procedure, from which the unsigned char oder unsigned short
> int return value will be printed
> with printf should always clear x-reg before exiting, or?

*Any* character is always promoted to int by the compiler. This means that all
functions returning a char must actually return an int (promote the char to an
int according to its signedness). In most cases (unsigned char) this is done
by clearing the X register before returning. Please note that this has nothing
to do with printing something or with the printf function! Not returning chars
as ints will give errors in other places, too.

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 : 2004-01-05 10:31:06 CET