开发者

Assembly: Jump from one section to another

开发者 https://www.devze.com 2022-12-18 04:23 出处:网络
In x86 assembly, how can I perform an unconditional jump from one section anoth开发者_开发技巧er?

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

精彩评论

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