开发者

ASM x86 relative JMP

开发者 https://www.devze.com 2022-12-24 10:05 出处:网络
I\'m doing some ASM code in a C code with the asm function. My env开发者_C百科ironment is DVL with gcc version 3.

I'm doing some ASM code in a C code with the asm function.

My env开发者_C百科ironment is DVL with gcc version 3.

Hi need to make a JMP to a relative address like %eip+0x1f.

How can I do this ?

Thanks


x86 supports a short jump (JMP, opcode EB + 1 byte relative address) which should do what you want.

In most assemblers (including gcc's inline asm IIRC) you can just put a label where you want to jump to, and use jmp mylabel and let the assember figure out the correct opcode and relative address for the jump.

0

精彩评论

暂无评论...
验证码 换一张
取 消