home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / intel / 2723 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.8 KB

  1. Path: sparky!uunet!munnari.oz.au!jabaru.cec.edu.au!csource!gateway
  2. From: Bruce.Weinel@p1.f456.n632.z3.fidonet.org (Bruce Weinel)
  3. Newsgroups: comp.sys.intel
  4. Subject: CS and IP problem
  5. Message-ID: <724526721.AA01683@csource.oz.au>
  6. Date: Mon, 14 Dec 1992 09:00:38
  7. Sender: gateway@csource.oz.au
  8. Lines: 37
  9.  
  10. Sean Batton (cs) was heard in "The Pit" saying to  All
  11.  
  12.   cs> From: cs_e404@ceres (Sean Batten)
  13.   cs> Organization: Kingston University
  14.   cs>
  15.   cs> Heres a little problems thats been nagging me for a while, and as I've
  16.   cs> been unable to work it out for myself I'm going to have to ask for help.
  17.   cs> 
  18.   cs> Whats I'm interested in is a metod of storing the CS and IP registers
  19.   cs> when a jump has been made the 80X86 family of processors. Just in case
  20.   cs> the isn't very clear let me alaborate.
  21.   cs> 
  22.   cs> Image in a multi-tasking operating system that you switch tasks. In
  23.   cs> order to return to the task you will need to store the following
  24.   cs> registers :
  25.   cs> 
  26.   cs> AX,BX,CX,DX,CS,DS,ES,SS,IP along with the Flags.
  27.   cs> 
  28.   cs> Now, I can see now you save the AX,BX,CX,DX,DS,ES,SS and Flags, you
  29.   cs> simply store them straight away when you switch tasks, but _HOW_ do
  30.   cs> you save the CS and IP registers since their values will have changed
  31.   cs> when the tasks switched?????
  32.   cs> 
  33.   cs> A reply would be EXTREMELY GRATEFUL as this problem has been driving
  34.   cs> me round the bend for months and I'm sure there is an answer to it.
  35.   cs> 
  36.   cs> Thanks in advance,
  37.   cs> 
  38.   cs> Sean Batten, Kingston University
  39.  
  40. In a context switch you are probably using an interrupt, either hardware or
  41. software (if you aren't then you're in trouble), and interrupts store the
  42. flags,
  43. CS and IP in the stack _before_ jumping to the new location. If you need the
  44. old values then get them out of the stack.
  45.  
  46.  * Origin: Howls from "The Pit" BBS (03) 321-3295 (3:632/456.1@fidonet)
  47.