title: How does C++ exception handling translate to machine code
body: <p>Mentally, I've always wondered how try/throw/catch looks behind the scenes, when the C++ compiles translates it to assembler. But since I never use it, I never got around to checking it out (some people would say lazy).</p>
  
  <p>Is the normal stack used for keeping track of <code>try</code>s, or is a separate per-thread stack kept for this purpose alone? Is the implementation between MSVC and g++ big or small? Please show me some pseudo asm (IA-32 is ok too) so I never have to check it out myself! :)</p>
  
  <p><strong>Edit:</strong> Now I get the basics of MSVC's implementation on IA-32 handling. Anybody know for g++ on IA-32, or any other CPU for that matter?</p>
  
  <p><strong>Edit 2 (11 years later):</strong> <a href="https://pspdfkit.com/blog/2020/performance-overhead-of-exceptions-in-cpp/" rel="noreferrer">Here</a> are some data on performance. They've also made <a href="https://github.com/PSPDFKit-labs/cpp-exceptions-testing" rel="noreferrer">source code</a> freely available.</p>