Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site burl.UUCP Path: utzoo!linus!security!genrad!mit-eddie!mit-vax!eagle!mhuxt!mhuxi!mhuxa!houxm!hocda!spanky!burl!rcj From: rcj@burl.UUCP Newsgroups: net.unix-wizards Subject: Re: stack memory allocation Message-ID: <231@burl.UUCP> Date: Sun, 10-Jul-83 18:12:27 EDT Article-I.D.: burl.231 Posted: Sun Jul 10 18:12:27 1983 Date-Received: Mon, 11-Jul-83 20:58:22 EDT References: <2775@sri-arpa.UUCP> Organization: Western Electric, Burlington, NC Lines: 27 The comment about it being OK to allocate from the SP is quite valid. (At least it used to be.) In college, we had a PDP-11/34 running V6. My introduction to C was in a mini-computers course where the instructor told us one day that we had two weeks to write a crude task scheduler to run on our PDP-11/03 (LSI-11). The only catch was that we had to write it completely in C, compile it into Unix Assembler, run it through an "ed" command file to translate it into MACRO-11, and run it without mucking with it on the LSI. This was bad enough for us poor innocent sophomores, but what made it even worse was that NONE of us knew C. When this was pointed out to the professor, he simply told us that the R&K book was $12.00 in the bookstore. We ended up implementing part of the code by initializing unsigned integer arrays with hardcode instructions for the LSI, and then calling the hardcode "routines" by doing a "goto array_name;". In the process, we allocated space backwards from the SP and used it with no problems. This also allowed us to access registers without having to use the "register" capability of C -- we weren't sure which registers C would use and were generally paranoid about C at the time; having had such in-depth study of it for such a long time :-) Ah, the good old days, -- The MAD Programmer -- 919-228-3814 (Cornet 291) alias: Curtis Jackson ...![ floyd sb1 mhuxv ]!burl!rcj