title: Get address of current instruction for x86
body: <p>I am using Linux with x86 (64 bit to be precise). Is there a way I can get the address of the current instruction. Actually I want to write my own simplified versions of <strong>setjmp/longjmp</strong>. <a href="https://stackoverflow.com/questions/6145173/how-does-longjmp-work">Here</a>, R.. posted a simplified version of <strong>longjmp</strong>. Any idea how <strong>setjmp</strong> is implemented. A simplified version that is, without taking into account of exceptions and signals etc...</p>