home *** CD-ROM | disk | FTP | other *** search
- Path: 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
-
- 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.
-