list/dictionary as case statement ?

Stef Mientki S.Mientki-nospam at mailbox.kun.nl
Wed Jan 3 20:50:54 CET 2007


Tom Plunket wrote:
> Bjoern Schliessmann wrote:
> 
>> Intels aren't RISC, are they?
> 
> Not the ones in PCs.  The OP didn't specify the CPU that's being used,
> however.
> 
Well it was meant for a small micro-controller, the PIC-14-series,
e.g. PIC16F877.

I already build a simulator for this device in  Delphi,
but it seemed a nice idea, and a good exercise for me,
to see how this could be done in Python.

And thanks to you all,
I've the core (not the pheripherals) working now,
and my experience with Python are very positive.

The main advantages of the simulator in Python are:
   - very elegant and lean code
   - the treshold of Python is much lower
     (in my opinion, simulators only live when more people are involved)
The main disadvantages (I think, not yet tested)
   - the speed is much lower
   - the GUI is much more complex

For those who are interested,

The rough code of the Python code can be seen here
(I might have committed a mortal sin, by changing "self" into "S" ??)
   http://oase.uci.kun.nl/~mientki/download/cpu2.txt
btw, as I'm a total newbie, any comment is welcome !!

The Delphi simulator can be seen here
   http://oase.uci.kun.nl/~mientki/data_www/pic/jalss/jalss.html

thanks again,
for all your fast and very adequate responses !!

cheers,
Stef Mientki



More information about the Python-list mailing list