Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site ihwpt.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihwpt!knudsen From: knudsen@ihwpt.UUCP (mike knudsen) Newsgroups: net.micro.6809 Subject: Re: Don't use C "register" Message-ID: <602@ihwpt.UUCP> Date: Tue, 3-Dec-85 19:15:10 EST Article-I.D.: ihwpt.602 Posted: Tue Dec 3 19:15:10 1985 Date-Received: Thu, 5-Dec-85 06:14:43 EST References: <593@ihwpt.UUCP> <1130@gitpyr.UUCP> Distribution: net Organization: AT&T Bell Laboratories Lines: 24 > How do you figure? The 'tfr' instruction takes 6 machine cycles, and > a load or store using direct addressing averages 5 cycles. Using even > the simplest addressing mode, direct, is going to cost you on the average > of 4 cycles more than 'tfr', and the other addressing modes (inherent > excluded) are even more expensive. Okay, I admit to ambiguity in my posting, which was done under adverse conditions. I meant the ROUND-TRIP timing: it is STILL faster to LDX from RAM, twiddle it, and STX back to RAM, than to TFR U,X, twiddle, and TFR X,U. Also, TFR takes 8 cycles for doulbe-byte regs; 6 cycles is for A and B. > The 'cwai', 'swi2', and 'swi3' instructions are tied for being the > slowest on the 6809; they all consume 20 cycles. Of course you're right. I meant "slowest of normally used instructions." CWAI is used to go to sleep, so doesn't really count. I'm afraid that under OS-9, SWIs are pretty "normal" too. I still say: Don't use TFR if you can help it, and don't declare register in MW C. mike k