list/dictionary as case statement ?
Tom Plunket
tomas at fancy.org
Wed Jan 3 03:08:58 EST 2007
Hendrik van Rooyen wrote:
> It works well - and it is surprisingly fast too...
> And its easy if the opcodes are all say one byte,
> else you need an opcode length field too, and fancier
> parsing.
Often (always?) RISC architectures' instruction+operand lengths are
fixed to the word size of the machine. E.g. the MIPS 3000 and 4000 were
32 bits for every instruction, and PC was always a multiple of four.
...which means the parsing is pretty straight forward, but as you say,
simulating the rest of the machine is the hard part.
-tom!
--
More information about the Python-list
mailing list