How can a get a address from the call stack? I am writing an exception handler and I want to make it show were the CPU exception happened?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Get yourself a copy of the CPU manual from intel.com or amd.com. Look up the chapters on interrupt and exception handling. Find the diagrams showing the stack contents when an interrupt or exception occurs. For example, from INTEL 80386 PROGRAMMER’S REFERENCE MANUAL 1986:
So, there it is, the last things your interrupt handler receives on the stack are the error code (optional; not all exceptions have it and you’ll need to pop it off before doing
iret), theneipandcsof the location that has caused an exception or has been interrupted.