Slashdot Mirror


Idle Loop Optimized

seebs writes "Every so often someone makes a joke about optimizing the idle loop, but this article actually does it. " It's about time too- that process has been eating up clock cycles for to long.

1 of 68 comments (clear)

  1. Brilliant! by steveha · · Score: 2, Informative

    I love this sort of thing. The basic idea is silly, but he manages to show some useful stuff and make some valid points while exploring it.

    I remember in the 1980's there was a great article on how to add a GOSUB keyword to the FORTH language. The article evolved the code through four different versions, and each one showed something cool and useful about FORTH. Well, maybe not the last one:

    : GOSUB ; IMMEDIATE

    For those of you who don't grok FORTH, this defines a keyword called GOSUB that does nothing, and does it at compile time so it doesn't get compiled in either. (The article noted that GOSUB FOO is the same thing as just plain old FOO, since FORTH functions are always called as subroutines anyway.)

    Around the same time, I saw an article on how to build your own 64KB memory: take a breadboard, and 65536 8-bit flip-flop chips, plus a 1:65536 multiplexer and a 65536:1 demultiplexer for address selection! The article helpfully calculated how many Watts of power it would take to drive all these chips (a LOT) but it didn't say where one might find a multiplexer or demultiplexer with over 65000 pins on it.

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely