Page 1 of 1

How big are interrupt error codes?

Posted: Sat Jul 25, 2015 4:22 am
by StartOS
Right now I am working on implementing interrupts in my toy OS.
When a interrupt that pushes an error code occurs it pushes: ss, esp, eflags, cs, eip and finally the error code! Right?
But is the error code 32 bit?
If I want to pop it, i'd go: pop ah, pop ax or pop eax?

Re: How big are interrupt error codes?

Posted: Sat Jul 25, 2015 5:24 am
by tkausl
StartOS wrote:When a interrupt that pushes an error code occurs it pushes: ss, esp, eflags, cs, eip and finally the error code! Right?
ss and esp are only pushed if you're interrupting from user-code through a TSS and in the other direction, are only poped if cs is not the same as the actual cs.

I use the full 4 bytes (from c) of the errorcode and it works

Re: How big are interrupt error codes?

Posted: Sat Jul 25, 2015 5:56 am
by StartOS
Thanks tkausl !