I tracked the problem down. The code wasn't clearing the interrupt in sbs16 mode, so the interrupt routine just kept getting called endlessly.
The fix is in defer() in pdp1.c:
// TP2
mop2379(pdp);
if(pdp->sbm && IR_JMP && pdp->epc == 0) {
if(pdp->sbs16) {
if((MB & 07703) == 1) {
mask = ~(1<<((MB&074)>>2));
pdp->b4 &= mask;
pdp->b3 &= mask; // wje
pdp->exd = 1;
sbs_restore = 1;
}
} else {
if((MB & 07777) == 1) {
pdp->b3 = 0;
pdp->b4 = 0;
pdp->exd = 1;
sbs_restore = 1;
}
}
sbs_calc_req(pdp);
}
TP(2)
B4 was being properly cleared, but b3 also has to be cleared because it holds pending interrupt flags also.
There might be one more problem I might look into, but probably not I'll leave it to you to verify..
This code fragment:
26 / enable channel 1 and test it
27 00106 720151 asb 100
28 00107 720157 tst 100
29 00110 760000 nop
30 00111 760000 nop
31 00112 760400 rt, hlt
enables chan 1, then tst 100 (a dynamic IOT) raises the chan 1 interrupt via pdp1.c req(pdp, chan). It works fine for chan 0, but it seems that for chan 1 without at least one more instruction following the instruction (nop in this case), the hlt stops processing before the chan 1 interrupt is actually processed. I don't know if this is correct behavior or not. Testing with isb instead of the IOT does the same thing, so you can test that way.
I've attached test4.mac that shows the problem using isb. Remove the nop just before the hlt and the chan 1 interrupt isn't processed, the AC stays zero.
You'll have to enable sbs16 yourself since you don't have dynamic IOT support. Also. the macro1 assembler doesn't know about asb, dsb, isb hence the defines.
Bill