Stack after Interrupt

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
bluecode

Stack after Interrupt

Post 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?]
proxy

Re:Stack after Interrupt

Post 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
bluecode

Re:Stack after Interrupt

Post by bluecode »

thanks,

but why is cs pushed as 32bit? It is a 16bit register.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Stack after Interrupt

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