svn path=/branches/ros-amd64-bringup/; revision=45330
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Kernel
* FILE: ntoskrnl/include/amd64/asmmacro.S
* 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
* 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
/* MASM/ML doesn't want explicit [rip] addressing */
#define RIP(address) address
+/* 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 /***********************************************************************/
#else /***********************************************************************/
.intel_syntax noprefix
.code64
.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]
/* GAS needs explicit [rip] addressing */
#define RIP(address) address##[rip]
.endm
/* ... and .ENDP, replacing ENDP */
.endm
/* ... and .ENDP, replacing ENDP */
.cfi_endproc
.endfunc
.endm
.cfi_endproc
.endfunc
.endm
/* MASM compatible PUBLIC */
#define PUBLIC .global
/* 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
/* Macros for x64 stack unwind OPs */
.macro .allocstack size