home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / intel / 2710 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.4 KB  |  57 lines

  1. Newsgroups: comp.sys.intel
  2. Path: sparky!uunet!mcsun!sun4nl!dutrun!dutiws!wiltinkm
  3. From: wiltinkm@dutiws.twi.tudelft.nl (M. Wiltink.a73A.telnr-015-138378)
  4. Subject: Re: CS and IP problem
  5. Message-ID: <BzAwp0.C98@dutiws.twi.tudelft.nl>
  6. Keywords: What's stored on INT
  7. Organization: Delft University of Technology
  8. References: <1g76bgINNlk2@mercury.kingston.ac.uk> <Bz3pp5.AAw@bailgate.gpsemi.com>
  9. Date: Tue, 15 Dec 1992 12:43:48 GMT
  10. Lines: 45
  11.  
  12. In article <Bz3pp5.AAw@bailgate.gpsemi.com> lee_b@sn4901.oldham.gpsemi.com (Lee Burley) writes:
  13. >Are the SC:IP pair pushed onto the stack after an interrupt??
  14. >
  15. >if so then
  16. >
  17. >  POP AX
  18. >  MOV AX, {cs store}
  19. >  POP BX
  20. >  MOV BX, {ip store}
  21. >  PUSH BX
  22. >  PUSH AX
  23. >
  24. >might work??
  25. >
  26. >PS I might have got the mnemonics a bit wrong, it has been a long time
  27. >since I did any assembler on the 80X86!!
  28.  
  29. If I'm right, the top of the stack will look like this after an interrupt:
  30.  
  31.     +----+
  32.     | IP |
  33.     +----+
  34.     | CS |
  35.     +----+
  36.     | SR | Read Flags-register
  37.     +----+
  38.     | .. |
  39.  
  40. Near Call will push IP
  41. Far call will push CS, IP
  42. Interrupt will push Flags, CS, IP
  43.  
  44. RTI will pop IP, CS, Flags
  45. Far Ret will pop IP, CS
  46. Near Ret will pop IP
  47.  
  48. An assembler I know actually emulated Far call by PUSH CS, NEAR CALL. It works.
  49.  
  50. ---------------------------------------------------------------------------
  51. wiltinkm@dutiws.twi.tudelft.nl
  52. Maarten Wiltink
  53.  
  54. Department of Applied Mathematics and Computer Science
  55. Delft University of Technology
  56. The Netherlands
  57.