[llvm-dev] X86 assembler cannot jump NEAR?

Hlide via llvm-dev llvm-dev at lists.llvm.org
Sat Feb 27 02:06:47 PST 2016


Is there any reason to prefer a NEAR jump to a SHORT jump if the 
assembler deemed it is okay to keep it as a SHORT one?

The only reason you may want to have it as a NEAR jump is because you 
need to alter the target of this jump to another address which may be 
out of a byte range.

Regards

On 27/02/2016 06:00:54, Jun Koi via llvm-dev (llvm-dev at lists.llvm.org) 
wrote:
 > Hi,
 >
 >
 > Currently X86 assembler seems to always compile "jmp _label" as a SHORT
 > jump with "EB" opcode:
 >
 > $ echo "jmp _label"|llvm-mc -assemble -triple=i386 -show-encoding
 >     .text
 >     jmp    _label                  # encoding: [0xeb,A]
 >
 >
 >
 > My question is: can X86 assembler supports NEAR jump with opcode "E9"?
 > I try with "near" keyword, but it is not accepted:
 >
 > $ echo "jmp near _label"|llvm-mc -assemble -triple=i386 -show-encoding
 >     .text
 > <stdin>:1:10: error: unexpected token in argument list
 > jmp near _label
 >          ^
 >
 >
 >
 > Thanks,
 >
 > Jun



More information about the llvm-dev mailing list