Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!ucdavis!deneb!cccmark From: cccmark@ucdavis.UUCP (Mark Nagel) Newsgroups: comp.lang.c Subject: Re: Available No. of Registers Message-ID: <83@ucdavis.UUCP> Date: Sun, 18-Jan-87 16:17:46 EST Article-I.D.: ucdavis.83 Posted: Sun Jan 18 16:17:46 1987 Date-Received: Mon, 19-Jan-87 04:15:01 EST References: <3950004@nucsrl.UUCP> Reply-To: cccmark@deneb.UUCP (Mark Nagel) Organization: University of California, Davis Lines: 24 In article <3950004@nucsrl.UUCP> ram@nucsrl.UUCP (Raman Renu) writes: > C allows "register ......" construct which instructs the compiler >to reserve a machine register to store that value. Now my question is, >given a fixed number of registers, How many are effectively usable for >the register declaration. I know this is machine dependent. Could >somebody say how many register definitions I could use within a block >of code say for a VAX. And please go on to mention the CPU/Machine that >allows the greatest number and smallest number of such declarations. On the machines I've worked on, the register declaration will use up to the total available registers on the CPU and then it is ignored (i.e. no error, just no register declaration either). Depending on the compiler, the register declaration will do anything from telling the compiler to put this variable in an available register or else (Macintosh w/Lightspeed C) to strongly advising the compiler to possibly put the variable in a register if it wouldn't be too much trouble (VAX/VMS C). I am not sure of exact numbers offhand, but they will vary according to compiler as well as CPU. - Mark Nagel ucdavis!deneb!cccmark@ucbvax.berkeley.edu (ARPA) mdnagel@ucdavis (BITNET) ...!{sdcsvax|lll-crg|ucbvax}!ucdavis!deneb!cccmark (UUCP)