TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: KOSTYA IVANILOV
from: HUGH NOLAND
date: 1997-08-14 11:11:00
subject: (?) Write to file from TSR interrupt han11:11:1008/14/97

KI> How can I write to file from my TSR interrupt handler (Int 08, 09)?
KI> Can anybody explain me this procedure? Thanx.
 
I have a Tsr I wrote to dump the screen to a file.  I just used the
usual Dos function 40h.  However, when a Tsr is invoked the process i.d.
remains that of whatever application was already running; so use of
Dos file-handling functions can create problems with the file-handle
array.  To get around this, before calling int 21h you can do the
following:
 
;get process i.d. of application, and save
;
get_id:
   mov ah,51h
   int 21h
   mov pi_save,bx
 
;set process i.d. = psp of Tsr
;
   mov ah,50h
   mov bx,cs
   int 21h
 
Before exiting the Tsr you will need to restore the process i.d. to
its original value.
 
   --Hugh--
 
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.