Question about INT's

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Patrick Lindenberg

Question about INT's

Post 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!
roswell

Re: Question about INT's

Post by roswell »

On the stack.

Look at Intel's Programmer Guide

Roswell
Kernel Panic

Re: Question about INT's

Post 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..
Post Reply