home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / alt / msdos / programm / 2719 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  2.0 KB

  1. Xref: sparky alt.msdos.programmer:2719 comp.os.msdos.programmer:10553
  2. Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer
  3. Path: sparky!uunet!clarkson!smithbm
  4. From: smithbm@craft.camp.clarkson.edu (Azrak)
  5. Subject: Re: my_tsr
  6. Message-ID: <smithbm.721597007@craft.camp.clarkson.edu>
  7. Sender: news@news.clarkson.edu
  8. Nntp-Posting-Host: craft.camp.clarkson.edu
  9. Organization: Clarkson University
  10. References: <1348@datmuc.UUCP>
  11. Date: Thu, 12 Nov 1992 19:36:47 GMT
  12. Lines: 35
  13.  
  14. vincent@datmuc.UUCP (vincent) writes:
  15.  
  16. >This is a (re)repost I never got any replys, The Org. Q. was why this code
  17. >doesn't work?
  18.  
  19. [Lot's of text and code deleted....]
  20.  
  21. >P.P.P.S. I will continue on my side like instead of allocating a stack,
  22. >have a fix buffer in the code segment. Also to date I'm not shure
  23. >if I need to save the DS since it is anyway restore at the interrupt.
  24. >Also in the inline asembly I might try to set ds to cs (for my data) and
  25. >also for the stack seg.. (I guess I do need my own stack). The only thing I know
  26. >about .COM is that LINK tell me that for tiny memory model I am not alowed
  27. >to have _far pointers.
  28.  
  29. In the very few TSRs I have written (all in assembly, I'm afraid), I
  30. save ALL registers I use, especially segment registers, like DS.
  31. I never made my own stack, but the TSRs I wrote were also of the clock
  32. interrupt type, and did not perform stack intensive operations,
  33. though I did PUSH a few registers, including DS.
  34. I did set DS = CS  upon entering the clock interrupt so I could get at
  35. my own data easier, just remember to save DS before assigning it.
  36.  
  37. If you wish, I will post one of my TSRs for you to look at, but remember
  38. that it is completely in 8088 assembly, and I am not a CS major. The
  39. program might not be as efficient as possible, however it is quite
  40. stable and will not crash very easily.
  41.  
  42. - Brian  (smithbm@craft.camp.clarkson.edu)
  43.  
  44. As for my opinion for why it crashes, try saving all registers used
  45. in the interrupt routine. At least you will be at a "known state" and
  46. can go from there. Just remember to POP all registers in reverse order
  47. at the end of your routine.
  48.  
  49.