From 5698669639479baed865e4bbf3fde26fff8d4312 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Jan 2010 00:52:23 +0000 Subject: [PATCH] Update macros a bit more svn path=/branches/ros-amd64-bringup/; revision=45330 --- reactos/include/reactos/asm.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/reactos/include/reactos/asm.h b/reactos/include/reactos/asm.h index 3aef7f1b595..fab908d29b7 100644 --- a/reactos/include/reactos/asm.h +++ b/reactos/include/reactos/asm.h @@ -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