🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6199

Re: CS and IP problem

#6199
From: Walter Bright
Date: Sun, 27 Dec 1992 00:16
15 lines
923 bytes
In article <1g7623INNli3@mercury.kingston.ac.uk> cs_e404@ceres (Sean Batten) writes:
/Now, I can see now you save the AX,BX,CX,DX,DS,ES,SS and Flags, you
/simply store them straight away when you switch tasks, but _HOW_ do you
/save the CS and IP registers since their values will have changed when
/the tasks switched?????

When a CALL or INT or external interrupt occurs, the CS and IP are saved
on the stack. In fact, a CALL is equivalent to:

	PUSH	CS
	PUSH	offset L1
	JMP	subroutine
L1:	...

So, you save CS and IP by looking at the stack.
Technical Details
Message-ID: <1544@nazgul.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!pilchuck!fnx!nazgul!bright
References: <1g7623INNli3@mercury.kingston.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!pilchuck!fnx!nazgul!bright
From: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.os.msdos.programmer
Subject: Re: CS and IP problem
Message-ID: <1544@nazgul.UUCP>
Date: 27 Dec 92 00:16:05 GMT
References: <1g7623INNli3@mercury.kingston.ac.uk>
Reply-To: bright@nazgul.UUCP (Walter Bright)
Organization: Zortech, Seattle
Lines: 15