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!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!ihwpt!knudsen From: knudsen@ihwpt.UUCP (mike knudsen) Newsgroups: net.micro.6809 Subject: Re: direct page storage class Message-ID: <761@ihwpt.UUCP> Date: Mon, 10-Mar-86 17:08:58 EST Article-I.D.: ihwpt.761 Posted: Mon Mar 10 17:08:58 1986 Date-Received: Wed, 12-Mar-86 02:43:30 EST References: <3500134@uokvax.UUCP> Organization: AT&T Bell Laboratories Lines: 34 > [I hope that you will look at mod.os.os9 for generic OS-9 material.] > Mod.os.os9 seems to have died out -- after weeks of no action, came a request from the moderator for someone else to take the job, and not a peep since. > For people using the Microware OS-9/6809 C compiler, let me strongly > suggest you consider judicious use of the "direct" storage class. > > [explanation of it here] > It *does* make a difference--I tried some judiciously-placed direct > declarations in a rewrite of the old CUG Unix ed-like editor, and > it shrank the code by about 500 bytes. (I think the compiled code > came to 15.5 Kbytes at the time.) Things got faster, too. > > James Jones Right on about "direct." In fact, I found that direct variables are even faster than "register" (you get one, the U reg) since the compiler is too dumb to use the register effectively, but makes good use of direct page. Discovered using the notorious prime sieve benchmark. Even if the compiler did lots of optimizing, I suspect that only pointers (of any type) would gain from "register." But we C hackers use lots of those, right? Note that putting arrays[] in direct does nobody any good and just wastes it, since unlike the 6502 the 6809 has no direct-page indexed mode. mike k