Weekly Classic Computer Trivia Question (20150112)

Vincent Slyngstad vrs at msn.com
Mon Jan 12 13:43:30 CST 2015


From: Johnny Billquist: Monday, January 12, 2015 10:55 AM
> A more correct statement would be that if you enable interrupts in your 
> interrupt handler you must first save all the context of the current 
> interrupt, so you can restore it before returning from the current 
> interrupt.
> It's not really that hard. Essentially you must store the contents of 
> address 0, and probably also make sure you do not get a second interrupt 
> from the same device, since I doubt you want to write a reentrant 
> interrupt handler. (But that is normally the case anyway, since most 
> devices need some kind of operation to enable a new interrupt to be 
> generated.)

You've never tried to do it on a PDP-8, I expect.  Since there's no stack, 
and static storage won't be reentrant, it's a nightmare.  At a minimum, 
you'd need a routine to emulate "push"/"pop" and "call" type operations, 
and you'll have to remember to have interrupts off when you call them, 
unless you want to use MQ to store the return address or something. 
(Even then the stack routines will need to disable interrupts while they 
do their thing).

Another way to view it is that interrupts effectively introduce a kind 
of multi-threading, with the attendant complexity.  That's really 
incompatible with an "all static storage" machine like the PDP-8, 
as everyone's always stomping your variables (even temporaries
and return addresses).

    Vince
 


More information about the cctech mailing list