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 resb 1
72 times ($$-$) & ((%1)-1) %2
75 %imacro extern 1-*.nolist
82 %imacro bits 1+.nolist
86 %imacro use16 0.nolist
89 %imacro use32 0.nolist
92 %imacro use64 0.nolist
96 %imacro global 1-*.nolist
103 %imacro common 1-*.nolist
110 %imacro cpu 1+.nolist
114 %define __FLOAT_DAZ__ nodaz
115 %define __FLOAT_ROUND__ near
116 ; __FLOAT__ contains the whole floating-point configuration so it can
117 ; be saved and restored
118 %define __FLOAT__ __FLOAT_DAZ__,__FLOAT_ROUND__
119 %imacro float 1-*.nolist
123 %define __FLOAT_DAZ__ daz
125 %define __FLOAT_DAZ__ nodaz
127 %define __FLOAT_ROUND__ near
129 %define __FLOAT_ROUND__ up
131 %define __FLOAT_ROUND__ down
133 %define __FLOAT_ROUND__ zero
135 %define __FLOAT_DAZ__ nodaz
136 %define __FLOAT_ROUND__ near
142 %imacro default 1+.nolist
146 %imacro incbin 1-2+.nolist 0