Path: utzoo!attcan!uunet!dino!atanasoff!hascall From: hascall@atanasoff.cs.iastate.edu (John Hascall) Newsgroups: comp.lang.c Subject: Re: Short code to determine compiler's register use Message-ID: <1237@atanasoff.cs.iastate.edu> Date: 22 Jul 89 14:03:04 GMT References: <396@uop.uop.EDU> <2811@internal.Apple.COM> Reply-To: hascall@atanasoff.cs.iastate.edu.UUCP (John Hascall) Organization: Iowa State Univ. Computation Center Lines: 34 In "hordes o' people" have wrote: [.. various schemes (all flamed) to count used registers ..] Well, I think we've decided this is machine dependent, so I submit for your kind flamage a VMS version (tested even, imagine that :-) REG.C: main() { register int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p; int fn(); short *regs; a = fn(); b = fn(); c = fn(); d = fn(); e = fn(); f = fn(); g = fn(); h = fn(); i = fn(); j = fn(); k = fn(); l = fn(); m = fn(); n = fn(); o = fn(); p = fn(); regs = (short*)main; printf("Register mask = %04.4x\n", *regs); fx(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p); } RDUMMY.C: fn() {return(1);} fx(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p; {} ------------------------------------------------------ John