
25112 Rev. 3.06 September 2005 | Software Optimization Guide for AMD64 Processors |
4.12Code Padding with Operand-Size Override and
NOP
Optimization
Use one or more
Application
This optimization applies to:
•
•
Rationale
Occasionally it is necessary to insert neutral code fillers into the code stream (for example, for code- alignment purposes or to space out branches). Because this filler code is executable, it should take up as few execution resources as possible, not diminish decode density, and not modify any processor state other than advancing the instruction pointer (rIP). Although there are several possible multibyte
Example
Assign
NOP1_OVERRIDE_NOP TEXTEQU <DB 090h>
NOP2_OVERRIDE_NOP TEXTEQU <DB 066h,090h>
NOP3_OVERRIDE_NOP TEXTEQU <DB 066h,066h,090h> NOP4_OVERRIDE_NOP TEXTEQU <DB 066h,066h,066h,090h> NOP5_OVERRIDE_NOP TEXTEQU <DB 066h,066h,090h,066h,090h> NOP6_OVERRIDE_NOP TEXTEQU <DB 066h,066h,090h,066h,066h,090h> NOP7_OVERRIDE_NOP TEXTEQU <DB 066h,066h,066h,090h,066h,066h,090h>
NOP8_OVERRIDE_NOP TEXTEQU <DB 066h,066h,066h,090h,066h,066h,066h,090h>
NOP9_OVERRIDE_NOP TEXTEQU <DB 066h,066h,090h,066h,066h,090h,066h,066h,090h>
For x87
Chapter 4 | 89 |