title: How can I register a structured exception handler in assembly on x86-64 architecture on Windows?
body: <p>In x86 you can simply register your handler with the following 3 instructions.</p>
  
  <pre><code>push addrOfExceptionHandler
  push dword [fs:0]
  mov [fs:0],esp
  </code></pre>
  
  <p>But this doesn't work on 64 bit Windows.</p>
  
  <p>I have read the x64 exception handler is table based and Visual C++'s <code>__try</code> and <code>__except</code> blocks are hard wired into the exception directory. Does this mean the Microsoft totally dropped this old method? Is there a way to register handlers programatically from code then?</p>