Page 1 of 1

Daft question about interrupts...

Posted: Wed Dec 06, 2017 11:04 am
by R-Tape
The title says it all but I just want to make sure. I'll apologise in advance.

The vector table and routine are in uncontended memory, but if the stack is in contended memory, is there a risk of ULA snow?

The routine would be something like this:

PUSH ....
CALL routine
POP
EI
RET

Re: Daft question about interrupts...

Posted: Wed Dec 06, 2017 12:49 pm
by Ast A. Moore
No. As long as the I register is outside the $40–$7f range, you’re good.
Also, the kosher way to return from an ISR is RETI, not RET. ;)

Re: Daft question about interrupts...

Posted: Wed Dec 06, 2017 1:45 pm
by R-Tape
Cheers. I usually keep the stack at the top so have never considered this before. I may be using paging this time so stack is at the bottom. And I'm rusty as hell.

Re: Daft question about interrupts...

Posted: Wed Dec 06, 2017 2:41 pm
by Ast A. Moore
Different strokes . . .

I, too, usually relocate the stack toward the top of RAM to avoid contention. Keep in mind that contention patterns on the 128K/+2 are different from those on the +2A/+3.

Re: Daft question about interrupts...

Posted: Wed Dec 06, 2017 8:13 pm
by AndyC
Ast A. Moore wrote: Wed Dec 06, 2017 12:49 pm No. As long as the I register is outside the $40–$7f range, you’re good.
Also, the kosher way to return from an ISR is RETI, not RET. ;)
Not strictly true. If you set the I register to a value between $C0 and $FF and have contended memory paged in at $C000 you will crash an old school 128K (but not a +2A/+3 where the HAL bug was fixed). This happens even if you aren't using IM2 or if interrupts are disabled. For maximum compatibility you should keep I between $80 and $BF.

Re: Daft question about interrupts...

Posted: Wed Dec 06, 2017 8:46 pm
by Ast A. Moore
Thanks, I was only vaguely aware of that!
But, as far as the 48K machine is concerned, I’m correct. The +2A/+3 doesn’t exhibit the snow effect (probably, for the very reason you described). Sadly, there are a couple of games out there that used it as an embellishment.