Mercurial > hg-old > index.cgi
annotate doc/manual.docbook.sgml @ 233:efda73d44e1b
Updated discussion of assembly dialects
author | lost |
---|---|
date | Fri, 12 Jun 2009 04:54:12 +0000 |
parents | 1009f302ac11 |
children | aa0056ca7319 |
rev | line source |
---|---|
109 | 1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.5//EN"> |
2 <book> | |
3 <bookinfo> | |
4 <title>LW Tool Chain</title> | |
5 <author><firstname>William</firstname><surname>Astle</surname></author> | |
6 <copyright><year>2009</year><holder>William Astle</holder></copyright> | |
7 </bookinfo> | |
8 <chapter> | |
9 | |
10 <title>Introduction</title> | |
11 | |
12 <para> | |
13 The LW tool chain provides utilities for building binaries for MC6809 and | |
14 HD6309 CPUs. The tool chain includes a cross-assembler and a cross-linker | |
15 which support several styles of output. | |
16 </para> | |
17 | |
18 <section> | |
19 <title>History</title> | |
20 <para> | |
21 For a long time, I have had an interest in creating an operating system for | |
22 the Coco3. I finally started working on that project around the beginning of | |
23 2006. I had a number of assemblers I could choose from. Eventually, I settled | |
24 on one and started tinkering. After a while, I realized that assembler was not | |
25 going to be sufficient due to lack of macros and issues with forward references. | |
26 Then I tried another which handled forward references correctly but still did | |
27 not support macros. I looked around at other assemblers and they all lacked | |
28 one feature or another that I really wanted for creating my operating system. | |
29 </para> | |
30 | |
31 <para> | |
32 The solution seemed clear at that point. I am a fair programmer so I figured | |
33 I could write an assembler that would do everything I wanted an assembler to | |
34 do. Thus the LWASM probject was born. After more than two years of on and off | |
35 work, version 1.0 of LWASM was released in October of 2008. | |
36 </para> | |
37 | |
38 <para> | |
39 As the aforementioned operating system project progressed further, it became | |
40 clear that while assembling the whole project through a single file was doable, | |
41 it was not practical. When I found myself playing some fancy games with macros | |
42 in a bid to simulate sections, I realized I needed a means of assembling | |
43 source files separately and linking them later. This spawned a major development | |
44 effort to add an object file support to LWASM. It also spawned the LWLINK | |
45 project to provide a means to actually link the files. | |
46 </para> | |
47 | |
48 </section> | |
49 | |
50 </chapter> | |
51 | |
52 <chapter> | |
53 <title>Output Formats</title> | |
54 | |
55 <para> | |
56 The LW tool chain supports multiple output formats. Each format has its | |
57 advantages and disadvantages. Each format is described below. | |
58 </para> | |
59 | |
60 <section> | |
61 <title>Raw Binaries</title> | |
62 <para> | |
63 A raw binary is simply a string of bytes. There are no headers or other | |
64 niceties. Both LWLINK and LWASM support generating raw binaries. ORG directives | |
65 in the source code only serve to set the addresses that will be used for | |
66 symbols but otherwise have no direct impact on the resulting binary. | |
67 </para> | |
68 | |
69 </section> | |
70 <section> | |
71 <title>DECB Binaries</title> | |
72 | |
73 <para>A DECB binary is compatible with the LOADM command in Disk Extended | |
74 Color Basic on the CoCo. They are also compatible with CLOADM from Extended | |
75 Color Basic. These binaries include the load address of the binary as well | |
76 as encoding an execution address. These binaries may contain multiple loadable | |
77 sections, each of which has its own load address.</para> | |
78 | |
79 <para> | |
80 Each binary starts with a preamble. Each preamble is five bytes long. The | |
81 first byte is zero. The next two bytes specify the number of bytes to load | |
82 and the last two bytes specify the address to load the bytes at. Then, a | |
83 string of bytes follows. After this string of bytes, there may be another | |
84 preamble or a postamble. A postamble is also five bytes in length. The first | |
85 byte of the postamble is $FF, the next two are zero, and the last two are | |
86 the execution address for the binary. | |
87 </para> | |
88 | |
89 <para> | |
90 Both LWASM and LWLINK can output this format. | |
91 </para> | |
92 </section> | |
93 | |
94 <section> | |
95 <title>Object Files</title> | |
96 <para>LWASM supports generating a proprietary object file format which is | |
97 described in <xref linkend="objchap">. LWLINK is then used to link these | |
98 object files into a final binary in any of LWLINK's supported binary | |
99 formats.</para> | |
100 | |
101 <para>Object files also support the concept of sections which are not valid | |
102 for other output types. This allows related code from each object file | |
103 linked to be collapsed together in the final binary.</para> | |
104 | |
227 | 105 <para> |
106 Object files are very flexible in that they allow references that are not | |
107 known at assembly time to be resolved at link time. However, because the | |
108 addresses of such references are not known at assembly time, there is no way | |
109 for the assembler to deduce that an eight bit addressing mode is possible. | |
110 That means the assember will default to using sixteen bit addressing | |
111 whenever an external or cross-section reference is used. | |
112 </para> | |
113 | |
114 <para> | |
115 As of LWASM 2.4, it is possible to force direct page addressing for an | |
116 external reference. Care must be taken to ensure the resulting addresses | |
117 are really in the direct page since the linker does not know what the direct | |
118 page is supposed to be and does not emit errors for byte overflows. | |
119 </para> | |
120 | |
121 <para> | |
122 It is also possible to use external references in an eight bit immediate | |
123 mode instruction. In this case, only the low order eight bits will be used. | |
124 Again, no byte overflows will be flagged. | |
125 </para> | |
126 | |
127 | |
109 | 128 </section> |
129 | |
130 </chapter> | |
131 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
132 <chapter> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
133 <title>LWASM</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
134 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
135 The LWTOOLS assembler is called LWASM. This chapter documents the various |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
136 features of the assembler. It is not, however, a tutorial on 6x09 assembly |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
137 language programming. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
138 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
139 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
140 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
141 <title>Command Line Options</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
142 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
143 The binary for LWASM is called "lwasm". Note that the binary is in lower |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
144 case. lwasm takes the following command line arguments. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
145 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
146 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
147 <variablelist> |
231 | 148 |
149 <varlistentry> | |
150 <term><option>--6309</option></term> | |
151 <term><option>-3</option></term> | |
152 <listitem> | |
153 <para> | |
154 This will cause the assembler to accept the additional instructions available | |
155 on the 6309 processor. This is the default mode; this option is provided for | |
156 completeness and to override preset command arguments. | |
157 </para> | |
158 </listitem> | |
159 </varlistentry> | |
160 | |
161 <varlistentry> | |
162 <term><option>--6809</option></term> | |
163 <term><option>-9</option></term> | |
164 <listitem> | |
165 <para> | |
166 This will cause the assembler to reject instructions that are only available | |
167 on the 6309 processor. | |
168 </para> | |
169 </listitem> | |
170 </varlistentry> | |
171 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
172 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
173 <term><option>--decb</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
174 <term><option>-b</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
175 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
176 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
177 Select the DECB output format target. Equivalent to <option>--format=decb</option>. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
178 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
179 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
180 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
181 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
182 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
183 <term><option>--format=type</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
184 <term><option>-f type</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
185 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
186 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
187 Select the output format. Valid values are <option>obj</option> for the object |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
188 file target, <option>decb</option> for the DECB LOADM format, and <option>raw</option> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
189 for a raw binary. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
190 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
191 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
192 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
193 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
194 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
195 <term><option>--list[=file]</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
196 <term><option>-l[file]</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
197 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
198 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
199 Cause LWASM to generate a listing. If <option>file</option> is specified, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
200 the listing will go to that file. Otherwise it will go to the standard output |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
201 stream. By default, no listing is generated. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
202 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
203 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
204 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
205 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
206 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
207 <term><option>--obj</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
208 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
209 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
210 Select the proprietary object file format as the output target. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
211 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
212 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
213 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
214 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
215 <varlistentry> |
150 | 216 <term><option>--output=FILE</option></term> |
217 <term><option>-o FILE</option></term> | |
218 <listitem> | |
219 <para> | |
220 This option specifies the name of the output file. If not specified, the | |
221 default is <option>a.out</option>. | |
222 </para> | |
223 </listitem> | |
224 </varlistentry> | |
225 | |
226 <varlistentry> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
227 <term><option>--pragma=pragma</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
228 <term><option>-p pragma</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
229 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
230 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
231 Specify assembler pragmas. Multiple pragmas are separated by commas. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
232 pragmas accepted are the same as for the PRAGMA assembler directive described |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
233 below. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
234 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
235 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
236 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
237 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
238 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
239 <term><option>--raw</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
240 <term><option>-r</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
241 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
242 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
243 Select raw binary as the output target. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
244 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
245 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
246 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
247 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
248 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
249 <term><option>--help</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
250 <term><option>-?</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
251 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
252 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
253 Present a help screen describing the command line options. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
254 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
255 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
256 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
257 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
258 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
259 <term><option>--usage</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
260 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
261 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
262 Provide a summary of the command line options. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
263 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
264 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
265 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
266 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
267 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
268 <term><option>--version</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
269 <term><option>-V</option></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
270 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
271 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
272 Display the software version. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
273 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
274 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
275 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
276 |
146
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
277 <varlistentry> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
278 <term><option>--debug</option></term> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
279 <term><option>-d</option></term> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
280 <listitem> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
281 <para> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
282 Increase the debugging level. Only really useful to people hacking on the |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
283 LWASM source code itself. |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
284 </para> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
285 </listitem> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
286 </varlistentry> |
6c0a30278982
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
145
diff
changeset
|
287 |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
288 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
289 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
290 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
291 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
292 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
293 <title>Dialects</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
294 <para> |
233 | 295 LWASM supports all documented MC6809 instructions as defined by Motorola. |
296 It also supports all known HD6309 instructions. While there is general | |
297 agreement on the pneumonics for most of the 6309 instructions, there is some | |
298 variance with the block transfer instructions. TFM for all four variations | |
299 seems to have gained the most traction and, thus, this is the form that is | |
300 recommended for LWASM. However, it also supports COPY, COPY-, IMP, EXP, | |
301 TFRP, TFRM, TFRS, and TFRR. It further adds COPY+ as a synomym for COPY, | |
302 IMPLODE for IMP, and EXPAND for EXP. | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
303 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
304 |
233 | 305 <para>By default, LWASM accepts 6309 instructions. However, using the |
306 <parameter>--6809</parameter> parameter, you can cause it to throw errors on | |
307 6309 instructions instead.</para> | |
308 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
309 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
310 The standard addressing mode specifiers are supported. These are the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
311 hash sign ("#") for immediate mode, the less than sign ("<") for forced |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
312 eight bit modes, and the greater than sign (">") for forced sixteen bit modes. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
313 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
314 |
167 | 315 <para> |
316 Additionally, LWASM supports using the asterisk ("*") to indicate | |
317 base page addressing. This should not be used in hand-written source code, | |
318 however, because it is non-standard and may or may not be present in future | |
319 versions of LWASM. | |
320 </para> | |
321 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
322 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
323 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
324 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
325 <title>Source Format</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
326 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
327 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
328 LWASM accepts plain text files in a relatively free form. It can handle |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
329 lines terminated with CR, LF, CRLF, or LFCR which means it should be able |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
330 to assemble files on any platform on which it compiles. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
331 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
332 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
333 Each line may start with a symbol. If a symbol is present, there must not |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
334 be any whitespace preceding it. It is legal for a line to contain nothing |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
335 but a symbol.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
336 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
337 The op code is separated from the symbol by whitespace. If there is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
338 no symbol, there must be at least one white space character preceding it. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
339 If applicable, the operand follows separated by whitespace. Following the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
340 opcode and operand is an optional comment. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
341 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
342 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
343 A comment can also be introduced with a * or a ;. The comment character is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
344 optional for end of statement comments. However, if a symbol is the only |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
345 thing present on the line other than the comment, the comment character is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
346 mandatory to prevent the assembler from interpreting the comment as an opcode. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
347 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
348 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
349 <para> |
175 | 350 For compatibility with the output generated by some C preprocessors, LWASM |
351 will also ignore lines that begin with a #. This should not be used as a general | |
352 comment character, however. | |
353 </para> | |
354 | |
355 <para> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
356 The opcode is not treated case sensitively. Neither are register names in |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
357 the operand fields. Symbols, however, are case sensitive. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
358 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
359 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
360 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
361 LWASM does not support line numbers in the file. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
362 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
363 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
364 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
365 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
366 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
367 <title>Symbols</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
368 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
369 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
370 Symbols have no length restriction. They may contain letters, numbers, dots, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
371 dollar signs, and underscores. They must start with a letter, dot, or |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
372 underscore. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
373 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
374 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
375 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
376 LWASM also supports the concept of a local symbol. A local symbol is one |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
377 which contains either a "?" or a "@", which can appear anywhere in the symbol. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
378 The scope of a local symbol is determined by a number of factors. First, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
379 each included file gets its own local symbol scope. A blank line will also |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
380 be considered a local scope barrier. Macros each have their own local symbol |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
381 scope as well (which has a side effect that you cannot use a local symbol |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
382 as an argument to a macro). There are other factors as well. In general, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
383 a local symbol is restricted to the block of code it is defined within. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
384 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
385 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
386 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
387 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
388 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
389 <title>Numbers and Expressions</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
390 <para> |
175 | 391 |
392 Numbers can be expressed in binary, octal, decimal, or hexadecimal. Binary | |
393 numbers may be prefixed with a "%" symbol or suffixed with a "b" or "B". | |
394 Octal numbers may be prefixed with "@" or suffixed with "Q", "q", "O", or | |
395 "o". Hexadecimal numbers may be prefixed with "$", "0x" or "0X", or suffixed | |
396 with "H". No prefix or suffix is required for decimal numbers but they can | |
397 be prefixed with "&" if desired. Any constant which begins with a letter | |
398 must be expressed with the correct prefix base identifier or be prefixed | |
399 with a 0. Thus hexadecimal FF would have to be written either 0FFH or $FF. | |
400 Numbers are not case sensitive. | |
401 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
402 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
403 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
404 <para> A symbol may appear at any point where a number is acceptable. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
405 special symbol "*" can be used to represent the starting address of the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
406 current source line within expressions. </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
407 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
408 <para>The ASCII value of a character can be included by prefixing it with a |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
409 single quote ('). The ASCII values of two characters can be included by |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
410 prefixing the characters with a quote (").</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
411 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
412 <para> |
227 | 413 |
414 LWASM supports the following basic binary operators: +, -, *, /, and %. | |
415 These represent addition, subtraction, multiplication, division, and | |
416 modulus. It also supports unary negation and unary 1's complement (- and ^ | |
417 respectively). It is also possible to use ~ for the unary 1's complement | |
418 operator. For completeness, a unary positive (+) is supported though it is | |
419 a no-op. LWASM also supports using |, &, and ^ for bitwise or, bitwise and, | |
420 and bitwise exclusive or respectively. | |
421 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
422 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
423 |
227 | 424 <para> |
425 | |
426 Operator precedence follows the usual rules. Multiplication, division, and | |
427 modulus take precedence over addition and subtraction. Unary operators take | |
428 precedence over binary operators. Bitwise operators are lower precdence | |
429 than addition and subtraction. To force a specific order of evaluation, | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
430 parentheses can be used in the usual manner. |
227 | 431 |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
432 </para> |
227 | 433 |
434 <para> | |
435 | |
436 As of LWASM 2.5, the operators && and || are recognized for boolean and and | |
437 boolean or respectively. They will return either 0 or 1 (false or true). | |
438 They have the lowest precedence of all the binary operators. | |
439 | |
440 </para> | |
441 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
442 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
443 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
444 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
445 <title>Assembler Directives</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
446 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
447 Various directives can be used to control the behaviour of the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
448 assembler or to include non-code/data in the resulting output. Those directives |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
449 that are not described in detail in other sections of this document are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
450 described below. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
451 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
452 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
453 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
454 <title>Data Directives</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
455 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
456 <varlistentry><term>FCB <parameter>expr[,...]</parameter></term> |
167 | 457 <term>.DB <parameter>expr[,...]</parameter></term> |
458 <term>.BYTE <parameter>expr[,...]</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
459 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
460 <para>Include one or more constant bytes (separated by commas) in the output.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
461 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
462 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
463 |
167 | 464 <varlistentry> |
465 <term>FDB <parameter>expr[,...]</parameter></term> | |
466 <term>.DW <parameter>expr[,...]</parameter></term> | |
467 <term>.WORD <parameter>expr[,...]</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
468 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
469 <para>Include one or more words (separated by commas) in the output.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
470 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
471 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
472 |
167 | 473 <varlistentry> |
474 <term>FQB <parameter>expr[,...]</parameter></term> | |
475 <term>.QUAD <parameter>expr[,...]</parameter></term> | |
476 <term>.4BYTE <parameter>expr[,...]</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
477 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
478 <para>Include one or more double words (separated by commas) in the output.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
479 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
480 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
481 |
167 | 482 <varlistentry> |
483 <term>FCC <parameter>string</parameter></term> | |
484 <term>.ASCII <parameter>string</parameter></term> | |
485 <term>.STR <parameter>string</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
486 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
487 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
488 Include a string of text in the output. The first character of the operand |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
489 is the delimiter which must appear as the last character and cannot appear |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
490 within the string. The string is included with no modifications> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
491 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
492 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
493 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
494 |
167 | 495 <varlistentry> |
496 <term>FCN <parameter>string</parameter></term> | |
497 <term>.ASCIZ <parameter>string</parameter></term> | |
498 <term>.STRZ <parameter>string</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
499 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
500 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
501 Include a NUL terminated string of text in the output. The first character of |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
502 the operand is the delimiter which must appear as the last character and |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
503 cannot appear within the string. A NUL byte is automatically appended to |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
504 the string. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
505 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
506 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
507 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
508 |
167 | 509 <varlistentry> |
510 <term>FCS <parameter>string</parameter></term> | |
511 <term>.ASCIS <parameter>string</parameter></term> | |
512 <term>.STRS <parameter>string</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
513 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
514 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
515 Include a string of text in the output with bit 7 of the final byte set. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
516 first character of the operand is the delimiter which must appear as the last |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
517 character and cannot appear within the string. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
518 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
519 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
520 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
521 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
522 <varlistentry><term>ZMB <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
523 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
524 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
525 Include a number of NUL bytes in the output. The number must be fully resolvable |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
526 during pass 1 of assembly so no forward or external references are permitted. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
527 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
528 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
529 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
530 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
531 <varlistentry><term>ZMD <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
532 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
533 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
534 Include a number of zero words in the output. The number must be fully |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
535 resolvable during pass 1 of assembly so no forward or external references are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
536 permitted. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
537 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
538 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
539 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
540 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
541 <varlistentry><term>ZMQ <parameter>expr<parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
542 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
543 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
544 Include a number of zero double-words in the output. The number must be fully |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
545 resolvable during pass 1 of assembly so no forward or external references are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
546 permitted. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
547 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
548 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
549 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
550 |
167 | 551 <varlistentry> |
552 <term>RMB <parameter>expr</parameter></term> | |
553 <term>.BLKB <parameter>expr</parameter></term> | |
554 <term>.DS <parameter>expr</parameter></term> | |
555 <term>.RS <parameter>expr</parameter></term> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
556 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
557 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
558 Reserve a number of bytes in the output. The number must be fully resolvable |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
559 during pass 1 of assembly so no forward or external references are permitted. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
560 The value of the bytes is undefined. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
561 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
562 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
563 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
564 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
565 <varlistentry><term>RMD <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
566 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
567 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
568 Reserve a number of words in the output. The number must be fully |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
569 resolvable during pass 1 of assembly so no forward or external references are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
570 permitted. The value of the words is undefined. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
571 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
572 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
573 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
574 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
575 <varlistentry><term>RMQ <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
576 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
577 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
578 Reserve a number of double-words in the output. The number must be fully |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
579 resolvable during pass 1 of assembly so no forward or external references are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
580 permitted. The value of the double-words is undefined. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
581 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
582 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
583 </varlistentry> |
227 | 584 |
585 <varlistentry> | |
586 <term>INCLUDEBIN <parameter>filename</parameter></term> | |
587 <listitem> | |
588 <para> | |
589 Treat the contents of <parameter>filename</parameter> as a string of bytes to | |
590 be included literally at the current assembly point. This has the same effect | |
591 as converting the file contents to a series of FCB statements and including | |
592 those at the current assembly point. | |
593 </para> | |
594 </listitem> | |
595 </varlistentry> | |
596 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
597 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
598 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
599 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
600 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
601 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
602 <title>Address Definition</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
603 <para>The directives in this section all control the addresses of symbols |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
604 or the assembly process itself.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
605 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
606 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
607 <varlistentry><term>ORG <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
608 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
609 <para>Set the assembly address. The address must be fully resolvable on the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
610 first pass so no external or forward references are permitted. ORG is not |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
611 permitted within sections when outputting to object files. For the DECB |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
612 target, each ORG directive after which output is generated will cause |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
613 a new preamble to be output. ORG is only used to determine the addresses |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
614 of symbols when the raw target is used. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
615 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
616 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
617 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
618 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
619 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
620 <term><parameter>sym</parameter> EQU <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
621 <term><parameter>sym</parameter> = <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
622 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
623 <para>Define the value of <parameter>sym</parameter> to be <parameter>expr</parameter>. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
624 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
625 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
626 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
627 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
628 <term><parameter>sym</parameter> SET <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
629 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
630 <para>Define the value of <parameter>sym</parameter> to be <parameter>expr</parameter>. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
631 Unlike EQU, SET permits symbols to be defined multiple times as long as SET |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
632 is used for all instances. Use of the symbol before the first SET statement |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
633 that sets its value is undefined.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
634 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
635 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
636 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
637 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
638 <term>SETDP <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
639 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
640 <para>Inform the assembler that it can assume the DP register contains |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
641 <parameter>expr</parameter>. This directive is only advice to the assembler |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
642 to determine whether an address is in the direct page and has no effect |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
643 on the contents of the DP register. The value must be fully resolved during |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
644 the first assembly pass because it affects the sizes of subsequent instructions. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
645 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
646 <para>This directive has no effect in the object file target. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
647 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
648 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
649 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
650 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
651 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
652 <term>ALIGN <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
653 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
654 <para>Force the current assembly address to be a multiple of <parameter>expr</parameter>. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
655 A series of NUL bytes is output to force the alignment, if required. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
656 alignment value must be fully resolved on the first pass because it affects |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
657 the addresses of subsquent instructions.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
658 <para>This directive is not suitable for inclusion in the middle of actual |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
659 code. It is intended to appear where the bytes output will not be executed. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
660 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
661 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
662 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
663 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
664 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
665 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
666 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
667 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
668 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
669 <title>Conditional Assembly</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
670 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
671 Portions of the source code can be excluded or included based on conditions |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
672 known at assembly time. Conditionals can be nested arbitrarily deeply. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
673 directives associated with conditional assembly are described in this section. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
674 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
675 <para>All conditionals must be fully bracketed. That is, every conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
676 statement must eventually be followed by an ENDC at the same level of nesting. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
677 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
678 <para>Conditional expressions are only evaluated on the first assembly pass. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
679 It is not possible to game the assembly process by having a conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
680 change its value between assembly passes. Thus there is not and never will |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
681 be any equivalent of IFP1 or IFP2 as provided by other assemblers.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
682 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
683 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
684 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
685 <term>IFEQ <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
686 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
687 <para>If <parameter>expr</parameter> evaluates to zero, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
688 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
689 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
690 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
691 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
692 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
693 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
694 <term>IFNE <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
695 <term>IF <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
696 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
697 <para>If <parameter>expr</parameter> evaluates to a non-zero value, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
698 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
699 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
700 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
701 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
702 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
703 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
704 <term>IFGT <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
705 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
706 <para>If <parameter>expr</parameter> evaluates to a value greater than zero, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
707 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
708 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
709 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
710 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
711 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
712 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
713 <term>IFGE <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
714 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
715 <para>If <parameter>expr</parameter> evaluates to a value greater than or equal to zero, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
716 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
717 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
718 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
719 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
720 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
721 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
722 <term>IFLT <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
723 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
724 <para>If <parameter>expr</parameter> evaluates to a value less than zero, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
725 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
726 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
727 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
728 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
729 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
730 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
731 <term>IFLE <parameter>expr</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
732 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
733 <para>If <parameter>expr</parameter> evaluates to a value less than or equal to zero , the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
734 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
735 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
736 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
737 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
738 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
739 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
740 <term>IFDEF <parameter>sym</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
741 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
742 <para>If <parameter>sym</parameter> is defined at this point in the assembly |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
743 process, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
744 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
745 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
746 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
747 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
748 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
749 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
750 <term>IFNDEF <parameter>sym</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
751 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
752 <para>If <parameter>sym</parameter> is not defined at this point in the assembly |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
753 process, the conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
754 will be considered true. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
755 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
756 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
757 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
758 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
759 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
760 <term>ELSE</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
761 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
762 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
763 If the preceding conditional at the same level of nesting was false, the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
764 statements following will be assembled. If the preceding conditional at |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
765 the same level was true, the statements following will not be assembled. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
766 Note that the preceding conditional might have been another ELSE statement |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
767 although this behaviour is not guaranteed to be supported in future versions |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
768 of LWASM. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
769 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
770 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
771 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
772 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
773 <term>ENDC</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
774 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
775 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
776 This directive marks the end of a conditional construct. Every conditional |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
777 construct must end with an ENDC directive. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
778 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
779 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
780 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
781 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
782 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
783 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
784 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
785 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
786 <title>Miscelaneous Directives</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
787 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
788 <para>This section includes directives that do not fit into the other |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
789 categories.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
790 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
791 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
792 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
793 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
794 <term>INCLUDE <parameter>filename</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
795 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
796 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
797 Include the contents of <parameter>filename</parameter> at this point in |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
798 the assembly as though it were a part of the file currently being processed. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
799 Note that whitespace cannot appear in the name of the file. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
800 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
801 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
802 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
803 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
804 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
805 <term>END <parameter>[expr]</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
806 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
807 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
808 This directive causes the assembler to stop assembling immediately as though |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
809 it ran out of input. For the DECB target only, <parameter>expr</parameter> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
810 can be used to set the execution address of the resulting binary. For all |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
811 other targets, specifying <parameter>expr</parameter> will cause an error. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
812 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
813 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
814 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
815 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
816 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
817 <term>ERROR <parameter>string</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
818 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
819 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
820 Causes a custom error message to be printed at this line. This will cause |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
821 assembly to fail. This directive is most useful inside conditional constructs |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
822 to cause assembly to fail if some condition that is known bad happens. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
823 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
824 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
825 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
826 |
167 | 827 <varlistentry> |
828 <term>.MODULE <parameter>string</parameter></term> | |
829 <listitem> | |
830 <para> | |
831 This directive is ignored for most output targets. If the output target | |
832 supports encoding a module name into it, <parameter>string</parameter> | |
833 will be used as the module name. | |
834 </para> | |
835 <para> | |
836 As of version 2.2, no supported output targets support this directive. | |
837 </para> | |
838 </listitem> | |
839 </varlistentry> | |
840 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
841 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
842 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
843 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
844 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
845 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
846 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
847 <title>Macros</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
848 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
849 LWASM is a macro assembler. A macro is simply a name that stands in for a |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
850 series of instructions. Once a macro is defined, it is used like any other |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
851 assembler directive. Defining a macro can be considered equivalent to adding |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
852 additional assembler directives. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
853 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
854 <para>Macros my accept parameters. These parameters are referenced within |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
855 a macro by the a backslash ("\") followed by a digit 1 through 9 for the first |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
856 through ninth parameters. They may also be referenced by enclosing the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
857 decimal parameter number in braces ("{num}"). These parameter references |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
858 are replaced with the verbatim text of the parameter passed to the macro. A |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
859 reference to a non-existent parameter will be replaced by an empty string. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
860 Macro parameters are expanded everywhere on each source line. That means |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
861 the parameter to a macro could be used as a symbol or it could even appear |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
862 in a comment or could cause an entire source line to be commented out |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
863 when the macro is expanded. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
864 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
865 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
866 Parameters passed to a macro are separated by commas and the parameter list |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
867 is terminated by any whitespace. This means that neither a comma nor whitespace |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
868 may be included in a macro parameter. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
869 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
870 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
871 Macro expansion is done recursively. That is, within a macro, macros are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
872 expanded. This can lead to infinite loops in macro expansion. If the assembler |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
873 hangs for a long time while assembling a file that uses macros, this may be |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
874 the reason.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
875 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
876 <para>Each macro expansion receives its own local symbol context which is not |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
877 inherited by any macros called by it nor is it inherited from the context |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
878 the macro was instantiated in. That means it is possible to use local symbols |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
879 within macros without having them collide with symbols in other macros or |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
880 outside the macro itself. However, this also means that using a local symbol |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
881 as a parameter to a macro, while legal, will not do what it would seem to do |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
882 as it will result in looking up the local symbol in the macro's symbol context |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
883 rather than the enclosing context where it came from, likely yielding either |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
884 an undefined symbol error or bizarre assembly results. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
885 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
886 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
887 Note that there is no way to define a macro as local to a symbol context. All |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
888 macros are part of the global macro namespace. However, macros have a separate |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
889 namespace from symbols so it is possible to have a symbol with the same name |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
890 as a macro. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
891 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
892 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
893 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
894 Macros are defined only during the first pass. Macro expansion also |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
895 only occurs during the first pass. On the second pass, the macro |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
896 definition is simply ignored. Macros must be defined before they are used. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
897 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
898 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
899 <para>The following directives are used when defining macros.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
900 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
901 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
902 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
903 <term><parameter>macroname</parameter> MACRO</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
904 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
905 <para>This directive is used to being the definition of a macro called |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
906 <parameter>macroname</parameter>. If <parameter>macroname</parameter> already |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
907 exists, it is considered an error. Attempting to define a macro within a |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
908 macro is undefined. It may work and it may not so the behaviour should not |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
909 be relied upon. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
910 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
911 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
912 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
913 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
914 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
915 <term>ENDM</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
916 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
917 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
918 This directive indicates the end of the macro currently being defined. It |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
919 causes the assembler to resume interpreting source lines as normal. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
920 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
921 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
922 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
923 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
924 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
925 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
926 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
927 <title>Object Files and Sections</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
928 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
929 The object file target is very useful for large project because it allows |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
930 multiple files to be assembled independently and then linked into the final |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
931 binary at a later time. It allows only the small portion of the project |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
932 that was modified to be re-assembled rather than requiring the entire set |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
933 of source code to be available to the assembler in a single assembly process. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
934 This can be particularly important if there are a large number of macros, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
935 symbol definitions, or other metadata that uses resources at assembly time. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
936 By far the largest benefit, however, is keeping the source files small enough |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
937 for a mere mortal to find things in them. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
938 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
939 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
940 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
941 With multi-file projects, there needs to be a means of resolving references to |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
942 symbols in other source files. These are known as external references. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
943 addresses of these symbols cannot be known until the linker joins all the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
944 object files into a single binary. This means that the assembler must be |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
945 able to output the object code without knowing the value of the symbol. This |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
946 places some restrictions on the code generated by the assembler. For |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
947 example, the assembler cannot generate direct page addressing for instructions |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
948 that reference external symbols because the address of the symbol may not |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
949 be in the direct page. Similarly, relative branches and PC relative addressing |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
950 cannot be used in their eight bit forms. Everything that must be resolved |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
951 by the linker must be assembled to use the largest address size possible to |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
952 allow the linker to fill in the correct value at link time. Note that the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
953 same problem applies to absolute address references as well, even those in |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
954 the same source file, because the address is not known until link time. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
955 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
956 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
957 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
958 It is often desired in multi-file projects to have code of various types grouped |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
959 together in the final binary generated by the linker as well. The same applies |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
960 to data. In order for the linker to do that, the bits that are to be grouped |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
961 must be tagged in some manner. This is where the concept of sections comes in. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
962 Each chunk of code or data is part of a section in the object file. Then, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
963 when the linker reads all the object files, it coalesces all sections of the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
964 same name into a single section and then considers it as a unit. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
965 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
966 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
967 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
968 The existence of sections, however, raises a problem for symbols even |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
969 within the same source file. Thus, the assembler must treat symbols from |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
970 different sections within the same source file in the same manner as external |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
971 symbols. That is, it must leave them for the linker to resolve at link time, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
972 with all the limitations that entails. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
973 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
974 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
975 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
976 In the object file target mode, LWASM requires all source lines that |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
977 cause bytes to be output to be inside a section. Any directives that do |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
978 not cause any bytes to be output can appear outside of a section. This includes |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
979 such things as EQU or RMB. Even ORG can appear outside a section. ORG, however, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
980 makes no sense within a section because it is the linker that determines |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
981 the starting address of the section's code, not the assembler. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
982 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
983 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
984 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
985 All symbols defined globally in the assembly process are local to the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
986 source file and cannot be exported. All symbols defined within a section are |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
987 considered local to the source file unless otherwise explicitly exported. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
988 Symbols referenced from external source files must be declared external, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
989 either explicitly or by asking the assembler to assume that all undefined |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
990 symbols are external. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
991 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
992 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
993 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
994 It is often handy to define a number of memory addresses that will be |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
995 used for data at run-time but which need not be included in the binary file. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
996 These memory addresses are not initialized until run-time, either by the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
997 program itself or by the program loader, depending on the operating environment. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
998 Such sections are often known as BSS sections. LWASM supports generating |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
999 sections with a BSS attribute set which causes the section definition including |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1000 symbols exported from that section and those symbols required to resolve |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1001 references from the local file, but with no actual code in the object file. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1002 It is illegal for any source lines within a BSS flagged section to cause any |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1003 bytes to be output. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1004 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1005 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1006 <para>The following directives apply to section handling.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1007 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1008 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1009 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1010 <term>SECTION <parameter>name[,flags]</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1011 <term>SECT <parameter>name[,flags]</parameter></term> |
167 | 1012 <term>.AREA <parameter>name[,flags]</parameter></term> |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1013 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1014 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1015 Instructs the assembler that the code following this directive is to be |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1016 considered part of the section <parameter>name</parameter>. A section name |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1017 may appear multiple times in which case it is as though all the code from |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1018 all the instances of that section appeared adjacent within the source file. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1019 However, <parameter>flags</parameter> may only be specified on the first |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1020 instance of the section. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1021 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1022 <para>There is a single flag supported in <parameter>flags</parameter>. The |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1023 flag <parameter>bss</parameter> will cause the section to be treated as a BSS |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1024 section and, thus, no code will be included in the object file nor will any |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1025 bytes be permitted to be output.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1026 <para> |
159
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1027 If the section name is "bss" or ".bss" in any combination of upper and |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1028 lower case, the section is assumed to be a BSS section. In that case, |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1029 the flag <parameter>!bss</parameter> can be used to override this assumption. |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1030 </para> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1031 <para> |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1032 If assembly is already happening within a section, the section is implicitly |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1033 ended and the new section started. This is not considered an error although |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1034 it is recommended that all sections be explicitly closed. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1035 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1036 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1037 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1038 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1039 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1040 <term>ENDSECTION</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1041 <term>ENDSECT</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1042 <term>ENDS</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1043 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1044 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1045 This directive ends the current section. This puts assembly outside of any |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1046 sections until the next SECTION directive. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1047 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1048 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1049 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1050 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1051 <term><parameter>sym</parameter> EXTERN</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1052 <term><parameter>sym</parameter> EXTERNAL</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1053 <term><parameter>sym</parameter> IMPORT</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1054 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1055 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1056 This directive defines <parameter>sym</parameter> as an external symbol. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1057 This directive may occur at any point in the source code. EXTERN definitions |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1058 are resolved on the first pass so an EXTERN definition anywhere in the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1059 source file is valid for the entire file. The use of this directive is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1060 optional when the assembler is instructed to assume that all undefined |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1061 symbols are external. In fact, in that mode, if the symbol is referenced |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1062 before the EXTERN directive, an error will occur. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1063 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1064 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1065 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1066 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1067 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1068 <term><parameter>sym</parameter> EXPORT</term> |
167 | 1069 <term><parameter>sym</parameter> .GLOBL</term> |
1070 | |
1071 <term>EXPORT <parameter>sym</parameter></term> | |
1072 <term>.GLOBL <parameter>sym</parameter></term> | |
1073 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1074 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1075 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1076 This directive defines <parameter>sym</parameter> as an exported symbol. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1077 This directive may occur at any point in the source code, even before the |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1078 definition of the exported symbol. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1079 </para> |
167 | 1080 <para> |
1081 Note that <parameter>sym</parameter> may appear as the operand or as the | |
1082 statement's symbol. If there is a symbol on the statement, that will | |
1083 take precedence over any operand that is present. | |
1084 </para> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1085 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1086 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1087 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1088 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1089 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1090 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1091 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1092 <section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1093 <title>Assembler Modes and Pragmas</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1094 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1095 There are a number of options that affect the way assembly is performed. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1096 Some of these options can only be specified on the command line because |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1097 they determine something absolute about the assembly process. These include |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1098 such things as the output target. Other things may be switchable during |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1099 the assembly process. These are known as pragmas and are, by definition, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1100 not portable between assemblers. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1101 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1102 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1103 <para>LWASM supports a number of pragmas that affect code generation or |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1104 otherwise affect the behaviour of the assembler. These may be specified by |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1105 way of a command line option or by assembler directives. The directives |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1106 are as follows. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1107 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1108 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1109 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1110 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1111 <term>PRAGMA <parameter>pragma[,...]</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1112 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1113 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1114 Specifies that the assembler should bring into force all <parameter>pragma</parameter>s |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1115 specified. Any unrecognized pragma will cause an assembly error. The new |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1116 pragmas will take effect immediately. This directive should be used when |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1117 the program will assemble incorrectly if the pragma is ignored or not supported. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1118 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1119 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1120 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1121 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1122 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1123 <term>*PRAGMA <parameter>pragma[,...]</parameter></term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1124 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1125 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1126 This is identical to the PRAGMA directive except no error will occur with |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1127 unrecognized or unsupported pragmas. This directive, by virtue of starting |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1128 with a comment character, will also be ignored by assemblers that do not |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1129 support this directive. Use this variation if the pragma is not required |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1130 for correct functioning of the code. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1131 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1132 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1133 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1134 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1135 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1136 <para>Each pragma supported has a positive version and a negative version. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1137 The positive version enables the pragma while the negative version disables |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1138 it. The negatitve version is simply the positive version with "no" prefixed |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1139 to it. For instance, "pragma" vs. "nopragma". Only the positive version is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1140 listed below.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1141 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1142 <para>Pragmas are not case sensitive.</para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1143 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1144 <variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1145 <varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1146 <term>index0tonone</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1147 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1148 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1149 When in force, this pragma enables an optimization affecting indexed addressing |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1150 modes. When the offset expression in an indexed mode evaluates to zero but is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1151 not explicity written as 0, this will replace the operand with the equivalent |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1152 no offset mode, thus creating slightly faster code. Because of the advantages |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1153 of this optimization, it is enabled by default. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1154 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1155 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1156 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1157 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1158 <varlistentry> |
159
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1159 <term>cescapes</term> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1160 <listitem> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1161 <para> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1162 This pragma will cause strings in the FCC, FCS, and FCN pseudo operations to |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1163 have C-style escape sequences interpreted. The one departure from the official |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1164 spec is that unrecognized escape sequences will return either the character |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1165 immediately following the backslash or some undefined value. Do not rely |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1166 on the behaviour of undefined escape sequences. |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1167 </para> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1168 </listitem> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1169 </varlistentry> |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1170 |
71561c12b20b
Updated docs to reflect new cescapes pragma and discuss implicit assumption of the bss section flag for sections named bss and .bss
lost
parents:
150
diff
changeset
|
1171 <varlistentry> |
227 | 1172 <term>importundefexport</term> |
1173 <listitem> | |
1174 <para> | |
1175 This pragma is only valid for targets that support external references. When | |
1176 in force, it will cause the EXPORT directive to act as IMPORT if the symbol | |
1177 to be exported is not defined. This is provided for compatibility with the | |
1178 output of gcc6809 and should not be used in hand written code. Because of | |
1179 the confusion this pragma can cause, it is disabled by default. | |
1180 </para> | |
1181 </listitem> | |
1182 </varlistentry> | |
1183 | |
1184 <varlistentry> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1185 <term>undefextern</term> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1186 <listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1187 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1188 This pragma is only valid for targets that support external references. When in |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1189 force, if the assembler sees an undefined symbol on the second pass, it will |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1190 automatically define it as an external symbol. This automatic definition will |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1191 apply for the remainder of the assembly process, even if the pragma is |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1192 subsequently turned off. Because this behaviour would be potentially surprising, |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1193 this pragma defaults to off. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1194 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1195 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1196 The primary use for this pragma is for projects that share a large number of |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1197 symbols between source files. In such cases, it is impractical to enumerate |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1198 all the external references in every source file. This allows the assembler |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1199 and linker to do the heavy lifting while not preventing a particular source |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1200 module from defining a local symbol of the same name as an external symbol |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1201 if it does not need the external symbol. (This pragma will not cause an |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1202 automatic external definition if there is already a locally defined symbol.) |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1203 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1204 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1205 This pragma will often be specified on the command line for large projects. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1206 However, depending on the specific dynamics of the project, it may be sufficient |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1207 for one or two files to use this pragma internally. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1208 </para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1209 </listitem> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1210 </varlistentry> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1211 </variablelist> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1212 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1213 </section> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1214 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1215 </chapter> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1216 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1217 <chapter> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1218 <title>LWLINK</title> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1219 <para> |
150 | 1220 The LWTOOLS linker is called LWLINK. This chapter documents the various features |
1221 of the linker. | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1222 </para> |
150 | 1223 |
1224 <section> | |
1225 <title>Command Line Options</title> | |
1226 <para> | |
1227 The binary for LWLINK is called "lwlink". Note that the binary is in lower | |
1228 case. lwlink takes the following command line arguments. | |
1229 </para> | |
1230 <variablelist> | |
1231 <varlistentry> | |
1232 <term><option>--decb</option></term> | |
1233 <term><option>-b</option></term> | |
1234 <listitem> | |
1235 <para> | |
1236 Selects the DECB output format target. This is equivalent to <option>--format=decb</option> | |
1237 </para> | |
1238 </listitem> | |
1239 </varlistentry> | |
1240 | |
1241 <varlistentry> | |
1242 <term><option>--output=FILE</option></term> | |
1243 <term><option>-o FILE</option></term> | |
1244 <listitem> | |
1245 <para> | |
1246 This option specifies the name of the output file. If not specified, the | |
1247 default is <option>a.out</option>. | |
1248 </para> | |
1249 </listitem> | |
1250 </varlistentry> | |
1251 | |
1252 <varlistentry> | |
1253 <term><option>--format=TYPE</option></term> | |
1254 <term><option>-f TYPE</option></term> | |
1255 <listitem> | |
1256 <para> | |
1257 This option specifies the output format. Valid values are <option>decb</option> | |
1258 and <option>raw</option> | |
1259 </para> | |
1260 </listitem> | |
1261 </varlistentry> | |
1262 | |
1263 <varlistentry> | |
1264 <term><option>--raw</option></term> | |
1265 <term><option>-r</option></term> | |
1266 <listitem> | |
1267 <para> | |
1268 This option specifies the raw output format. | |
1269 It is equivalent to <option>--format=raw</option>. | |
1270 and <option>raw</option> | |
1271 </para> | |
1272 </listitem> | |
1273 </varlistentry> | |
1274 | |
1275 <varlistentry> | |
1276 <term><option>--script=FILE</option></term> | |
1277 <term><option>-s</option></term> | |
1278 <listitem> | |
1279 <para> | |
1280 This option allows specifying a linking script to override the linker's | |
1281 built in defaults. | |
1282 </para> | |
1283 </listitem> | |
1284 </varlistentry> | |
1285 | |
1286 <varlistentry> | |
186 | 1287 <term><option>--section-base=SECT=BASE</option></term> |
1288 <listitem> | |
1289 <para> | |
1290 Cause section SECT to load at base address BASE. This will be prepended | |
1291 to the built-in link script. It is ignored if a link script is provided. | |
1292 </para> | |
1293 </listitem> | |
1294 </varlistentry> | |
1295 | |
1296 <varlistentry> | |
1297 <term><option>--map=FILE</option></term> | |
1298 <term><option>-m FILE</option></term> | |
1299 <listitem> | |
1300 <para> | |
1301 This will output a description of the link result to FILE. | |
1302 </para> | |
1303 </listitem> | |
1304 </varlistentry> | |
1305 | |
1306 <varlistentry> | |
1307 <term><option>--library=LIBSPEC</option></term> | |
1308 <term><option>-l LIBSPEC</option></term> | |
1309 <listitem> | |
1310 <para> | |
1311 Load a library using the library search path. LIBSPEC will have "lib" prepended | |
1312 and ".a" appended. | |
1313 </para> | |
1314 </listitem> | |
1315 </varlistentry> | |
1316 | |
1317 <varlistentry> | |
1318 <term><option>--library-path=DIR</option></term> | |
1319 <term><option>-L DIR</option></term> | |
1320 <listitem> | |
1321 <para> | |
1322 Add DIR to the library search path. | |
1323 </para> | |
1324 </listitem> | |
1325 </varlistentry> | |
1326 | |
1327 <varlistentry> | |
150 | 1328 <term><option>--debug</option></term> |
1329 <term><option>-d</option></term> | |
1330 <listitem> | |
1331 <para> | |
1332 This option increases the debugging level. It is only useful for LWTOOLS | |
1333 developers. | |
1334 </para> | |
1335 </listitem> | |
1336 </varlistentry> | |
1337 | |
1338 <varlistentry> | |
1339 <term><option>--help</option></term> | |
1340 <term><option>-?</option></term> | |
1341 <listitem> | |
1342 <para> | |
1343 This provides a listing of command line options and a brief description | |
1344 of each. | |
1345 </para> | |
1346 </listitem> | |
1347 </varlistentry> | |
1348 | |
1349 <varlistentry> | |
1350 <term><option>--usage</option></term> | |
1351 <listitem> | |
1352 <para> | |
1353 This will display a usage summary. | |
1354 of each. | |
1355 </para> | |
1356 </listitem> | |
1357 </varlistentry> | |
1358 | |
1359 | |
1360 <varlistentry> | |
1361 <term><option>--version</option></term> | |
1362 <term><option>-V</option></term> | |
1363 <listitem> | |
1364 <para> | |
1365 This will display the version of LWLINK. | |
1366 </para> | |
1367 </listitem> | |
1368 </varlistentry> | |
1369 | |
1370 </section> | |
1371 | |
1372 <section> | |
1373 <title>Linker Operation</title> | |
1374 | |
1375 <para> | |
175 | 1376 |
1377 LWLINK takes one or more files in supported input formats and links them | |
1378 into a single binary. Currently supported formats are the LWTOOLS object | |
1379 file format and the archive format used by LWAR. While the precise method is | |
1380 slightly different, linking can be conceptualized as the following steps. | |
1381 | |
150 | 1382 </para> |
1383 | |
1384 <orderedlist> | |
1385 <listitem> | |
1386 <para> | |
1387 First, the linker loads a linking script. If no script is specified, it | |
1388 loads a built-in default script based on the output format selected. This | |
1389 script tells the linker how to lay out the various sections in the final | |
1390 binary. | |
1391 </para> | |
1392 </listitem> | |
1393 | |
1394 <listitem> | |
1395 <para> | |
1396 Next, the linker reads all the input files into memory. At this time, it | |
1397 flags any format errors in those files. It constructs a table of symbols | |
1398 for each object at this time. | |
1399 </para> | |
1400 </listitem> | |
1401 | |
1402 <listitem> | |
1403 <para> | |
1404 The linker then proceeds with organizing the sections loaded from each file | |
1405 according to the linking script. As it does so, it is able to assign addresses | |
1406 to each symbol defined in each object file. At this time, the linker may | |
1407 also collapse different instances of the same section name into a single | |
1408 section by appending the data from each subsequent instance of the section | |
1409 to the first instance of the section. | |
1410 </para> | |
1411 </listitem> | |
1412 | |
1413 <listitem> | |
1414 <para> | |
1415 Next, the linker looks through every object file for every incomplete reference. | |
1416 It then attempts to fully resolve that reference. If it cannot do so, it | |
1417 throws an error. Once a reference is resolved, the value is placed into | |
1418 the binary code at the specified section. It should be noted that an | |
1419 incomplete reference can reference either a symbol internal to the object | |
1420 file or an external symbol which is in the export list of another object | |
1421 file. | |
1422 </para> | |
1423 </listitem> | |
1424 | |
1425 <listitem> | |
1426 <para> | |
1427 If all of the above steps are successful, the linker opens the output file | |
1428 and actually constructs the binary. | |
1429 </para> | |
1430 </listitem> | |
1431 </orderedlist> | |
1432 | |
1433 </section> | |
1434 | |
1435 <section | |
1436 <title>Linking Scripts</title> | |
1437 <para> | |
1438 A linker script is used to instruct the linker about how to assemble the | |
1439 various sections into a completed binary. It consists of a series of | |
1440 directives which are considered in the order they are encountered. | |
1441 </para> | |
1442 <para> | |
1443 The sections will appear in the resulting binary in the order they are | |
1444 specified in the script file. If a referenced section is not found, the linker will behave as though the | |
1445 section did exist but had a zero size, no relocations, and no exports. | |
1446 A section should only be referenced once. Any subsequent references will have | |
1447 an undefined effect. | |
1448 </para> | |
1449 | |
1450 <para> | |
1451 All numbers are in linking scripts are specified in hexadecimal. All directives | |
1452 are case sensitive although the hexadecimal numbers are not. | |
1453 </para> | |
1454 | |
1455 <para>A section name can be specified as a "*", then any section not | |
1456 already matched by the script will be matched. The "*" can be followed | |
1457 by a comma and a flag to narrow the section down slightly, also. | |
1458 If the flag is "!bss", then any section that is not flagged as a bss section | |
1459 will be matched. If the flag is "bss", then any section that is flagged as | |
1460 bss will be matched. | |
1461 </para> | |
1462 | |
1463 <para>The following directives are understood in a linker script.</para> | |
1464 <variablelist> | |
1465 <varlistentry> | |
1466 <term>section <parameter>name</parameter> load <parameter>addr</parameter></term> | |
1467 <listitem><para> | |
1468 | |
1469 This causes the section <parameter>name</parameter> to load at | |
1470 <parameter>addr</parameter>. For the raw target, only one "load at" entry is | |
1471 allowed for non-bss sections and it must be the first one. For raw targets, | |
1472 it affects the addresses the linker assigns to symbols but has no other | |
1473 affect on the output. bss sections may all have separate load addresses but | |
1474 since they will not appear in the binary anyway, this is okay. | |
1475 </para><para> | |
1476 For the decb target, each "load" entry will cause a new "block" to be | |
1477 output to the binary which will contain the load address. It is legal for | |
1478 sections to overlap in this manner - the linker assumes the loader will sort | |
1479 everything out. | |
1480 </para></listitem> | |
1481 </varlistentry> | |
1482 | |
1483 <varlistentry> | |
1484 <term>section <parameter>name</parameter></term> | |
1485 <listitem><para> | |
1486 | |
1487 This will cause the section <parameter>name</parameter> to load after the previously listed | |
1488 section. | |
1489 </para></listitem></varlistentry> | |
1490 <varlistentry> | |
1491 <term>exec <parameter>addr or sym</parameter></term> | |
1492 <listitem> | |
1493 <para> | |
1494 This will cause the execution address (entry point) to be the address | |
1495 specified (in hex) or the specified symbol name. The symbol name must | |
1496 match a symbol that is exported by one of the object files being linked. | |
1497 This has no effect for targets that do not encode the entry point into the | |
1498 resulting file. If not specified, the entry point is assumed to be address 0 | |
1499 which is probably not what you want. The default link scripts for targets | |
1500 that support this directive automatically starts at the beginning of the | |
1501 first section (usually "init" or "code") that is emitted in the binary. | |
1502 </para> | |
1503 </listitem> | |
1504 </varlistentry> | |
1505 | |
1506 <varlistentry> | |
1507 <term>pad <parameter>size</parameter></term> | |
1508 <listitem><para> | |
1509 This will cause the output file to be padded with NUL bytes to be exactly | |
1510 <parameter>size</parameter> bytes in length. This only makes sense for a raw target. | |
1511 </para> | |
1512 </listitem> | |
1513 </varlistentry> | |
1514 </variablelist> | |
1515 | |
1516 | |
1517 | |
1518 </section> | |
1519 | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1520 </chapter> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1521 |
175 | 1522 <chapter> |
1523 <title>Libraries and LWAR</title> | |
1524 | |
1525 <para> | |
1526 LWTOOLS also includes a tool for managing libraries. These are analogous to | |
1527 the static libraries created with the "ar" tool on POSIX systems. Each library | |
1528 file contains one or more object files. The linker will treat the object | |
1529 files within a library as though they had been specified individually on | |
1530 the command line except when resolving external references. External references | |
1531 are looked up first within the object files within the library and then, if | |
1532 not found, the usual lookup based on the order the files are specified on | |
1533 the command line occurs. | |
1534 </para> | |
1535 | |
1536 <para> | |
1537 The tool for creating these libary files is called LWAR. | |
1538 </para> | |
1539 | |
1540 <section> | |
1541 <title>Command Line Options</title> | |
1542 <para> | |
1543 The binary for LWAR is called "lwar". Note that the binary is in lower | |
1544 case. The options lwar understands are listed below. For archive manipulation | |
1545 options, the first non-option argument is the name of the archive. All other | |
1546 non-option arguments are the names of files to operate on. | |
1547 </para> | |
1548 | |
1549 <variablelist> | |
1550 <varlistentry> | |
1551 <term><option>--add</option></term> | |
1552 <term><option>-a</option></term> | |
1553 <listitem> | |
1554 <para> | |
1555 This option specifies that an archive is going to have files added to it. | |
1556 If the archive does not already exist, it is created. New files are added | |
1557 to the end of the archive. | |
1558 </para> | |
1559 </listitem> | |
1560 </varlistentry> | |
1561 | |
1562 <varlistentry> | |
1563 <term><option>--create</option></term> | |
1564 <term><option>-c</option></term> | |
1565 <listitem> | |
1566 <para> | |
1567 This option specifies that an archive is going to be created and have files | |
1568 added to it. If the archive already exists, it is truncated. | |
1569 </para> | |
1570 </listitem> | |
1571 </varlistentry> | |
1572 | |
1573 <varlistentry> | |
1574 <term><option>--merge</option></term> | |
1575 <term><option>-m</option></term> | |
1576 <listitem> | |
1577 <para> | |
1578 If specified, any files specified to be added to an archive will be checked | |
1579 to see if they are archives themselves. If so, their constituent members are | |
1580 added to the archive. This is useful for avoiding archives containing archives. | |
1581 </para> | |
1582 </listitem> | |
1583 </varlistentry> | |
1584 | |
1585 <varlistentry> | |
1586 <term><option>--list</option></term> | |
1587 <term><option>-l</option></term> | |
1588 <listitem> | |
1589 <para> | |
1590 This will display a list of the files contained in the archive. | |
1591 </para> | |
1592 </listitem> | |
1593 </varlistentry> | |
1594 | |
1595 <varlistentry> | |
1596 <term><option>--debug</option></term> | |
1597 <term><option>-d</option></term> | |
1598 <listitem> | |
1599 <para> | |
1600 This option increases the debugging level. It is only useful for LWTOOLS | |
1601 developers. | |
1602 </para> | |
1603 </listitem> | |
1604 </varlistentry> | |
1605 | |
1606 <varlistentry> | |
1607 <term><option>--help</option></term> | |
1608 <term><option>-?</option></term> | |
1609 <listitem> | |
1610 <para> | |
1611 This provides a listing of command line options and a brief description | |
1612 of each. | |
1613 </para> | |
1614 </listitem> | |
1615 </varlistentry> | |
1616 | |
1617 <varlistentry> | |
1618 <term><option>--usage</option></term> | |
1619 <listitem> | |
1620 <para> | |
1621 This will display a usage summary. | |
1622 of each. | |
1623 </para> | |
1624 </listitem> | |
1625 </varlistentry> | |
1626 | |
1627 | |
1628 <varlistentry> | |
1629 <term><option>--version</option></term> | |
1630 <term><option>-V</option></term> | |
1631 <listitem> | |
1632 <para> | |
1633 This will display the version of LWLINK. | |
1634 of each. | |
1635 </para> | |
1636 </listitem> | |
1637 </varlistentry> | |
1638 | |
1639 </section> | |
1640 | |
1641 </chapter> | |
1642 | |
109 | 1643 <chapter id="objchap"> |
1644 <title>Object Files</title> | |
145
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1645 <para> |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1646 LWTOOLS uses a proprietary object file format. It is proprietary in the sense |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1647 that it is specific to LWTOOLS, not that it is a hidden format. It would be |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1648 hard to keep it hidden in an open source tool chain anyway. This chapter |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1649 documents the object file format. |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1650 </para> |
150 | 1651 |
1652 <para> | |
1653 An object file consists of a series of sections each of which contains a | |
1654 list of exported symbols, a list of incomplete references, and a list of | |
1655 "local" symbols which may be used in calculating incomplete references. Each | |
1656 section will obviously also contain the object code. | |
1657 </para> | |
1658 | |
1659 <para> | |
1660 Exported symbols must be completely resolved to an address within the | |
1661 section it is exported from. That is, an exported symbol must be a constant | |
1662 rather than defined in terms of other symbols.</para> | |
1663 | |
1664 <para> | |
1665 Each object file starts with a magic number and version number. The magic | |
1666 number is the string "LWOBJ16" for this 16 bit object file format. The only | |
1667 defined version number is currently 0. Thus, the first 8 bytes of the object | |
1668 file are <code>4C574F424A313600</code> | |
1669 </para> | |
1670 | |
1671 <para> | |
1672 Each section has the following items in order: | |
1673 </para> | |
1674 | |
1675 <itemizedlist> | |
1676 <listitem><para>section name</para></listitem> | |
1677 <listitem><para>flags</para></listitem> | |
1678 <listitem><para>list of local symbols (and addresses within the section)</para></listitem> | |
1679 <listitem><para>list of exported symbols (and addresses within the section)</para></listitem> | |
1680 <listitem><para>list of incomplete references along with the expressions to calculate them</para></listitem> | |
1681 <listitem><para>the actual object code (for non-BSS sections)</para></listitem> | |
1682 </itemizedlist> | |
1683 | |
1684 <para> | |
1685 The section starts with the name of the section with a NUL termination | |
1686 followed by a series of flag bytes terminated by NUL. There are only two | |
1687 flag bytes defined. A NUL (0) indicates no more flags and a value of 1 | |
1688 indicates the section is a BSS section. For a BSS section, no actual | |
1689 code is included in the object file. | |
1690 </para> | |
1691 | |
1692 <para> | |
1693 Either a NULL section name or end of file indicate the presence of no more | |
1694 sections. | |
1695 </para> | |
1696 | |
1697 <para> | |
1698 Each entry in the exported and local symbols table consists of the symbol | |
1699 (NUL terminated) followed by two bytes which contain the value in big endian | |
1700 order. The end of a symbol table is indicated by a NULL symbol name. | |
1701 </para> | |
1702 | |
1703 <para> | |
1704 Each entry in the incomplete references table consists of an expression | |
1705 followed by a 16 bit offset where the reference goes. Expressions are | |
1706 defined as a series of terms up to an "end of expression" term. Each term | |
1707 consists of a single byte which identifies the type of term (see below) | |
1708 followed by any data required by the term. Then end of the list is flagged | |
1709 by a NULL expression (only an end of expression term). | |
1710 </para> | |
1711 | |
1712 <table frame="all"><title>Object File Term Types</title> | |
1713 <tgroup cols="2"> | |
1714 <thead> | |
1715 <row> | |
1716 <entry>TERMTYPE</entry> | |
1717 <entry>Meaning</entry> | |
1718 </row> | |
1719 </thead> | |
1720 <tbody> | |
1721 <row> | |
1722 <entry>00</entry> | |
1723 <entry>end of expression</entry> | |
1724 </row> | |
1725 | |
1726 <row> | |
1727 <entry>01</entry> | |
1728 <entry>integer (16 bit in big endian order follows)</entry> | |
1729 </row> | |
1730 <row> | |
1731 <entry>02</entry> | |
1732 <entry> external symbol reference (NUL terminated symbol name follows)</entry> | |
1733 </row> | |
1734 | |
1735 <row> | |
1736 <entry>03</entry> | |
1737 <entry>local symbol reference (NUL terminated symbol name follows)</entry> | |
1738 </row> | |
1739 | |
1740 <row> | |
1741 <entry>04</entry> | |
1742 <entry>operator (1 byte operator number)</entry> | |
1743 </row> | |
1744 <row> | |
1745 <entry>05</entry> | |
1746 <entry>section base address reference</entry> | |
1747 </row> | |
232 | 1748 |
1749 <row> | |
1750 <entry>FF</entry> | |
1751 <entry>This term will set flags for the expression. Each one of these terms will set a single flag. All of them should be specified first in an expression. If they are not, the behaviour is undefined. The byte following is the flag. There is currently only one flag defined. Flag 01 indicates an 8 bit relocation.</entry> | |
1752 </row> | |
150 | 1753 </tbody> |
1754 </tgroup> | |
1755 </table> | |
1756 | |
232 | 1757 |
150 | 1758 <para> |
1759 External references are resolved using other object files while local | |
1760 references are resolved using the local symbol table(s) from this file. This | |
1761 allows local symbols that are not exported to have the same names as | |
1762 exported symbols or external references. | |
1763 </para> | |
1764 | |
1765 <table frame="all"><title>Object File Operator Numbers</title> | |
1766 <tgroup cols="2"> | |
1767 <thead> | |
1768 <row> | |
1769 <entry>Number</entry> | |
1770 <entry>Operator</entry> | |
1771 </row> | |
1772 </thead> | |
1773 <tbody> | |
1774 <row> | |
1775 <entry>01</entry> | |
1776 <entry>addition (+)</entry> | |
1777 </row> | |
1778 <row> | |
1779 <entry>02</entry> | |
1780 <entry>subtraction (-)</entry> | |
1781 </row> | |
1782 <row> | |
1783 <entry>03</entry> | |
1784 <entry>multiplication (*)</entry> | |
1785 </row> | |
1786 <row> | |
1787 <entry>04</entry> | |
1788 <entry>division (/)</entry> | |
1789 </row> | |
1790 <row> | |
1791 <entry>05</entry> | |
1792 <entry>modulus (%)</entry> | |
1793 </row> | |
1794 <row> | |
1795 <entry>06</entry> | |
1796 <entry>integer division (\) (same as division)</entry> | |
1797 </row> | |
1798 | |
1799 <row> | |
1800 <entry>07</entry> | |
1801 <entry>bitwise and</entry> | |
1802 </row> | |
1803 | |
1804 <row> | |
1805 <entry>08</entry> | |
1806 <entry>bitwise or</entry> | |
1807 </row> | |
1808 | |
1809 <row> | |
1810 <entry>09</entry> | |
1811 <entry>bitwise xor</entry> | |
1812 </row> | |
1813 | |
1814 <row> | |
1815 <entry>0A</entry> | |
1816 <entry>boolean and</entry> | |
1817 </row> | |
1818 | |
1819 <row> | |
1820 <entry>0B</entry> | |
1821 <entry>boolean or</entry> | |
1822 </row> | |
1823 | |
1824 <row> | |
1825 <entry>0C</entry> | |
1826 <entry>unary negation, 2's complement (-)</entry> | |
1827 </row> | |
1828 | |
1829 <row> | |
1830 <entry>0D</entry> | |
1831 <entry>unary 1's complement (^)</entry> | |
1832 </row> | |
1833 </tbody> | |
1834 </tgroup> | |
1835 </table> | |
1836 | |
1837 <para> | |
1838 An expression is represented in a postfix manner with both operands for | |
1839 binary operators preceding the operator and the single operand for unary | |
1840 operators preceding the operator. | |
1841 </para> | |
1842 | |
109 | 1843 </chapter> |
1844 </book> | |
1845 |