🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #1208

CS and IP problem

#1208
From: Bruce Weinel
Date: Mon, 14 Dec 1992 09:00
37 lines
1934 bytes
Sean Batton (cs) was heard in "The Pit" saying to  All

  cs> From: cs_e404@ceres (Sean Batten)
  cs> Organization: Kingston University
  cs>
  cs> Heres a little problems thats been nagging me for a while, and as I've
  cs> been unable to work it out for myself I'm going to have to ask for help.
  cs> 
  cs> Whats I'm interested in is a metod of storing the CS and IP registers
  cs> when a jump has been made the 80X86 family of processors. Just in case
  cs> the isn't very clear let me alaborate.
  cs> 
  cs> Image in a multi-tasking operating system that you switch tasks. In
  cs> order to return to the task you will need to store the following
  cs> registers :
  cs> 
  cs> AX,BX,CX,DX,CS,DS,ES,SS,IP along with the Flags.
  cs> 
  cs> Now, I can see now you save the AX,BX,CX,DX,DS,ES,SS and Flags, you
  cs> simply store them straight away when you switch tasks, but _HOW_ do
  cs> you save the CS and IP registers since their values will have changed
  cs> when the tasks switched?????
  cs> 
  cs> A reply would be EXTREMELY GRATEFUL as this problem has been driving
  cs> me round the bend for months and I'm sure there is an answer to it.
  cs> 
  cs> Thanks in advance,
  cs> 
  cs> Sean Batten, Kingston University

In a context switch you are probably using an interrupt, either hardware or
software (if you aren't then you're in trouble), and interrupts store the
flags,
CS and IP in the stack _before_ jumping to the new location. If you need the
old values then get them out of the stack.

 * Origin: Howls from "The Pit" BBS (03) 321-3295 (3:632/456.1@fidonet)
Technical Details
Message-ID: <724526721.AA01683@csource.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!jabaru.cec.edu.au!csource!gateway

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!jabaru.cec.edu.au!csource!gateway
From: Bruce.Weinel@p1.f456.n632.z3.fidonet.org (Bruce Weinel)
Newsgroups: comp.sys.intel
Subject: CS and IP problem
Message-ID: <724526721.AA01683@csource.oz.au>
Date: Mon, 14 Dec 1992 09:00:38
Sender: gateway@csource.oz.au
Lines: 37