Where does intel 80386 save registers?

让人想犯罪 __ 提交于 2019-12-25 15:19:45

问题


I am trying to develop my own basic kernel for educational purpose. I was reading the Intel 80386 and reading about the the interrupt 0 :- Divide by zero exception.

In there, it was written :-

Saved Instruction Pointer Saved contents of CS and EIP registers point to the instruction that generated the exception.

My question is where are these registers saved. How, can I access these registers ?


回答1:


An Interrupt pushes the current contents of the EFLAGS, CS, and EIP registers (in that order) on the stack. For some exceptions the CPU push an error code after EIP but not for Divide by zero.

If you develop your own kernel you should really take a look into the Intel Software Developer Manual. There is a chapter about Interrupts and Exceptions (6.4 in the actual version) and this includes a complete description what is when pushed.



来源:https://stackoverflow.com/questions/26024371/where-does-intel-80386-save-registers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!