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) - (($-$$) % (%1))) %2
71 %imacro alignb 1-2+.nolist
73 resb ((%1) - (($-$$) % (%1)))
75 times ((%1) - (($-$$) % (%1))) %2
79 %imacro extern 1-*.nolist
86 %imacro bits 1+.nolist
90 %imacro use16 0.nolist
93 %imacro use32 0.nolist
96 %imacro use64 0.nolist
100 %imacro global 1-*.nolist
107 %imacro common 1-*.nolist
114 %imacro cpu 1+.nolist
118 %define __FLOAT_DAZ__ nodaz
119 %define __FLOAT_ROUND__ near
120 ; __FLOAT__ contains the whole floating-point configuration so it can
121 ; be saved and restored
122 %define __FLOAT__ __FLOAT_DAZ__,__FLOAT_ROUND__
123 %imacro float 1-*.nolist
127 %define __FLOAT_DAZ__ daz
129 %define __FLOAT_DAZ__ nodaz
131 %define __FLOAT_ROUND__ near
133 %define __FLOAT_ROUND__ up
135 %define __FLOAT_ROUND__ down
137 %define __FLOAT_ROUND__ zero
139 %define __FLOAT_DAZ__ nodaz
140 %define __FLOAT_ROUND__ near
146 %imacro default 1+.nolist
150 %imacro incbin 1-2+.nolist 0