[Coco] C and Stack size

Ries, Rich (NY80) Rich.Ries at Honeywell.com
Tue Apr 8 13:55:15 EDT 2008


This piece of a message set tripped the ol' grey cells:
> I'd hate to have to implement that on the 6502.  A C compiler on the
> 6502 is ugly and C is only partially stack based.  The 6502 only has
> an 8 bit stack pointer, 8 bit pointer registers and to get around that
> you have to use page 0.

'Way back in '93, Byte Craft Limited had a C compiler for the National
Semiconductor COP chips. The lower end of the family did not have any
stack access, and all of 112 bytes of RAM, including registers and I/O
ports and the timer. (There are also C compilers for the 8051, which
also has limited stack space.)

The project I am working on here at work has a stack which allows 40
(forty!) entries, with 8K of byte-wide RAM. There are two solutions: (1)
use a LOT of global variables, or (2) create your own stack(s) for
parameter passing. We use both methods. It ain't purty, but we're not
paid for "purty."

--Rich



More information about the Coco mailing list