Re: [cc65] # of local variables allowed?

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2001-03-02 20:42:01


On Fri, Mar 02, 2001 at 02:35:22PM -0500, Bryan Pope wrote:
> Now I see my problem.. I am trying to compile a C program from another
> platform (Linux) which has a lot of ints.  Which are 16 bits here and would
> use up those resources after only 16 variables.... Ooops...  I will just
> rewrite this using chars.

An int is two byte for cc65, so you would be able to use 128 ints as local
variables before exceeding the limit. According to my experience, character
buffers are eating up local space much more than ints or even longs.

> Does malloc automatically use any ram expansion available?

RAM expansions are never "linear" memory, that is, memory with an address in
the normal 6502 address space. So they cannot be used as a replacement for
normal memory using the malloc interface. A RAM expansion may be used by some
other interface that takes care of mapping the memory as needed. However,
there is no way to hide the mapping and unmapping from the programmer, so
special functions are needed.

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 : 2001-12-14 22:05:39 CET