获取当前指令的x86地址 [英] Get address of current instruction for x86

查看:183
本文介绍了获取当前指令的x86地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Linux使用x86(64位为precise)。有没有一种方法可以让我得到当前指令的地址。其实我想写的的setjmp / longjmp的我自己的简化版本。 这里,R ..发布的的longjmp 的简化版本。任何想法如何的setjmp 的实施。一个简化版本,也就是说,在不考虑异常和信号等...

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 setjmp/longjmp. Here, R.. posted a simplified version of longjmp. Any idea how setjmp is implemented. A simplified version that is, without taking into account of exceptions and signals etc...

推荐答案

我相信,在64位code,可根本就 LEA RAX,[RIP]

I believe in 64-bit code you can simply do lea rax, [rip].

32位的成语是:

      call next
next: pop eax

这篇关于获取当前指令的x86地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆