Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!sdd.hp.com!caen!uflorida!travis!tom From: tom@ssd.csd.harris.com (Tom Horsley) Newsgroups: comp.sys.m88k Subject: Re: alloca() for UTekV 3.2e? Message-ID: Date: 19 Feb 91 11:53:06 GMT References: <22301@hydra.gatech.EDU> Sender: news@travis.csd.harris.com Organization: Harris Computer Systems Division Lines: 29 In-reply-to: ken@dali.cc.gatech.edu's message of 18 Feb 91 19:51:07 GMT ken> Might anyone have a working alloca() for a Tektronix XD88/10 running ken> UTekV 3.2e? Many thanks... It is close to (or maybe actually) impossible to implement a true alloca() without compiler support. If the compiler you are using does not have such support, then your only hope is probably to use the portable alloca() that comes with gnuemacs and is available at random archive sites (no, I don't know a specific one off the top of my head, sorry). The Gnu C compiler *does* have support for a builtin alloca() function, as do several other 88k compilers, but lots of 88k compilers don't have any support. Technically, the problem is that most compilers only use one register (r31) as both a stack and frame pointer. This works fine when the stack frame is fixed size. If you want a variable sized frame (which is essentially what alloca() is supposed to provide), you need your compiler to generate code that uses r30 as a frame pointer and r31 as a stack pointer. On top of that, due to the obscure way arguments are passed on the 88k the implementation of alloca() also needs to know the largest sized argument list passed anywhere in the function. -- ====================================================================== domain: tahorsley@csd.harris.com USMail: Tom Horsley uucp: ...!uunet!hcx1!tahorsley 511 Kingbird Circle Delray Beach, FL 33444 +==== Censorship is the only form of Obscenity ======================+ | (Wait, I forgot government tobacco subsidies...) | +====================================================================+