Article View: comp.lang.c.moderated
Article #2268Re: Bad Style Contest - We Have a Winner!
From: Konrad Schwarz
Date: Wed, 13 Mar 1996 12:40
Date: Wed, 13 Mar 1996 12:40
39 lines
2161 bytes
2161 bytes
James Kanze US/ESC 60/3/141 #40763 writes: |> Konrad Schwarz writes: |> |> |> J. Kanze writes: |> |> |> [Concerning alloca...] |> |> I: As far as I know, implementing alloca via the stack is trivial on |> |> I: any general-purpose CPU, but I am interested in hearing of counter examples. |> |> |> |> |> |> So what do you do on machines that don't have a stack? |> |> |> General-purpose CPU's have stacks, at least in my book. |> |> IBM mainframes don't have stacks. Would you not consider them general |> purpose CPU's? (While most modern architectures have stacks, I |> suspect that if you looked at all of the general-purpose CPU's in |> existance, you'd find more architectures without a stack than with.) You're telling me that a C implementation on an IBM mainframe doesn't use a register as a stack pointer or doesn't reserve a continuous region of memory as a stack? Note that you'd be hard pressed to find a RISC machine with a dedicated stack pointer register. |> |> How do you |> |> implement C on machines that don't have a stack? |> |> The same way you implement any other language, I suppose. On the one |> machine I have any experience with, local frames were allocated and Is this the afore mentioned IBM mainframe? Was the language C---or SIMULA :)? |> freed using a mechanism similar to malloc/free. Once allocated, the |> size of the local frame could not be changed. See my previous postings for how to implement alloca in this case. Konrad Schwarz
Technical Details
Message-ID:
<4i6fo9$p28@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4fjmdt$og4@solutions.solon.com> <4g27nn$qaj@solutions.solon.com> <4h2thl$1io@solutions.solon.com> <4hgc5l$99s@solutions.solon.com> <4hqed0$1lc@solutions.solon.com> <4hv05f$j9i@solutions.solon.com> <4i2k2s$8lt@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz) Newsgroups: comp.lang.c.moderated Subject: Re: Bad Style Contest - We Have a Winner! Date: 13 Mar 1996 06:40:41 -0600 Organization: TU Wien Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4i6fo9$p28@solutions.solon.com> References: <4fjmdt$og4@solutions.solon.com> <4g27nn$qaj@solutions.solon.com> <4h2thl$1io@solutions.solon.com> <4hgc5l$99s@solutions.solon.com> <4hqed0$1lc@solutions.solon.com> <4hv05f$j9i@solutions.solon.com> <4i2k2s$8lt@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com