Update macros a bit more
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 30 Jan 2010 00:52:23 +0000 (00:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 30 Jan 2010 00:52:23 +0000 (00:52 +0000)
svn path=/branches/ros-amd64-bringup/; revision=45330

reactos/include/reactos/asm.h

index 3aef7f1..fab908d 100644 (file)
@@ -2,12 +2,18 @@
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Kernel
  * FILE:            ntoskrnl/include/amd64/asmmacro.S
- * PURPOSE:         ASM macros for for GAS and ML64
+ * PURPOSE:         ASM macros for for GAS and MASM/ML64
  * PROGRAMMERS:     Timo Kreuzer (timo.kreuzer@reactos.org)
  */
 
 #ifdef _MSC_VER
 
+/* Allow ".name" identifiers */
+OPTION DOTNAME
+
+/* Hex numbers need to be in 01ABh format */
+#define HEX(x) 0##x##h
+
 /* MASM/ML doesn't want explicit [rip] addressing */
 #define RIP(address) address
 
@@ -24,6 +30,13 @@ ENDM
     name ENDP
 ENDM
 
+/* MASM doesn't have an ASCIIZ macro */
+.ASCIIZ MACRO text
+    DB text, 0
+ENDM
+
+/* We need this to distinguish repeat from macros */
+#define ENDR ENDM
 
 #else /***********************************************************************/
 
@@ -31,6 +44,9 @@ ENDM
 .intel_syntax noprefix
 .code64
 
+/* Hex numbers need to be in 0x1AB format */
+#define HEX(x) 0x##x
+
 /* GAS needs explicit [rip] addressing */
 #define RIP(address) address##[rip]
 
@@ -46,7 +62,7 @@ ENDM
 .endm
 
 /* ... and .ENDP, replacing ENDP */
-.macro .ENDP
+.macro .ENDP name
     .cfi_endproc
     .endfunc
 .endm
@@ -54,6 +70,14 @@ ENDM
 /* MASM compatible PUBLIC */
 #define PUBLIC .global
 
+/* MASM compatible ALIGN */
+#define ALIGN .align
+
+/* MASM compatible REPEAT, additional ENDR */
+#define REPEAT .rept
+#define ENDR .endr
+
+
 /* Macros for x64 stack unwind OPs */
 
 .macro .allocstack size