Added outmacho.* to static makefile.
[nasm.git] / standard.mac
blobfa2b8b74e65b17deaa73e6e1ab2fa3bf946721a0
1 ; Standard macro set for NASM -*- nasm -*-
3 ; Macros to make NASM ignore some TASM directives before the first include
4 ; directive.
6     %idefine IDEAL
7     %idefine JUMPS
8     %idefine P386
9     %idefine P486
10     %idefine P586
11     %idefine END
13 ; This is a magic token which indicates the end of the TASM macros
14 *END*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.
22 %define __FILE__
23 %define __LINE__
24 %define __BITS__
26 %define __SECT__                ; it ought to be defined, even if as nothing
28 %imacro section 1+.nolist
29 %define __SECT__ [section %1]
30           __SECT__
31 %endmacro
32 %imacro segment 1+.nolist
33 %define __SECT__ [segment %1]
34           __SECT__
35 %endmacro
37 %imacro absolute 1+.nolist
38 %define __SECT__ [absolute %1]
39           __SECT__
40 %endmacro
42 %imacro struc 1.nolist
43 %push struc
44 %define %$strucname %1
45 [absolute 0]
46 %$strucname:                    ; allow definition of `.member' to work sanely
47 %endmacro 
48 %imacro endstruc 0.nolist
49 %{$strucname}_size:
50 %pop
51 __SECT__
52 %endmacro
54 %imacro istruc 1.nolist
55 %push istruc
56 %define %$strucname %1
57 %$strucstart:
58 %endmacro
59 %imacro at 1-2+.nolist
60           times %1-($-%$strucstart) db 0
61           %2
62 %endmacro
63 %imacro iend 0.nolist
64           times %{$strucname}_size-($-%$strucstart) db 0
65 %pop
66 %endmacro
68 %imacro align 1-2+.nolist nop
69           times ($$-$) & ((%1)-1) %2
70 %endmacro
71 %imacro alignb 1-2+.nolist resb 1
72           times ($$-$) & ((%1)-1) %2
73 %endmacro
75 %imacro extern 1-*.nolist
76 %rep %0
77 [extern %1]
78 %rotate 1
79 %endrep
80 %endmacro
82 %imacro bits 1+.nolist
83 [bits %1]
84 %endmacro
86 %imacro use16 0.nolist
87 [bits 16]
88 %endmacro
89 %imacro use32 0.nolist
90 [bits 32]
91 %endmacro
92 %imacro use64 0.nolist
93 [bits 64]
94 %endmacro
96 %imacro global 1-*.nolist
97 %rep %0
98 [global %1]
99 %rotate 1
100 %endrep
101 %endmacro
103 %imacro common 1-*.nolist
104 %rep %0
105 [common %1]
106 %rotate 1
107 %endrep
108 %endmacro
110 %imacro cpu 1+.nolist
111 [cpu %1]
112 %endmacro