Fascinating new switch mechanism in assembler

Sean Kelly sean at f4.ca
Fri Mar 17 21:59:50 PST 2006


Dan Lewis wrote:
> Hi guys,
> I've been working on a lexical analyzer for my new scripting engine, and I
> stumbled upon an interesting algorithm.
> 
> Essentially:
> 
> goto ((charCode << 2)+subroutinePointerArray);
...
> I'm hoping for some feedback and progression of the idea; and if it's already
> been out there for ages, perhaps a link or two on the subject?

Sounds like you're describing a Jump Table.  Here's a PDF I dug up on 
the subject: 
http://www.inf.ethz.ch/personal/muellren/sysprog/ws05/session2-ifwd42rm2.pdf


Sean



More information about the Digitalmars-d mailing list