Path: ...!newsfeed.arcor.de!news.belwue.de!irazu.switch.ch!switch.ch!cern.ch!news From: Dan.Pop@cern.ch (Dan Pop) Newsgroups: comp.lang.c Subject: Re: Memory allocation for function paramaters Date: 28 May 2004 12:04:33 GMT Organization: DESY Zeuthen Lines: 26 Message-ID: References: <968b76.0405270916.38e7c745@posting.google.com> NNTP-Posting-Host: lxplus065.cern.ch X-Trace: sunnews.cern.ch 1085745873 19159 (None) 137.138.4.191 X-Complaints-To: news@sunnews.cern.ch User-Agent: nn/6.6.2 In <968b76.0405270916.38e7c745@posting.google.com> redfloyd11@yahoo.com (red floyd) writes: >Martin Dickopp wrote in message news:... >> praveenmadis@softhome.net (Praveen Kumar Madis) writes: >> [Q about where parameters live redacted] >> >> That said, most implementations do indeed use a stack for this, often >> in combination with CPU registers. If you're interested how your >> particular implementation handles it, please ask in a newsgroup >> dedicated to that implemenation. > >The Zilog ZEUS Z8000 compiler passed the first 6 16 bit arguments in >registers (R7-R1, descending), and thereafter on the stack. > >Made the implementation of (this was pre-C89) kind of a >pain in the butt! This kind of convention (first N arguments in registers, the rest on the stack) is commonplace on modern architectures. Never bothered to see how is actually implemented (probably using compiler magic). Dan -- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de