1 ; Standard macro set for NASM -*- nasm -*-
3 ; Macros to make NASM ignore some TASM directives before the first include
13 ; This is a magic token which indicates the end of the TASM macros
16 ; Note that although some user-level forms of directives are defined
17 ; here, not all of them are: the user-level form of a format-specific
18 ; directive should be defined in the module for that directive.
20 ; These three need to be defined, though the actual definitions will
21 ; be constantly updated during preprocessing.
26 %define __SECT__ ; it ought to be defined, even if as nothing
28 %imacro section 1+.nolist
29 %define __SECT__ [section %1]
32 %imacro segment 1+.nolist
33 %define __SECT__ [segment %1]
37 %imacro absolute 1+.nolist
38 %define __SECT__ [absolute %1]
42 %imacro struc 1.nolist
44 %define %$strucname %1
46 %$strucname: ; allow definition of `.member' to work sanely
48 %imacro endstruc 0.nolist
54 %imacro istruc 1.nolist
56 %define %$strucname %1
59 %imacro at 1-2+.nolist
60 times %1-($-%$strucstart) db 0
64 times %{$strucname}_size-($-%$strucstart) db 0
68 %imacro align 1-2+.nolist nop
69 times ($$-$) % (%1) %2
71 %imacro alignb 1-2+.nolist resb 1
72 times ($$-$) % (%1) %2
74 %imacro alignr 1-2+.nolist
78 times ($$-$) % (%1) %2
82 %imacro extern 1-*.nolist
89 %imacro bits 1+.nolist
93 %imacro use16 0.nolist
96 %imacro use32 0.nolist
99 %imacro use64 0.nolist
103 %imacro global 1-*.nolist
110 %imacro common 1-*.nolist
117 %imacro cpu 1+.nolist
121 %define __FLOAT_DAZ__ nodaz
122 %define __FLOAT_ROUND__ near
123 ; __FLOAT__ contains the whole floating-point configuration so it can
124 ; be saved and restored
125 %define __FLOAT__ __FLOAT_DAZ__,__FLOAT_ROUND__
126 %imacro float 1-*.nolist
130 %define __FLOAT_DAZ__ daz
132 %define __FLOAT_DAZ__ nodaz
134 %define __FLOAT_ROUND__ near
136 %define __FLOAT_ROUND__ up
138 %define __FLOAT_ROUND__ down
140 %define __FLOAT_ROUND__ zero
142 %define __FLOAT_DAZ__ nodaz
143 %define __FLOAT_ROUND__ near
149 %imacro default 1+.nolist
153 %imacro incbin 1-2+.nolist 0