开发者

Assembly: Jump from one section to another

In x86 assembly, how can I perform an unconditional jump from one section anoth开发者_开发技巧er?

Eg:

.section .text
main:    ...
         jmp here
         ...

.section .another
here:    ...

I guess this is a far jump. I get a segfault when trying to run this. Any workaround?


Since you did not specify what assembler type (nasm, gas, masm, tasm)

If you know what segment is the the here part is, for example, if the .section part is in code segment 0x8, then you could do this:

jmp 0x8:here

You could define the constant to specify the segment and use that also...again your mileage will vary depending on the assembler..

Hope this helps, Best regards, Tom.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜