Reentrant PDP-8 code (was Re: Weekly Classic Computer Trivia Question (20150112))

Johnny Billquist bqt at update.uu.se
Mon Jan 12 15:38:15 CST 2015


On 2015-01-12 22:34, Vincent Slyngstad wrote:
> From: Johnny Billquist: Monday, January 12, 2015 12:38 PM
>> Of course I've done it. I suspect there is not much I have not done on
>> a PDP-8. I've written programs on PDP-8 systems for over 30 years by
>> now...
>> No, you do not need a push/pop to have interrupts enabled while in an
>> interrupt handler on a PDP-8. As long as you know the same interrupt
>> will not trigger, all you need to do is store the return address from
>> 0 somewhere else before ION, and then write it back to 0 after IOFF.
>
> Well, and the AC and flags and any other context that the ISR needs.
> Essentially, a "one deep stack" for the context, which is much easier
> to implement.

Every interrupt, even if not nested, needs to save the AC, link, and a 
bunch of other stuff.
But yes, if you centralize that part, then it also needs to be stashed 
away before you allow another interrupt. It's two more words.

>> Like I said, with the provisions that you do not reuse the same
>> functions from different interrupt handlers, and you know that the
>> same device don't interrupt again.
>
> Yep.  Generally, you can't share any storage between the various
> routines while the interrupts are on, and you have to also prevent
> re-entry of the routines you are already in.

Yep.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


More information about the cctalk mailing list