From 8b262474424c0f6912b22bbf7452f26bfa4d1235 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 26 Feb 2019 14:00:54 -0800 Subject: preproc: add %i... variants, evaluated macro parameters, cleanups All directives which create single-line macros now have %i... variants to define case-insensitive versions. Case insensitive rather sucks, but at least this way it is consistent. Single-line macro parameters can now be evaluated as a number, as done by %assign. To do so, declare a parameter starting with =, for example: %define foo(x,=y) mov [x],macro_array_y ... would evaluate y as a number but leave x as a string. NOTE: it would arguably be better to have this as a per-instance basis, but it is easily handled by having a secondary macro called with the same argument twice. Finally, add a more consistent method for defining "magic" macros, which need to be evaluated at runtime. For now, it is only used by the special macros __FILE__, __LINE__, __BITS__, __PTR__, and __PASS__. __PTR__ is a new macro which evaluates to word, dword or qword matching the value of __BITS__. The magic macro framework, however, provides a natural hook for a future plug-in infrastructure to hook into a scripting language. Signed-off-by: H. Peter Anvin --- macros/standard.mac | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'macros') diff --git a/macros/standard.mac b/macros/standard.mac index a6c50b68..7bc5af67 100644 --- a/macros/standard.mac +++ b/macros/standard.mac @@ -1,6 +1,6 @@ ;; -------------------------------------------------------------------------- ;; -;; Copyright 1996-2016 The NASM Authors - All Rights Reserved +;; Copyright 1996-2019 The NASM Authors - All Rights Reserved ;; See the file AUTHORS included with the NASM distribution for ;; the specific copyright holders. ;; @@ -49,12 +49,6 @@ STD: nasm ; here, not all of them are: the user-level form of a format-specific ; directive should be defined in the module for that directive. -; These three need to be defined, though the actual definitions will -; be constantly updated during preprocessing. -%define __FILE__ -%define __LINE__ -%define __BITS__ - %define __SECT__ ; it ought to be defined, even if as nothing %imacro section 1+.nolist -- cgit v1.2.1