Page 1 of 1

Stack after Interrupt

Posted: Fri Oct 07, 2005 8:12 am
by bluecode
hi,

After an interrupt without ring-change and without error-code the stack looks like this (taken from Intel manual):
eflags
cs
eip <--esp points here
What I now want to know is: Are all these bits 32bit wide, because my processor/bochs always wants to push 12 byte? The Intel manual doesn't say anything about that.
Thanks in advance!

[edit: I think it must be 32bit. I looked at beyond Infinities multitasking turtial. But I don't understand why they use 32Bit for a 16Bit register? Is it only because of 4byte alignment -> faster?]

Re:Stack after Interrupt

Posted: Fri Oct 07, 2005 8:42 am
by proxy
yes they are all 32-bit pushes. also...32-bits on intel = 4 bytes... 4 * 3 = 12. all seems to add up correctly to me.

proxy

Re:Stack after Interrupt

Posted: Fri Oct 07, 2005 8:52 am
by bluecode
thanks,

but why is cs pushed as 32bit? It is a 16bit register.

Re:Stack after Interrupt

Posted: Fri Oct 07, 2005 9:20 am
by Pype.Clicker
because the stack is 32-bit wide and that you do want to keep things pushed/popped aligned on 32-bit addresses for performance (or at least, intel guys do if you don't).