SL>I need some hint! Inside an interrupt handler i did the following.
SL>sti
SL>mov ah,34h
SL>int 21h
SL>mov dl,es:[bx]
SL>cmp dl,01h
SL>je not_safe
SL>....
SL>not_safe: ...
SL>The tsr seem to work fine until i type few keys and lock up very hard!
SL>I wonder what wrong i did?
According to my sources, function 3Fh returns the address of the InDOS flag,
and if the InDOS flag is nonzero, it is unsafe to call DOS functions at that
time. What would be better for your program would be to get the address of
the flag when it first loads, and hold it in the data segment reserved for
your program, then you can load that address to check, instead of using an
nt
21h every time, which could mess up dos. You'll also need to check the
Critical Error flag, which is:
In Dos Version:
2.x : es:[bx+01] (assuming es:bx is the address you originally got for the
InDos flag)
3.0 : es:[bx-01]
3.x, 5.x+ : call int 21h function 5D06h, then ds:[si] is critical error flag,
and ds:[si+01] is InDOS flag
4.x : call int 21h function 5D08h, then word ptr ds:[si] is a count of data
areas, followed by that number of copies of a dword pointer to a data area,
and a word indicating the length of the data area. The first two bytes of
each data area are the critical error flag and the InDOS flag, respectively
((Cloud))
* OLX 2.2 * It's time for TRILL! The game show where YOU'RE the host
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|