Well if "famous" loops that we're not writing ourselves are being
mentioned (eg. Duff's Device) then how could I not mention the loop
written by Mel Kaye on the RPC-4000?

For those not familiar with the story, see: 
http://catb.org/jargon/html/story-of-mel.html

Kaye wrote a loop that had no termination condition, yet it terminated
just fine. He'd taken advantage of the fact that the address and
opcode were both part of the instruction word. His loop executed an
instruction that operated on data pointed to by the address operand,
then incremented the address before looping back to execute the same
instruction again on the new data location. The data had been placed
at the top of memory, so the address would overflow when he did his
final increment. The overflow incremented the opcode, changing it to a
"jump". Since the address operand had just overflowed, it was now set
to 0, and the process jumped to address 0 where it continued
execution. (This was obviously before page guards)  :-)

I'd love to write something that could challenge this piece of insane
genius, but modern languages tend to protect us from ourselves. It's
not impossible to see crazy stuff like this, but it's much rarer.

Paul Gearon

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to