0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00

macros: add st() macro to the masm macro package

A very easy way to improve portability.  Guarded with %ifndef just in
case...

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2025-09-29 17:31:42 -07:00
parent b80bec7435
commit 22cef23b34
3 changed files with 10 additions and 1 deletions

View File

@@ -67,6 +67,8 @@ It is the production version of NASM since 2025.
implemented conditional directive, and tries to match it with a implemented conditional directive, and tries to match it with a
corresponding \c{%endif}. See \k{if_caveat}. corresponding \c{%endif}. See \k{if_caveat}.
\b The \c{masm} macro package now defines a macro for x87 register syntax.
\H{cl-2.xx} NASM 2 Series \H{cl-2.xx} NASM 2 Series

View File

@@ -178,6 +178,9 @@ after \c{PROC} other than \c{FAR} is ignored.
\b In 64-bit mode relative addressing is the default (\c{DEFAULT REL}, \b In 64-bit mode relative addressing is the default (\c{DEFAULT REL},
see \k{default-rel}). see \k{default-rel}).
\b A macro is defined to allow the syntax \c{st(0)} instead of
\c{st0}, and so on.
In addition, NASM now natively supports, regardless of whether this In addition, NASM now natively supports, regardless of whether this
package is used or not: package is used or not:

View File

@@ -1,6 +1,6 @@
;; -------------------------------------------------------------------------- ;; --------------------------------------------------------------------------
;; ;;
;; Copyright 2019 The NASM Authors - All Rights Reserved ;; Copyright 2019-2025 The NASM Authors - All Rights Reserved
;; See the file AUTHORS included with the NASM distribution for ;; See the file AUTHORS included with the NASM distribution for
;; the specific copyright holders. ;; the specific copyright holders.
;; ;;
@@ -69,6 +69,10 @@ USE: masm
%undef ret %undef ret
%endmacro %endmacro
%ifndef st
%idefine st(x) st %+ x
%endif
%idefine ptr __?masm_ptr?__ %idefine ptr __?masm_ptr?__
%idefine flat __?masm_flat?__ ; is %idefine really correct here? %idefine flat __?masm_flat?__ ; is %idefine really correct here?
%idefine offset %idefine offset