|How to optimize Intel's JMP instruction? email@example.com (Li Ping) (2002-07-24)|
|Re: How to optimize Intel's JMP instruction? firstname.lastname@example.org (R.S. Veldema) (2002-07-25)|
|From:||"Li Ping" <email@example.com>|
|Date:||24 Jul 2002 02:17:02 -0400|
|Posted-Date:||24 Jul 2002 02:17:02 EDT|
This problem seems more complex than I thought. A good
compiler/assembler should use the short jump instruction whenever
possible. However, it's not as easy as it appears. Because there could
be other optimizable JMP instructions between this one and the target
Here's an example. This is an excerpt from a list file produced by
MASM 6.15. This assembler always chooses the shortest possible
encoding for each JMP truction. In the example below, it's the 2nd JMP
00000003 E9 00000081 jmp @1
00000008 EB 7F jmp @1
00000080 E9 FFFFFF7B jmp @2
Question: How could a compiler/assembler optimize the JMP instruction?
Algorithm, data structures?
[See the comp.compilers archives. This is a well-studied problem. -John]
Return to the
Search the comp.compilers archives again.