Crashing IDLE

Peter Hansen peter at engcorp.com
Thu May 30 19:15:00 EDT 2002


Gustavo Cordova wrote:
> 
> David LeBlanc wrote:
> > "NOP" at the assembly language level does all those things! Events and
> > interrupts are generally sensed at instruction/statement boundaries, and
> > "pass" would (or should!) count as such. Methinks at a higher level of
> > abstraction (but not really), the pcode interpreter loop
> > should be doing
> > this too.
> 
> Woops, you are so right, and me and my big mouth should keep quiet.
[snip]
> pd: Isn't it "halt" which does all those things?
>     My Z80 knowledge is becoming hazy...

Instructions like HALT simply put the CPU into a state where
*all* it does is sit and check for interrupts, and sometimes
bump timer registers along.  It is in suspended animation,
not reading or writing memory or incrementing the program
counter.

Instruction NOP is a "live" instruction which executes just
like any other instruction except that it leaves no side effects
of any kind except an increase in the program counter and a 
small time delay (a couple of clock cycles).  It does not, 
however, *prevent* checking for interrupts which is always 
done (when they're enabled) after each instruction.

Of course, with the gazillion different chips out there, I'm
sure there are some that do things a little different, but 
these two are generally similar (if present) on all typical
micros.

-Peter



More information about the Python-list mailing list