[comp.sys.intel] 80186 programming question

coltoff@burdvax.UUCP (02/04/87)

I am currently writing code for a 80186 board I designed and have
a question relating to interrupts. When the End Of Interrupt is
issued the interrupt controller priority mask will get set to the
priority of the next lowest level, if there is an interrupt pending,
or all 1's if no interrupt is pending. If I have the following code

	spl5();	/* set mask to 5 */
	  *
	  *
	  *
	spl7();	/* set mask back to 7 */

I have no guarantee that some interrupt won't cause the mask to
change back to 7 before I want it to. Now I may be a hardware jock but it
doesn't seem intuitive to me to have my interrupt handler have to
save my mask for me and then restore it when it exits. In fact I
can say it's wrong to do that since the handler doesn't easily know
if another interrupt is pending. Is this really the way the 80186 PIC
works or is my manual wrong? If it does work this way how does one
write code for the example above? Thanks in advance.

	- Joel Coltoff
	{sdcrdcf,psuvax1,seismo}!burdvax!coltoff