wmb@MITCH.ENG.SUN.COM (01/08/91)
MB> This "embedded system" is not small in the traditional sense, in that MB> the code runs on a 28 MIPS processor and occupies about 128K of ROM IW> Cough! Gasp! Wasn't it C. Moore who said if it couldn't be done in 16K it IW> wasn't worth doing? I hope you don't believe everything that Chuck Moore says ! Judging from the rate at which he changes his mind, Chuck usually doesn't believe himself for more than about 6 months. MB> but it is very constrained; we have had to use numerous shrinking MB> techniques to make the needed functions fit in the available space. IW> Apart from using colon defintions :-) any examples? We compile 16-bit 2-bit shifted offsets from a base register instead of 32-bit addresses. The user area initialization table is truncated to the actual size used, and the expansion area is mapped above it later. Some modules were recoded for tighter expressions of the algorithm. Some data tables were encoded to use less storage (e.g. a set of several international keyboard maps were stored as deltas from a single "in the clear" keyboard map; and a font bitmap was stored in a custom format to eliminate multiple copies of duplicate scan lines). In one case, we LZ-compressed the entire program, except for a small amount of startup code, and decompressed it into RAM before execution. We changed the header format to reduce the amount of wasted space. We made a lot of words headerless. We relaxed the hardware alignment restrictions by providing unaligned versions of some memory reference operators. There are probably other things that I don't remember. Necessity is the mother of invention. I kept pulling rabbits out of that particular hat long after I thought the hat was empty. Mitch Bradley, wmb@Eng.Sun.COM