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
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@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@minnie.tuhs.org
https://minnie.tuhs.org/mailman/listinfo/tuhs