summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/smartalign.mac23
1 files changed, 11 insertions, 12 deletions
diff --git a/macros/smartalign.mac b/macros/smartalign.mac
index 921ced8..6ff294a 100644
--- a/macros/smartalign.mac
+++ b/macros/smartalign.mac
@@ -4,11 +4,7 @@
USE: smartalign
%imacro alignmode 1-2.nolist
- %ifnempty %2
- %xdefine __ALIGN_JMP_THRESHOLD__ %2
- %else
- %define __ALIGN_JMP_THRESHOLD__ 17
- %endif
+ %define __ALIGN_JMP_THRESHOLD__ 17
%ifidni %1,nop
%define __ALIGN_16BIT_1B__ 0x90
%define __ALIGN_16BIT_2B__ 0x90,0x90
@@ -38,13 +34,13 @@ USE: smartalign
%define __ALIGN_64BIT_8B__ 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
%elifidni %1,generic
%define __ALIGN_16BIT_1B__ 0x90
- %define __ALIGN_16BIT_2B__ 0x90,0x90
- %define __ALIGN_16BIT_3B__ 0x90,0x90,0x90
- %define __ALIGN_16BIT_4B__ 0x90,0x90,0x90,0x90
- %define __ALIGN_16BIT_5B__ 0x90,0x90,0x90,0x90,0x90
- %define __ALIGN_16BIT_6B__ 0x90,0x90,0x90,0x90,0x90,0x90
- %define __ALIGN_16BIT_7B__ 0x90,0x90,0x90,0x90,0x90,0x90,0x90
- %define __ALIGN_16BIT_8B__ 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
+ %define __ALIGN_16BIT_2B__ 0x89,0xf6
+ %define __ALIGN_16BIT_3B__ 0x8d,0x74,0x00
+ %define __ALIGN_16BIT_4B__ 0x8d,0xb4,0x00,0x00
+ %define __ALIGN_16BIT_5B__ 0x90,0x8d,0xb4,0x00,0x00
+ %define __ALIGN_16BIT_6B__ 0x89,0xf6,0x8d,0xbd,0x00,0x00
+ %define __ALIGN_16BIT_7B__ 0x8d,0x74,0x00,0x8d,0xbd,0x00,0x00
+ %define __ALIGN_16BIT_8B__ 0x8d,0xb4,0x00,0x00,0x8d,0xbd,0x00,0x00
%define __ALIGN_32BIT_1B__ 0x90
%define __ALIGN_32BIT_2B__ 0x89,0xf6
@@ -147,6 +143,9 @@ USE: smartalign
%else
%error unknown alignment mode: %1
%endif
+ %ifnempty %2
+ %xdefine __ALIGN_JMP_THRESHOLD__ %2
+ %endif
%xdefine __ALIGNMODE__ %1,__ALIGN_JMP_THRESHOLD__
%endmacro