Re: [cc65] Volatile and reentrant keywords

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-03-13 23:14:20
Hi!

On Sat, Mar 13, 2004 at 11:44:44AM -0500, Apple2Stuff wrote:
> it compiles now with volatile removed (and xdata) but am I asking for
> trouble?

The volatile keyword is standard C. It should be parsed but ignored by the
compiler. The fact that this doesn't work in your case is a problem with the
compiler. I will have a look at it. 

The xdata keyword is not standard C. It is used by 8051 compilers to specify a
memory segment where the data is located.

> The keyword reentrant is also being used but I think from my research that
> it is okay to leave it out if I make sure the function only uses registers
> or stack variables?

The reentrant keyword is non standard, too. Since the 8051 has a very small
stack (even smaller than the hardware stack of the 6502), the C compiler will
place variables in static storage unless told otherwise by this keyword. It is
somewhat similar to the --static-locals compiler option of the cc65 compiler
(or the equivalent #pragma). The difference is that when using cc65, all
variables are on the stack by default.

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 13 23:14:26 2004

This archive was generated by hypermail 2.1.8 : 2004-03-13 23:14:32 CET