Mail Archives: djgpp/2000/01/14/14:30:00
On Thu, 13 Jan 2000, Andrew Jones wrote:
> DOS maintains several internal data structures and other things. Due to the
> nature of DOS, you cannot call a DOS function while another DOS function is
> executing. Since your ISR is using (at the low level) a DOS function to
> print to the screen, when the timer increments and the ISR is called again
> it leaves the DOS function which you are still in, jumps to the ISR, and
> jumps back to the beginning of the DOS print to screen function. This is a
> big no-no.
It's a no-no because DOS foolishly overwrites the contents of the stack
that was previously stored (I mean the stack containing the registers that
are to be restored before control is transferred back to the main
program), rather than pushing them in a new location. In short, it isn't
re-entrant.
- Raw text -