Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!Leisner.Henr@xerox.com From: Leisner.Henr@xerox.com (marty) Newsgroups: comp.lang.c Subject: Re: Available No. of Registers Message-ID: <2855@brl-adm.ARPA> Date: Tue, 20-Jan-87 19:13:10 EST Article-I.D.: brl-adm.2855 Posted: Tue Jan 20 19:13:10 1987 Date-Received: Wed, 21-Jan-87 03:13:30 EST Sender: news@brl-adm.ARPA Lines: 25 Some more insights on coding style using register variables for effiency. I've done a lot of real-time coding with Manx Aztec C for 8085 machines. Manx allows one register variable (stored in the BC pair). When the code can be non-reentrant, I've found it effective to pick one good variable (often a pointer to structure) to be register and the rest static. Stack operations are expensive on 8080 architectures and real-time performance is important. Any additional register declarations beyond the first Manx treats as auto (which means stack, which is undesirable). There is a compile time option to convert autos to statics. I've usually been pretty happy with the assembly language this compiler generates. I feel if at all possible it is better to stay away from assembly language for any meaningful algorithms. Significant optimization can be performed on small machines by "fiddling" with the C source and understanding the compiler output. Of course, oddball implementations with the idea the intent of increased speed should thoroughly commented. marty leisner.henr@xerox.com