fix memleak with ifdef and ifndef
[xorcyst.git] / doc / Assembler-Directives.html
blob74ec7b40bb703edcb474170b5862500b46e3b939
1 <html lang="en">
2 <head>
3 <title>Assembler Directives - The XORcyst Manual</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="The XORcyst Manual">
6 <meta name="generator" content="makeinfo 4.7">
7 <link title="Top" rel="start" href="index.html#Top">
8 <link rel="prev" href="Known-Bugs-and-Limitations.html#Known-Bugs-and-Limitations" title="Known Bugs and Limitations">
9 <link rel="next" href="Linker-Script-Commands.html#Linker-Script-Commands" title="Linker Script Commands">
10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
11 <!--
12 This is the manual for The XORcyst version 1.4.5.
14 Copyright (C) 2004, 2005 Kent Hansen.-->
15 <meta http-equiv="Content-Style-Type" content="text/css">
16 <style type="text/css"><!--
17 pre.display { font-family:inherit }
18 pre.format { font-family:inherit }
19 pre.smalldisplay { font-family:inherit; font-size:smaller }
20 pre.smallformat { font-family:inherit; font-size:smaller }
21 pre.smallexample { font-size:smaller }
22 pre.smalllisp { font-size:smaller }
23 span.sc { font-variant:small-caps }
24 span.roman { font-family: serif; font-weight: normal; }
25 --></style>
26 </head>
27 <body>
28 <div class="node">
29 <p>
30 <a name="Assembler-Directives"></a>Next:&nbsp;<a rel="next" accesskey="n" href="Linker-Script-Commands.html#Linker-Script-Commands">Linker Script Commands</a>,
31 Previous:&nbsp;<a rel="previous" accesskey="p" href="Known-Bugs-and-Limitations.html#Known-Bugs-and-Limitations">Known Bugs and Limitations</a>,
32 Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
33 <hr><br>
34 </div>
36 <h2 class="appendix">Appendix B Assembler Directives</h2>
38 <p>It is considered good practice to prepend a period to a directive when invoking it (to differentiate it from identifiers), but this is not a strict requirement.
40 <p>The following is an alphabetical listing of the directives supported by the assembler and the arguments they may take. Arguments enclosed in square brackets [ ] are optional.
42 <dl>
43 <dt><code>align </code><var>identifier</var> <em>[, </em><var>identifier-2</var><em>, ...]</em> <var>boundary</var><dd>Specifies alignment constraints for a list of data variables.
45 <br><dt><code>asc (</code><em>Alias for</em><code> char)</code>
46 <br><dt><code>byte (</code><em>Alias for</em><code> db)</code>
47 <br><dt><code>char </code><var>expression</var> <em>[, </em><var>expression</var><em>, ...]</em><dd>Define (array of) character transformed by custom character map
49 <br><dt><code>charmap "</code><var>filename</var><code>"</code><dd>Set custom character map
51 <br><dt><code>codeseg, code</code><dd>Switch to code segment
53 <br><dt><code>dataseg, data </code><em>[zeropage]</em><dd>Switch to data segment
55 <br><dt><code>db </code><var>expression</var> <em>[, </em><var>expression</var><em>, ...]</em><dd>Define (array of) byte
57 <br><dt><code>dd </code><var>expression</var> <em>[, </em><var>expression</var><em>, ...]</em><dd>Define (array of) doubleword
59 <br><dt><code>define </code><var>identifier</var> <em>[</em><var>expression</var><em>]</em><dd>See <code>equ</code> directive
61 <br><dt><code>dsb </code><var>expression</var><dd>Define storage of bytes
63 <br><dt><code>dsd </code><var>expression</var><dd>Define storage of doublewords
65 <br><dt><code>dsw </code><var>expression</var><dd>Define storage of words
67 <br><dt><code>dw </code><var>expression</var> <em>[, </em><var>expression</var><em>, ...]</em><dd>Define (array of) word
69 <br><dt><code>dword (</code><em>Alias for</em><code> dd)</code>
70 <br><dt><code>elif</code><dd>Used in conjunction with if
72 <br><dt><code>else</code><dd>Used in conjunction with if, ifdef or ifndef
74 <br><dt><code>endif</code><dd>Ends a statement block preceded by an if
76 <br><dt><code>end</code><dd>Ends the assembly unit
78 <br><dt><code>ende</code><dd>Ends an enum definition
80 <br><dt><code>endm</code><dd>Ends a macro definition
82 <br><dt><code>endp</code><dd>Ends a procedure definition
84 <br><dt><code>ends</code><dd>Ends a structure or union definition
86 <br><dt><code>enum </code><var>identifier</var><dd>Begins an enum definition
88 <br><dt><code>extrn </code><var>identifier</var> <em>[, </em><var>identifier</var><em>, ...]</em><code> : </code><var>type</var><dd>Flag identifier(s) as external (imported) of type <var>type</var>
90 <br><dt><var>identifier</var><code> equ </code><var>expression</var><dd>Define equate
92 <br><dt><code>if </code><var>expression</var><dd>Assemble the following statement block only if <var>expression</var> evaluates to non-zero
94 <br><dt><code>ifdef </code><var>identifier</var><dd>Assemble the following statement block only if <var>identifier</var> is defined
96 <br><dt><code>ifndef </code><var>identifier</var><dd>Assemble the following statement block only if <var>identifier</var> is not defined
98 <br><dt><code>incbin "</code><var>filename</var><code>"</code><dd>Include contents of <var>filename</var> as binary data
100 <br><dt><code>include (</code><em>Alias for</em><code> incsrc)</code>
101 <br><dt><code>incsrc "</code><var>filename</var><code>"</code><dd>Include contents of <var>filename</var> as assembler statements
103 <br><dt><code>label </code><var>identifier</var> <em>[= </em><var>address</var><em>]</em> <em>[ : </em><var>type</var><em>]</em><dd>Defines a global label
105 <br><dt><code>macro </code><var>identifier</var> <em>[</em><var>identifier</var><em>, ...]</em><dd>Begins a macro definition
107 <br><dt><code>message </code><var>expression</var><dd>Prints a message to stdout during assembly
109 <br><dt><code>pad </code><var>expression</var><code> (</code><em>Alias for</em><code> dsb)</code>
110 <br><dt><code>proc </code><var>identifier</var><dd>Begins a procedure definition
112 <br><dt><code>public </code><var>identifier</var> <em>[, </em><var>identifier</var><em>, ...]</em><dd>Flag identifier(s) as public (exported)
114 <br><dt><code>record </code><var>identifier</var> <var>identifier</var><code>:</code><var>width</var> <em>[, </em><var>identifier</var><em>:</em><var>width</var><em>, ...]</em><dd>Defines a record consisting of bitfields.
116 <br><dt><code>rept </code><var>count</var><dd>Begins an anonymous macro to be repeated <var>count</var> times
118 <br><dt><code>struc </code><var>identifier</var><dd>Begins a structure definition
120 <br><dt><code>type </code><var>identifier</var> <em>[</em><var>expression</var><em>, ...]</em><dd>Define data of user-defined type <var>identifier</var>
122 <br><dt><code>union </code><var>identifier</var><dd>Begins a union definition
124 <br><dt><code>while </code><var>expression</var><dd>Begins an anonymous macro to be repeated while <var>expression</var> is true (non-zero)
126 <br><dt><code>word (</code><em>Alias for</em><code> dw)</code><dd>
127 </dl>
129 </body></html>