Page 1 of 1
Question about INT's
Posted: Tue Mar 19, 2002 3:46 am
by Patrick Lindenberg
Hi All,
where is the CS:IP saved before calling interrupt vectors?
i try to emulate task sitch in real mode.
Thax in advance!
Re: Question about INT's
Posted: Tue Mar 19, 2002 3:57 am
by roswell
On the stack.
Look at Intel's Programmer Guide
Roswell
Re: Question about INT's
Posted: Tue Mar 19, 2002 5:24 am
by Kernel Panic
After a software or hardware interrupt is called, you get cs, ip and flags pushed on stack, like roswell said. Your stack looks like this (in real mode):
flags
cs
ip <-- stack top
In case you are running in protected mode (with CS being 32-bit selector; not sure about virtual mode or CS being a 16-bit selector) you get:
eflags
a dword with cs in the least-significant word, 0 in the MSW
eip <--stack top
If it's real mode, it should be rather easy..