About the popad instructions

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
ppppllll1234
Posts: 13
Joined: Sat Apr 09, 2011 9:28 pm

About the popad instructions

Post by ppppllll1234 »

In "INTERRUPT AND EXCEPTION HANDLING" chapter of the Intel Pentium Programming manual,

A small subset of exceptions that are normally reported as faults are not
restartable and will result in loss of some processor state. An example,
executing a POPAD instruction where the stack frame crosses over the end of
the stack segment will cause such a fault to be reported. Here, the exception
handler will see that the instruction pointer (CS:EIP) has been restored as if
the POPAD instruction had not been executed; however, the internal
processor state (particularly, the general-purpose registers) will have been
modified. These corner cases are considered programming errors, and an
application causing this class of exceptions will likely be terminated by the
operating system.


I thnik that if POPAD occur a fault, the processor will restore general-purpose registers state to before this instruction executing.
why it's say the internal processor state have been modified?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: About the popad instructions

Post by Combuster »

why it's say the internal processor state have been modified?
Because it does, end of story.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply