From mboxrd@z Thu Jan 1 00:00:00 1970 From: downing.nick@gmail.com (Nick Downing) Date: Mon, 30 Nov 2015 16:38:24 +1100 Subject: [TUHS] tool (that wnj wrote?) that reduced the data segment size? In-Reply-To: <20151130030702.GF32175@mercury.ccil.org> References: <1448753456.23036.for-standards-violators@oclsc.org> <20151130030702.GF32175@mercury.ccil.org> Message-ID: Guys I wrote a more modern version of xstr for a project (porting PDP11 utilities and games to a modern compiler for a different embedded system). How it worked was similar to i18n utilities on a modern system. (I planned to internationalize later). So what it did was remove any strings bracketed with _("blah blah") to a strings file and then replace with a 32-bit integer offset into the file. I had utilities like _printf(long off, ...) which would access the strings file to get the necessary string and print it, or just _strdup() which would bring it into memory where the programmer could use as normal and free when done. What I did next was to have the linker treat the strings file as a resource and merge it into the executable, so that with a little trickery the strings could be directly accessed from flash ROM while not taking any of the precious 64 kbytes RAM in the program's data space. Happy to dig this up and share. Nick On 30/11/2015 2:26 PM, "John Cowan" wrote: > Charles Anthony scripsit: > > > "The Optimizing Compiler Writer's Motto: It is no sin to make a wrong > > program worse." > > It is if the rules for which programs are wrong are essentially beyond > human comprehension on the fly. Anyway: "That program has about a > thousand bugs. Which would you rather, that we fixed all the bugs or > that we made it run a thousand times faster?" > > -- > John Cowan http://www.ccil.org/~cowan cowan at ccil.org > Heckler: "Go on, Al, tell 'em all you know. It won't take long." > Al Smith: "I'll tell 'em all we *both* know. It won't take any longer." > _______________________________________________ > TUHS mailing list > TUHS at minnie.tuhs.org > https://minnie.tuhs.org/mailman/listinfo/tuhs > -------------- next part -------------- An HTML attachment was scrubbed... URL: