Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site ittvax.UUCP Path: utzoo!utcs!lsuc!pesnta!amdcad!decwrl!decvax!ittvax!long From: long@ittvax.UUCP (H. Morrow Long [Systems Center]) Newsgroups: net.lang.c Subject: Re: number of arguments function for 4.1bsd VAX cc(1) -- TYPO FIX Message-ID: <1630@ittvax.UUCP> Date: Mon, 25-Feb-85 14:14:01 EST Article-I.D.: ittvax.1630 Posted: Mon Feb 25 14:14:01 1985 Date-Received: Wed, 27-Feb-85 10:23:25 EST References: <271@oliveb.UUCP> Organization: ITT-ATC, Stratford Ct. Lines: 27 > > The following function will return the number of arguments of the function that > called it. It works with cc(1) for 4.1bsd running on a Vax. I can't think of > any uses for it, but it certainly beats passing an argument telling how many ar- > guments the function will receive. > > int > numargs() > { > asm(" clrl r1"); > asm(" subb3 8(fp),$92,r1"); > asm(" ashl $-2,r1,r0"); /* changed $2 to $-2 */ > } You've just set portability back 1,000 years. -- H. Morrow Long ITT-ATC Systems Center, 1 Research Drive Shelton, CT 06484 Phone #: (203)-929-7341 x. 634 path = {allegra bunker ctcgrafx dcdvaxb dcdwest ucbvax!decvax duke eosp1 ittral lbl-csam milford mit-eddie psuvax1 purdue qubix qumix research sii supai tmmnet twg uf-cgrl wxlvax yale}!ittvax!long