home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7595 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.6 KB  |  54 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!newsroom.utas.edu.au!bruny.cc.utas.edu.au!u910826
  3. From: u910826@bruny.cc.utas.edu.au (Louis        siuoL)
  4. Subject: Re: interrupts and neat things of these sorts
  5. Message-ID: <u910826.724907973@bruny>
  6. Sender: news@newsroom.utas.edu.au
  7. Organization: University of Tasmania, Australia.
  8. References: <1992Dec17.225939.939453@sue.cc.uregina.ca>
  9. Date: Mon, 21 Dec 1992 03:19:33 GMT
  10. Lines: 42
  11.  
  12. beuker@hercules.cs.uregina.ca (Craig Beuker) writes:
  13.  
  14.  
  15. >    Season's Greetings all. I have a question about interrupts.  quite simple
  16. >    actually.. How do I implement one?  Is there any documentation out there
  17. >    on how these little suckers work?  I am using T.Pascal 5.5  and the example
  18. >    they give in the help file is not very enlightening..
  19. >    Any, or all help will be much appreciated.
  20. >    (I want to implement an interrupt that will monitor the comm port for 
  21. >    characters, if one is encountered, add it to w QUE(circular) for later
  22. >    processing.)  Thanx for your help.
  23.  
  24. >       Craig..
  25.  
  26. ok, here is a possible way (off the top of my head, so there may be errors).
  27.  
  28. USES
  29.     Dos;
  30. VAR
  31.     OldInt:PROCEDURE;
  32.  
  33.     PROCEDURE MyInt; Interrupt;
  34.     BEGIN
  35.  
  36.         Do stuff here
  37.  
  38.         ASM PUSHF;END;OldInt; { This line is chains to the old int handler, and may not be necessary for all ints }
  39.     END;
  40.  
  41. BEGIN
  42.     GetIntVec(IntNum,@OldInt);
  43.     SetIntVec(IntNum,@MyInt);
  44.     
  45.     Do main stuff here
  46.  
  47.     SetIntVec(IntNum,@OldInt);
  48. END.
  49. --
  50. Louis Solomon - a student at The University of Tasmania
  51.       e-mail: u910826@bruny.cc.utas.edu.au
  52.  
  53. "If wishes were fishes, we'd all cast nets" - Dune
  54.