weird C implementations?

Segin segin2005 at gmail.com
Mon Sep 11 20:01:02 CDT 2006


Dave McGuire wrote:
> On Sep 11, 2006, at 12:11 AM, woodelf wrote:
>>> I was reading the C language spec (C99) and I got to wondring:
>>> are/were there C implementations that had no stack, or a rising
>>> stack? There's a falling stack in every implementation I've seen, but
>>> the spec doesn't require it.
>>
>> Most machines that did not have a stack, like a PDP-8 or other larger
>> machines from that era never did have that problem since C was never
>> ported to them to my knowlege. Cross compilers to new-ish
>> micro-controlers
>> may have limitations is the only examples I can think of.
>>
>> The only machine with a rising stack that I know of was a 18 bit CPLD
>> computer
>> design I was planning to build with 4 registers - sp,ac,pc,ix.
>> +offset+<sp:0000>, -offset+<sp:sp>.
>> Since I am now planning to build a 12/24 bit cpu, I can use a real
>> register
>> for global-static variables. I am taking a RISC idea of a 0 constant
>> register
>> for abs static variables.
> 
> 
>   The Intel MCS51 architecture has a rising stack, and there are several
> C compilers available for it.
> 
>           -Dave
> 
> -- 
> Dave McGuire
> Cape Coral, FL
> 
>
I always thought that C implementations would grow the stack in whatever
 direction that the associated CPU opcode would grow it in. It only
seems logical, as it's efficent.


-- 
The real problem with C++ for kernel modules is: the language just sucks.
	-- Linus Torvalds



More information about the cctech mailing list