home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8934 < prev    next >
Encoding:
Text File  |  1992-08-31  |  2.9 KB  |  60 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!usc!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!sobeco!alawrenc
  3. From: alawrenc@sobeco.com (a.lawrence)
  4. Subject: Re: file positioning with buffered/unbuffered I/O
  5. Reply-To: alawrenc@sobeco.com
  6. Organization: Lawrence & Assc.
  7. Date: Tue, 1 Sep 92 08:41:13 GMT
  8. Message-ID: <1992Sep1.084113.18678@sobeco.com>
  9. References: <1992Aug8.111834.19417@klaava.Helsinki.FI> <1992Aug10.205740.4357@irscscm.UUCP> <1992Aug25.153322.13793@jhunix.hcf.jhu.edu> <1992Aug31.150850.2188@brandonu.ca>
  10. Lines: 48
  11.  
  12. In <1992Aug31.150850.2188@brandonu.ca> dueck@brandonu.ca writes:
  13.  
  14. >In article <1992Aug25.153322.13793@jhunix.hcf.jhu.edu>, gregg_c@jhunix.hcf.jhu.edu (Christopher H Gregg) writes:
  15. >> Hi, I am writing an assembly language program and I am having some
  16. >> problems with it.  The program is memory resident and it traps int 1Ch.
  17. >> After it traps the interrupt, it checks if a certain amount of time
  18. >> has passed and then it deletes a certain file on a directory.  The
  19. >> problem is that when I try to use either DOS function 13h (delete file)
  20. >> or DOS function 41h (which I would prefer), the program crashes.
  21. >> 
  22. >You have become stuck on one of the worst problems in DOS: its not
  23. >re-entrant. However, you can tell when its safe to call DOS by checking
  24. >the DOS-safe flag. This is a one-byte value located one byte past the 
  25. >address returned in DS:SI by interrupt 21 function 5D06 and it is zero
  26. >when it is safe to call DOS. Unfortunately the flag lies: It is safe to call
  27. >DOS if DOS is busy with a call <= 0x0C, mostly standard input and output
  28. >calls. However, when DOS is in a keyboard-polling loop, it invokes
  29. >interrupt 28, the DOS-idle interrupt.
  30.  
  31. >Your program should acquire its data via int 1C and write it out from a
  32. >routine called via int 28.
  33.  
  34. >This solution will break if you have hot-keyed back into a TSR, thereby
  35. >activating via int 28. The TSR can't use int 21 subfunction <= 0C, and
  36. >int 28 can't be re-entered. Does anyone know the solution to this problem?
  37.  
  38. Yes.  But its very long to publish here.  It would recommend the following
  39. readings:
  40.  
  41.      Strategies and Techniques for Writing State-of-the-Art TSR's, 
  42.      Douglas Boling, Microsoft Systems Journal, Vol 7 No 1, Jan-Feb 92.
  43.  
  44.      The MS-DOS Encyclopedia, Ray Ducan etal., Microsoft Press, 1988.
  45.  
  46.      The Waite Group's MS-DOS Developer's Guide, 2nd Ed., Howard W.
  47.      Sams & Co., 1989
  48.  
  49. TSR programming is no longer the dark secret is once was, but there 
  50. are a lot of considerations.  Basic TSR's need to trap at least 3 or
  51. 4 different interrupts, and further complications are created for
  52. a TSR running in a Windows environment.
  53.  
  54.  
  55. -- 
  56. On a clear disk you can seek forever.
  57. -------------------------------------------------------------------------
  58. Andrew Lawrence, Informaticien Conseil           |  alawrenc@sobeco.com
  59. 3605 St-Urbain, #1605                            |  uunet!sobeco!alawrenc
  60.