comparison doc/manual/x407.html @ 153:ffef3ea07399 2.1 2.1

Preparing for release
author lost
date Fri, 30 Jan 2009 04:32:55 +0000
parents
children
comparison
equal deleted inserted replaced
152:6bd4755d224f 153:ffef3ea07399
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Assembler Modes and Pragmas</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="LW Tool Chain"
11 HREF="index.html"><LINK
12 REL="UP"
13 TITLE="LWASM"
14 HREF="c35.html"><LINK
15 REL="PREVIOUS"
16 TITLE="Object Files and Sections"
17 HREF="x361.html"><LINK
18 REL="NEXT"
19 TITLE="LWLINK"
20 HREF="c436.html"></HEAD
21 ><BODY
22 CLASS="SECTION"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >LW Tool Chain</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="x361.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 >Chapter 3. LWASM</TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="c436.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="SECTION"
73 ><H1
74 CLASS="SECTION"
75 ><A
76 NAME="AEN407"
77 >3.9. Assembler Modes and Pragmas</A
78 ></H1
79 ><P
80 >There are a number of options that affect the way assembly is performed.
81 Some of these options can only be specified on the command line because
82 they determine something absolute about the assembly process. These include
83 such things as the output target. Other things may be switchable during
84 the assembly process. These are known as pragmas and are, by definition,
85 not portable between assemblers.</P
86 ><P
87 >LWASM supports a number of pragmas that affect code generation or
88 otherwise affect the behaviour of the assembler. These may be specified by
89 way of a command line option or by assembler directives. The directives
90 are as follows.</P
91 ><P
92 ></P
93 ><DIV
94 CLASS="VARIABLELIST"
95 ><DL
96 ><DT
97 >PRAGMA <CODE
98 CLASS="PARAMETER"
99 >pragma[,...]</CODE
100 ></DT
101 ><DD
102 ><P
103 >Specifies that the assembler should bring into force all <CODE
104 CLASS="PARAMETER"
105 >pragma</CODE
106 >s
107 specified. Any unrecognized pragma will cause an assembly error. The new
108 pragmas will take effect immediately. This directive should be used when
109 the program will assemble incorrectly if the pragma is ignored or not supported.</P
110 ></DD
111 ><DT
112 >*PRAGMA <CODE
113 CLASS="PARAMETER"
114 >pragma[,...]</CODE
115 ></DT
116 ><DD
117 ><P
118 >This is identical to the PRAGMA directive except no error will occur with
119 unrecognized or unsupported pragmas. This directive, by virtue of starting
120 with a comment character, will also be ignored by assemblers that do not
121 support this directive. Use this variation if the pragma is not required
122 for correct functioning of the code.</P
123 ></DD
124 ></DL
125 ></DIV
126 ><P
127 >Each pragma supported has a positive version and a negative version.
128 The positive version enables the pragma while the negative version disables
129 it. The negatitve version is simply the positive version with "no" prefixed
130 to it. For instance, "pragma" vs. "nopragma". Only the positive version is
131 listed below.</P
132 ><P
133 >Pragmas are not case sensitive.</P
134 ><P
135 ></P
136 ><DIV
137 CLASS="VARIABLELIST"
138 ><DL
139 ><DT
140 >index0tonone</DT
141 ><DD
142 ><P
143 >When in force, this pragma enables an optimization affecting indexed addressing
144 modes. When the offset expression in an indexed mode evaluates to zero but is
145 not explicity written as 0, this will replace the operand with the equivalent
146 no offset mode, thus creating slightly faster code. Because of the advantages
147 of this optimization, it is enabled by default.</P
148 ></DD
149 ><DT
150 >undefextern</DT
151 ><DD
152 ><P
153 >This pragma is only valid for targets that support external references. When in
154 force, if the assembler sees an undefined symbol on the second pass, it will
155 automatically define it as an external symbol. This automatic definition will
156 apply for the remainder of the assembly process, even if the pragma is
157 subsequently turned off. Because this behaviour would be potentially surprising,
158 this pragma defaults to off.</P
159 ><P
160 >The primary use for this pragma is for projects that share a large number of
161 symbols between source files. In such cases, it is impractical to enumerate
162 all the external references in every source file. This allows the assembler
163 and linker to do the heavy lifting while not preventing a particular source
164 module from defining a local symbol of the same name as an external symbol
165 if it does not need the external symbol. (This pragma will not cause an
166 automatic external definition if there is already a locally defined symbol.)</P
167 ><P
168 >This pragma will often be specified on the command line for large projects.
169 However, depending on the specific dynamics of the project, it may be sufficient
170 for one or two files to use this pragma internally.</P
171 ></DD
172 ></DL
173 ></DIV
174 ></DIV
175 ><DIV
176 CLASS="NAVFOOTER"
177 ><HR
178 ALIGN="LEFT"
179 WIDTH="100%"><TABLE
180 SUMMARY="Footer navigation table"
181 WIDTH="100%"
182 BORDER="0"
183 CELLPADDING="0"
184 CELLSPACING="0"
185 ><TR
186 ><TD
187 WIDTH="33%"
188 ALIGN="left"
189 VALIGN="top"
190 ><A
191 HREF="x361.html"
192 ACCESSKEY="P"
193 >Prev</A
194 ></TD
195 ><TD
196 WIDTH="34%"
197 ALIGN="center"
198 VALIGN="top"
199 ><A
200 HREF="index.html"
201 ACCESSKEY="H"
202 >Home</A
203 ></TD
204 ><TD
205 WIDTH="33%"
206 ALIGN="right"
207 VALIGN="top"
208 ><A
209 HREF="c436.html"
210 ACCESSKEY="N"
211 >Next</A
212 ></TD
213 ></TR
214 ><TR
215 ><TD
216 WIDTH="33%"
217 ALIGN="left"
218 VALIGN="top"
219 >Object Files and Sections</TD
220 ><TD
221 WIDTH="34%"
222 ALIGN="center"
223 VALIGN="top"
224 ><A
225 HREF="c35.html"
226 ACCESSKEY="U"
227 >Up</A
228 ></TD
229 ><TD
230 WIDTH="33%"
231 ALIGN="right"
232 VALIGN="top"
233 >LWLINK</TD
234 ></TR
235 ></TABLE
236 ></DIV
237 ></BODY
238 ></HTML
239 >