Mercurial > hg-old > index.cgi
annotate doc/manual.docbook.sgml @ 201:7824f94c5786
take 2: importing undefined exports
author | lost |
---|---|
date | Sun, 22 Mar 2009 20:07:37 +0000 |
parents | bc2fae9438eb |
children | 4c60c3a09597 |
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 are very flexible in that they allow references that are not | |
102 known at assembly time to be resolved at link time. However, because the | |
103 addresses of such references are not known, there is no way for the assembler | |
104 has to use sixteen bit addressing modes for these references. The linker | |
105 will always use sixteen bits when resolving a reference which means any | |
106 instruction that requires an eight bit operand cannot use external references. | |
107 </para> | |
108 | |
109 <para>Object files also support the concept of sections which are not valid | |
110 for other output types. This allows related code from each object file | |
111 linked to be collapsed together in the final binary.</para> | |
112 | |
113 </section> | |
114 | |
115 </chapter> | |
116 | |
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
|
117 <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
|
118 <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
|
119 <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
|
120 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
|
121 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
|
122 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
|
123 </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
|
124 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
125 <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
|
126 <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
|
127 <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
|
128 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
|
129 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
|
130 </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
|
131 |
afe30454382f
Made development 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 <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
|
133 <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
|
134 <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
|
135 <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
|
136 <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
|
137 <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
|
138 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
|
139 </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
|
140 </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
|
141 </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
|
142 |
afe30454382f
Made development 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 <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
|
144 <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
|
145 <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
|
146 <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
|
147 <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
|
148 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
|
149 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
|
150 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
|
151 </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
|
152 </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
|
153 </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
|
154 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
155 <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
|
156 <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
|
157 <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
|
158 <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
|
159 <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
|
160 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
|
161 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
|
162 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
|
163 </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
|
164 </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
|
165 </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
|
166 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
167 <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
|
168 <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
|
169 <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
|
170 <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
|
171 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
|
172 </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
|
173 </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
|
174 </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
|
175 |
afe30454382f
Made development 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 <varlistentry> |
150 | 177 <term><option>--output=FILE</option></term> |
178 <term><option>-o FILE</option></term> | |
179 <listitem> | |
180 <para> | |
181 This option specifies the name of the output file. If not specified, the | |
182 default is <option>a.out</option>. | |
183 </para> | |
184 </listitem> | |
185 </varlistentry> | |
186 | |
187 <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
|
188 <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
|
189 <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
|
190 <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
|
191 <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
|
192 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
|
193 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
|
194 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
|
195 </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
|
196 </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
|
197 </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
|
198 |
afe30454382f
Made development 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 <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
|
200 <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
|
201 <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
|
202 <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
|
203 <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
|
204 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
|
205 </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
|
206 </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
|
207 </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
|
208 |
afe30454382f
Made development 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 <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
|
210 <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
|
211 <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
|
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 <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
|
214 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
|
215 </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
|
216 </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
|
217 </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
|
218 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
219 <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
|
220 <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
|
221 <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
|
222 <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
|
223 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
|
224 </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
|
225 </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
|
226 </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
|
227 |
afe30454382f
Made development 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 <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
|
229 <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
|
230 <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
|
231 <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
|
232 <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
|
233 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
|
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 |
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
|
238 <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
|
239 <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
|
240 <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
|
241 <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
|
242 <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
|
243 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
|
244 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
|
245 </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
|
246 </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
|
247 </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
|
248 |
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
|
249 </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
|
250 |
afe30454382f
Made development 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 </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
|
252 |
afe30454382f
Made development 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 <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
|
254 <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
|
255 <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
|
256 LWASM supports all documented MC6809 instructions as defined by Motorola. |
afe30454382f
Made development 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 It also supports all known HD6309 instructions. There is some variation, |
afe30454382f
Made development 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 however, in the pneumonics used for the block transfer instructions. 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
|
259 uses TFM for all four of them as do several other assemblers. Others, such |
afe30454382f
Made development 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 as CCASM, use four separate opcodes for it (compare: copy+, copy-, implode, |
afe30454382f
Made development 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 and explode). There are advantages to both methods. However, it seems like |
afe30454382f
Made development 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 TFM has the most traction and thus, this is what LWASM supports. Support |
afe30454382f
Made development 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 for such variations may be added in the future. |
afe30454382f
Made development 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 </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
|
265 |
afe30454382f
Made development 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 <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
|
267 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
|
268 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
|
269 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
|
270 </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
|
271 |
167 | 272 <para> |
273 Additionally, LWASM supports using the asterisk ("*") to indicate | |
274 base page addressing. This should not be used in hand-written source code, | |
275 however, because it is non-standard and may or may not be present in future | |
276 versions of LWASM. | |
277 </para> | |
278 | |
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
|
279 </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
|
280 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
281 <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
|
282 <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
|
283 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
284 <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
|
285 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
|
286 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
|
287 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
|
288 </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
|
289 <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
|
290 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
|
291 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
|
292 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
|
293 <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
|
294 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
|
295 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
|
296 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
|
297 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
|
298 </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
|
299 <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
|
300 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
|
301 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
|
302 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
|
303 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
|
304 </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
|
305 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
306 <para> |
175 | 307 For compatibility with the output generated by some C preprocessors, LWASM |
308 will also ignore lines that begin with a #. This should not be used as a general | |
309 comment character, however. | |
310 </para> | |
311 | |
312 <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
|
313 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
|
314 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
|
315 </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
|
316 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
317 <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
|
318 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
|
319 </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
|
320 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
321 </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
|
322 |
afe30454382f
Made development 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 <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
|
324 <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
|
325 |
afe30454382f
Made development 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 <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
|
327 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
|
328 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
|
329 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
|
330 </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
|
331 |
afe30454382f
Made development 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 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
|
334 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
|
335 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
|
336 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
|
337 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
|
338 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
|
339 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
|
340 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
|
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 |
afe30454382f
Made development 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 </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
|
344 |
afe30454382f
Made development 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 <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
|
346 <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
|
347 <para> |
175 | 348 |
349 Numbers can be expressed in binary, octal, decimal, or hexadecimal. Binary | |
350 numbers may be prefixed with a "%" symbol or suffixed with a "b" or "B". | |
351 Octal numbers may be prefixed with "@" or suffixed with "Q", "q", "O", or | |
352 "o". Hexadecimal numbers may be prefixed with "$", "0x" or "0X", or suffixed | |
353 with "H". No prefix or suffix is required for decimal numbers but they can | |
354 be prefixed with "&" if desired. Any constant which begins with a letter | |
355 must be expressed with the correct prefix base identifier or be prefixed | |
356 with a 0. Thus hexadecimal FF would have to be written either 0FFH or $FF. | |
357 Numbers are not case sensitive. | |
358 | |
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
|
359 </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
|
360 |
afe30454382f
Made development 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 <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
|
362 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
|
363 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
|
364 |
afe30454382f
Made development 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 <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
|
366 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
|
367 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
|
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 LWASM supports the following basic binary operators: +, -, *, /, 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
|
371 These represent addition, subtraction, multiplication, division, and modulus. |
afe30454382f
Made development 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 It also supports unary negation and unary 1's complement (- and ^ respectively). |
afe30454382f
Made development 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 For completeness, a unary positive (+) is supported though it is a no-op. |
afe30454382f
Made development 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 </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
|
375 |
afe30454382f
Made development 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 <para>Operator precedence follows the usual rules. multiplication, division, |
afe30454382f
Made development 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 and modulus take precedence over addition and subtraction. Unary operators |
afe30454382f
Made development 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 take precedence over binary operators. To force a specific order of evaluation, |
afe30454382f
Made development 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 parentheses can be used in the usual manner. |
afe30454382f
Made development 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 </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
|
381 </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
|
382 |
afe30454382f
Made development 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 <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
|
384 <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
|
385 <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
|
386 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
|
387 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
|
388 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
|
389 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
|
390 </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
|
391 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
392 <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
|
393 <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
|
394 <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
|
395 <varlistentry><term>FCB <parameter>expr[,...]</parameter></term> |
167 | 396 <term>.DB <parameter>expr[,...]</parameter></term> |
397 <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
|
398 <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
|
399 <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
|
400 </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
|
401 </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
|
402 |
167 | 403 <varlistentry> |
404 <term>FDB <parameter>expr[,...]</parameter></term> | |
405 <term>.DW <parameter>expr[,...]</parameter></term> | |
406 <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
|
407 <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
|
408 <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
|
409 </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
|
410 </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
|
411 |
167 | 412 <varlistentry> |
413 <term>FQB <parameter>expr[,...]</parameter></term> | |
414 <term>.QUAD <parameter>expr[,...]</parameter></term> | |
415 <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
|
416 <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
|
417 <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
|
418 </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
|
419 </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
|
420 |
167 | 421 <varlistentry> |
422 <term>FCC <parameter>string</parameter></term> | |
423 <term>.ASCII <parameter>string</parameter></term> | |
424 <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
|
425 <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
|
426 <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
|
427 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
|
428 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
|
429 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
|
430 </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
|
431 </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
|
432 </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
|
433 |
167 | 434 <varlistentry> |
435 <term>FCN <parameter>string</parameter></term> | |
436 <term>.ASCIZ <parameter>string</parameter></term> | |
437 <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
|
438 <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
|
439 <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
|
440 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
|
441 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
|
442 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
|
443 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
|
444 </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
|
445 </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
|
446 </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
|
447 |
167 | 448 <varlistentry> |
449 <term>FCS <parameter>string</parameter></term> | |
450 <term>.ASCIS <parameter>string</parameter></term> | |
451 <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
|
452 <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
|
453 <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
|
454 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
|
455 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
|
456 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
|
457 </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
|
458 </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
|
459 </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
|
460 |
afe30454382f
Made development 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 <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
|
462 <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
|
463 <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
|
464 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
|
465 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
|
466 </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
|
467 </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
|
468 </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
|
469 |
afe30454382f
Made development 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 <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
|
471 <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
|
472 <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
|
473 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
|
474 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
|
475 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
|
476 </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
|
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 </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
|
479 |
afe30454382f
Made development 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><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
|
481 <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
|
482 <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
|
483 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
|
484 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
|
485 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
|
486 </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
|
487 </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
|
488 </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
|
489 |
167 | 490 <varlistentry> |
491 <term>RMB <parameter>expr</parameter></term> | |
492 <term>.BLKB <parameter>expr</parameter></term> | |
493 <term>.DS <parameter>expr</parameter></term> | |
494 <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
|
495 <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
|
496 <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
|
497 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
|
498 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
|
499 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
|
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 </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
|
502 </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
|
503 |
afe30454382f
Made development 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 <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
|
505 <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
|
506 <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
|
507 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
|
508 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
|
509 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
|
510 </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
|
511 </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
|
512 </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
|
513 |
afe30454382f
Made development 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 <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
|
515 <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
|
516 <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
|
517 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
|
518 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
|
519 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
|
520 </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
|
521 </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
|
522 </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
|
523 </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
|
524 |
afe30454382f
Made development 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 </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
|
526 |
afe30454382f
Made development 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 <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
|
528 <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
|
529 <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
|
530 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
|
531 |
afe30454382f
Made development 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 <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
|
533 <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
|
534 <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
|
535 <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
|
536 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
|
537 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
|
538 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
|
539 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
|
540 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
|
541 </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
|
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 </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
|
544 |
afe30454382f
Made development 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 <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
|
546 <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
|
547 <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
|
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 <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
|
550 </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
|
551 </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
|
552 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
553 <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
|
554 <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
|
555 <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
|
556 <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
|
557 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
|
558 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
|
559 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
|
560 </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
|
561 </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
|
562 |
afe30454382f
Made development 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 <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
|
565 <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
|
566 <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
|
567 <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
|
568 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
|
569 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
|
570 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
|
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 <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
|
573 </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
|
574 </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
|
575 </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
|
576 |
afe30454382f
Made development 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 <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
|
578 <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
|
579 <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
|
580 <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
|
581 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
|
582 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
|
583 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
|
584 <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
|
585 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
|
586 </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
|
587 </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
|
588 </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
|
589 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
590 </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
|
591 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
592 </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
|
593 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
594 <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
|
595 <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
|
596 <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
|
597 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
|
598 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
|
599 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
|
600 </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
|
601 <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
|
602 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
|
603 </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
|
604 <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
|
605 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
|
606 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
|
607 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
|
608 |
afe30454382f
Made development 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 <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
|
610 <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
|
611 <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
|
612 <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
|
613 <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
|
614 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
|
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>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
|
621 <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
|
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>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
|
624 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
|
625 </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
|
626 </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
|
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 |
afe30454382f
Made development 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 <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
|
630 <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
|
631 <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
|
632 <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
|
633 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
|
634 </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
|
635 </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
|
636 </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
|
637 |
afe30454382f
Made development 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 <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
|
639 <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
|
640 <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
|
641 <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
|
642 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
|
643 </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
|
644 </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
|
645 </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
|
646 |
afe30454382f
Made development 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 <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
|
648 <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
|
649 <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
|
650 <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
|
651 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
|
652 </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
|
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 </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
|
655 |
afe30454382f
Made development 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 <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
|
657 <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
|
658 <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
|
659 <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
|
660 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
|
661 </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
|
662 </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
|
663 </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
|
664 |
afe30454382f
Made development 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 <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
|
666 <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
|
667 <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
|
668 <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
|
669 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
|
670 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
|
671 </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
|
672 </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
|
673 </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
|
674 |
afe30454382f
Made development 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 <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
|
676 <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
|
677 <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
|
678 <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
|
679 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
|
680 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
|
681 </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 </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
|
683 </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
|
684 |
afe30454382f
Made development 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 <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
|
686 <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
|
687 <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
|
688 <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
|
689 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
|
690 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
|
691 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
|
692 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
|
693 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
|
694 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
|
695 </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
|
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 |
afe30454382f
Made development 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 <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
|
699 <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
|
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 <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
|
702 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
|
703 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
|
704 </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
|
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 </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
|
707 |
afe30454382f
Made development 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 </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
|
709 </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
|
710 |
afe30454382f
Made development 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 <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
|
712 <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
|
713 |
afe30454382f
Made development 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 <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
|
715 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
|
716 |
afe30454382f
Made development 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 <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
|
718 |
afe30454382f
Made development 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 <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
|
721 <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
|
722 <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
|
723 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
|
724 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
|
725 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
|
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>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
|
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> |
afe30454382f
Made development 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 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
|
735 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
|
736 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
|
737 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
|
738 </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
|
739 </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
|
740 </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
|
741 |
afe30454382f
Made development 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 <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
|
743 <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
|
744 <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
|
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 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
|
747 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
|
748 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
|
749 </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
|
750 </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
|
751 </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
|
752 |
167 | 753 <varlistentry> |
754 <term>.MODULE <parameter>string</parameter></term> | |
755 <listitem> | |
756 <para> | |
757 This directive is ignored for most output targets. If the output target | |
758 supports encoding a module name into it, <parameter>string</parameter> | |
759 will be used as the module name. | |
760 </para> | |
761 <para> | |
762 As of version 2.2, no supported output targets support this directive. | |
763 </para> | |
764 </listitem> | |
765 </varlistentry> | |
766 | |
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
|
767 </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
|
768 </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
|
769 |
afe30454382f
Made development 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 </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
|
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 <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
|
773 <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
|
774 <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
|
775 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
|
776 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
|
777 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
|
778 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
|
779 </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
|
780 <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
|
781 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
|
782 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
|
783 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
|
784 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
|
785 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
|
786 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
|
787 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
|
788 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
|
789 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
|
790 </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
|
791 <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
|
792 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
|
793 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
|
794 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
|
795 </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
|
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 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
|
798 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
|
799 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
|
800 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
|
801 |
afe30454382f
Made development 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 <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
|
803 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
|
804 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
|
805 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
|
806 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
|
807 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
|
808 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
|
809 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
|
810 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
|
811 </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
|
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 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
|
814 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
|
815 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
|
816 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
|
817 </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
|
818 |
afe30454382f
Made development 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 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
|
821 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
|
822 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
|
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 |
afe30454382f
Made development 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 <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
|
826 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
827 <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
|
828 <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
|
829 <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
|
830 <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
|
831 <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
|
832 <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
|
833 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
|
834 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
|
835 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
|
836 </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
|
837 </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
|
838 </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
|
839 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
840 <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
|
841 <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
|
842 <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
|
843 <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
|
844 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
|
845 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
|
846 </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
|
847 </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
|
848 </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
|
849 |
afe30454382f
Made development 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 </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
|
851 |
afe30454382f
Made development 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 <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
|
853 <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
|
854 <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
|
855 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
|
856 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
|
857 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
|
858 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
|
859 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
|
860 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
|
861 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
|
862 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
|
863 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
|
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 |
afe30454382f
Made development 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 <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
|
867 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
|
868 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
|
869 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
|
870 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
|
871 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
|
872 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
|
873 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
|
874 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
|
875 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
|
876 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
|
877 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
|
878 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
|
879 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
|
880 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
|
881 </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
|
882 |
afe30454382f
Made development 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 <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
|
884 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
|
885 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
|
886 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
|
887 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
|
888 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
|
889 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
|
890 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
|
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 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
|
895 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
|
896 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
|
897 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
|
898 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
|
899 </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 <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
|
902 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
|
903 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
|
904 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
|
905 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
|
906 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
|
907 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
|
908 </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
|
909 |
afe30454382f
Made development 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 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
|
912 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
|
913 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
|
914 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
|
915 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
|
916 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
|
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 |
afe30454382f
Made development 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 <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
|
920 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
|
921 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
|
922 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
|
923 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
|
924 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
|
925 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
|
926 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
|
927 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
|
928 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
|
929 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
|
930 </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
|
931 |
afe30454382f
Made development 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 <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
|
933 |
afe30454382f
Made development 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 <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
|
935 <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
|
936 <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
|
937 <term>SECT <parameter>name[,flags]</parameter></term> |
167 | 938 <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
|
939 <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
|
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 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
|
942 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
|
943 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
|
944 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
|
945 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
|
946 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
|
947 </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
|
948 <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
|
949 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
|
950 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
|
951 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
|
952 <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
|
953 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
|
954 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
|
955 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
|
956 </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
|
957 <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
|
958 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
|
959 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
|
960 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
|
961 </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
|
962 </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
|
963 </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
|
964 |
afe30454382f
Made development 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 <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
|
966 <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
|
967 <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
|
968 <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
|
969 <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
|
970 <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
|
971 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
|
972 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
|
973 </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
|
974 </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
|
975 |
afe30454382f
Made development 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 <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
|
977 <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
|
978 <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
|
979 <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
|
980 <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
|
981 <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
|
982 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
|
983 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
|
984 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
|
985 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
|
986 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
|
987 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
|
988 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
|
989 </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
|
990 </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
|
991 </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
|
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 <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
|
994 <term><parameter>sym</parameter> EXPORT</term> |
167 | 995 <term><parameter>sym</parameter> .GLOBL</term> |
996 | |
997 <term>EXPORT <parameter>sym</parameter></term> | |
998 <term>.GLOBL <parameter>sym</parameter></term> | |
999 | |
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
|
1000 <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
|
1001 <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
|
1002 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
|
1003 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
|
1004 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
|
1005 </para> |
167 | 1006 <para> |
1007 Note that <parameter>sym</parameter> may appear as the operand or as the | |
1008 statement's symbol. If there is a symbol on the statement, that will | |
1009 take precedence over any operand that is present. | |
1010 </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
|
1011 </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
|
1012 </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
|
1013 |
afe30454382f
Made development 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 </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
|
1015 |
afe30454382f
Made development 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 </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
|
1017 |
afe30454382f
Made development 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 <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
|
1019 <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
|
1020 <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
|
1021 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
|
1022 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
|
1023 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
|
1024 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
|
1025 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
|
1026 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
|
1027 </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
|
1028 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1029 <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
|
1030 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
|
1031 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
|
1032 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
|
1033 </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
|
1034 |
afe30454382f
Made development 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 <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
|
1036 <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
|
1037 <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
|
1038 <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
|
1039 <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
|
1040 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
|
1041 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
|
1042 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
|
1043 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
|
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 </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
|
1046 </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
|
1047 |
afe30454382f
Made development 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 <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
|
1050 <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
|
1051 <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
|
1052 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
|
1053 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
|
1054 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
|
1055 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
|
1056 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
|
1057 </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
|
1058 </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
|
1059 </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
|
1060 </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
|
1061 |
afe30454382f
Made development 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 <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
|
1063 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
|
1064 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
|
1065 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
|
1066 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
|
1067 |
afe30454382f
Made development 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 <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
|
1069 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1070 <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
|
1071 <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
|
1072 <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
|
1073 <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
|
1074 <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
|
1075 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
|
1076 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
|
1077 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
|
1078 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
|
1079 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
|
1080 </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
|
1081 </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
|
1082 </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
|
1083 |
afe30454382f
Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents:
109
diff
changeset
|
1084 <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
|
1085 <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
|
1086 <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
|
1087 <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
|
1088 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
|
1089 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
|
1090 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
|
1091 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
|
1092 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
|
1093 </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
|
1094 </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
|
1095 </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
|
1096 |
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
|
1097 <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
|
1098 <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
|
1099 <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
|
1100 <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
|
1101 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
|
1102 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
|
1103 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
|
1104 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
|
1105 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
|
1106 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
|
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 <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
|
1109 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
|
1110 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
|
1111 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
|
1112 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
|
1113 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
|
1114 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
|
1115 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
|
1116 </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
|
1117 <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
|
1118 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
|
1119 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
|
1120 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
|
1121 </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
|
1122 </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
|
1123 </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
|
1124 </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
|
1125 |
afe30454382f
Made development 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 </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
|
1127 |
afe30454382f
Made development 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 </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
|
1129 |
afe30454382f
Made development 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 <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
|
1131 <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
|
1132 <para> |
150 | 1133 The LWTOOLS linker is called LWLINK. This chapter documents the various features |
1134 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
|
1135 </para> |
150 | 1136 |
1137 <section> | |
1138 <title>Command Line Options</title> | |
1139 <para> | |
1140 The binary for LWLINK is called "lwlink". Note that the binary is in lower | |
1141 case. lwlink takes the following command line arguments. | |
1142 </para> | |
1143 <variablelist> | |
1144 <varlistentry> | |
1145 <term><option>--decb</option></term> | |
1146 <term><option>-b</option></term> | |
1147 <listitem> | |
1148 <para> | |
1149 Selects the DECB output format target. This is equivalent to <option>--format=decb</option> | |
1150 </para> | |
1151 </listitem> | |
1152 </varlistentry> | |
1153 | |
1154 <varlistentry> | |
1155 <term><option>--output=FILE</option></term> | |
1156 <term><option>-o FILE</option></term> | |
1157 <listitem> | |
1158 <para> | |
1159 This option specifies the name of the output file. If not specified, the | |
1160 default is <option>a.out</option>. | |
1161 </para> | |
1162 </listitem> | |
1163 </varlistentry> | |
1164 | |
1165 <varlistentry> | |
1166 <term><option>--format=TYPE</option></term> | |
1167 <term><option>-f TYPE</option></term> | |
1168 <listitem> | |
1169 <para> | |
1170 This option specifies the output format. Valid values are <option>decb</option> | |
1171 and <option>raw</option> | |
1172 </para> | |
1173 </listitem> | |
1174 </varlistentry> | |
1175 | |
1176 <varlistentry> | |
1177 <term><option>--raw</option></term> | |
1178 <term><option>-r</option></term> | |
1179 <listitem> | |
1180 <para> | |
1181 This option specifies the raw output format. | |
1182 It is equivalent to <option>--format=raw</option>. | |
1183 and <option>raw</option> | |
1184 </para> | |
1185 </listitem> | |
1186 </varlistentry> | |
1187 | |
1188 <varlistentry> | |
1189 <term><option>--script=FILE</option></term> | |
1190 <term><option>-s</option></term> | |
1191 <listitem> | |
1192 <para> | |
1193 This option allows specifying a linking script to override the linker's | |
1194 built in defaults. | |
1195 </para> | |
1196 </listitem> | |
1197 </varlistentry> | |
1198 | |
1199 <varlistentry> | |
186 | 1200 <term><option>--section-base=SECT=BASE</option></term> |
1201 <listitem> | |
1202 <para> | |
1203 Cause section SECT to load at base address BASE. This will be prepended | |
1204 to the built-in link script. It is ignored if a link script is provided. | |
1205 </para> | |
1206 </listitem> | |
1207 </varlistentry> | |
1208 | |
1209 <varlistentry> | |
1210 <term><option>--map=FILE</option></term> | |
1211 <term><option>-m FILE</option></term> | |
1212 <listitem> | |
1213 <para> | |
1214 This will output a description of the link result to FILE. | |
1215 </para> | |
1216 </listitem> | |
1217 </varlistentry> | |
1218 | |
1219 <varlistentry> | |
1220 <term><option>--library=LIBSPEC</option></term> | |
1221 <term><option>-l LIBSPEC</option></term> | |
1222 <listitem> | |
1223 <para> | |
1224 Load a library using the library search path. LIBSPEC will have "lib" prepended | |
1225 and ".a" appended. | |
1226 </para> | |
1227 </listitem> | |
1228 </varlistentry> | |
1229 | |
1230 <varlistentry> | |
1231 <term><option>--library-path=DIR</option></term> | |
1232 <term><option>-L DIR</option></term> | |
1233 <listitem> | |
1234 <para> | |
1235 Add DIR to the library search path. | |
1236 </para> | |
1237 </listitem> | |
1238 </varlistentry> | |
1239 | |
1240 <varlistentry> | |
150 | 1241 <term><option>--debug</option></term> |
1242 <term><option>-d</option></term> | |
1243 <listitem> | |
1244 <para> | |
1245 This option increases the debugging level. It is only useful for LWTOOLS | |
1246 developers. | |
1247 </para> | |
1248 </listitem> | |
1249 </varlistentry> | |
1250 | |
1251 <varlistentry> | |
1252 <term><option>--help</option></term> | |
1253 <term><option>-?</option></term> | |
1254 <listitem> | |
1255 <para> | |
1256 This provides a listing of command line options and a brief description | |
1257 of each. | |
1258 </para> | |
1259 </listitem> | |
1260 </varlistentry> | |
1261 | |
1262 <varlistentry> | |
1263 <term><option>--usage</option></term> | |
1264 <listitem> | |
1265 <para> | |
1266 This will display a usage summary. | |
1267 of each. | |
1268 </para> | |
1269 </listitem> | |
1270 </varlistentry> | |
1271 | |
1272 | |
1273 <varlistentry> | |
1274 <term><option>--version</option></term> | |
1275 <term><option>-V</option></term> | |
1276 <listitem> | |
1277 <para> | |
1278 This will display the version of LWLINK. | |
1279 </para> | |
1280 </listitem> | |
1281 </varlistentry> | |
1282 | |
1283 </section> | |
1284 | |
1285 <section> | |
1286 <title>Linker Operation</title> | |
1287 | |
1288 <para> | |
175 | 1289 |
1290 LWLINK takes one or more files in supported input formats and links them | |
1291 into a single binary. Currently supported formats are the LWTOOLS object | |
1292 file format and the archive format used by LWAR. While the precise method is | |
1293 slightly different, linking can be conceptualized as the following steps. | |
1294 | |
150 | 1295 </para> |
1296 | |
1297 <orderedlist> | |
1298 <listitem> | |
1299 <para> | |
1300 First, the linker loads a linking script. If no script is specified, it | |
1301 loads a built-in default script based on the output format selected. This | |
1302 script tells the linker how to lay out the various sections in the final | |
1303 binary. | |
1304 </para> | |
1305 </listitem> | |
1306 | |
1307 <listitem> | |
1308 <para> | |
1309 Next, the linker reads all the input files into memory. At this time, it | |
1310 flags any format errors in those files. It constructs a table of symbols | |
1311 for each object at this time. | |
1312 </para> | |
1313 </listitem> | |
1314 | |
1315 <listitem> | |
1316 <para> | |
1317 The linker then proceeds with organizing the sections loaded from each file | |
1318 according to the linking script. As it does so, it is able to assign addresses | |
1319 to each symbol defined in each object file. At this time, the linker may | |
1320 also collapse different instances of the same section name into a single | |
1321 section by appending the data from each subsequent instance of the section | |
1322 to the first instance of the section. | |
1323 </para> | |
1324 </listitem> | |
1325 | |
1326 <listitem> | |
1327 <para> | |
1328 Next, the linker looks through every object file for every incomplete reference. | |
1329 It then attempts to fully resolve that reference. If it cannot do so, it | |
1330 throws an error. Once a reference is resolved, the value is placed into | |
1331 the binary code at the specified section. It should be noted that an | |
1332 incomplete reference can reference either a symbol internal to the object | |
1333 file or an external symbol which is in the export list of another object | |
1334 file. | |
1335 </para> | |
1336 </listitem> | |
1337 | |
1338 <listitem> | |
1339 <para> | |
1340 If all of the above steps are successful, the linker opens the output file | |
1341 and actually constructs the binary. | |
1342 </para> | |
1343 </listitem> | |
1344 </orderedlist> | |
1345 | |
1346 </section> | |
1347 | |
1348 <section | |
1349 <title>Linking Scripts</title> | |
1350 <para> | |
1351 A linker script is used to instruct the linker about how to assemble the | |
1352 various sections into a completed binary. It consists of a series of | |
1353 directives which are considered in the order they are encountered. | |
1354 </para> | |
1355 <para> | |
1356 The sections will appear in the resulting binary in the order they are | |
1357 specified in the script file. If a referenced section is not found, the linker will behave as though the | |
1358 section did exist but had a zero size, no relocations, and no exports. | |
1359 A section should only be referenced once. Any subsequent references will have | |
1360 an undefined effect. | |
1361 </para> | |
1362 | |
1363 <para> | |
1364 All numbers are in linking scripts are specified in hexadecimal. All directives | |
1365 are case sensitive although the hexadecimal numbers are not. | |
1366 </para> | |
1367 | |
1368 <para>A section name can be specified as a "*", then any section not | |
1369 already matched by the script will be matched. The "*" can be followed | |
1370 by a comma and a flag to narrow the section down slightly, also. | |
1371 If the flag is "!bss", then any section that is not flagged as a bss section | |
1372 will be matched. If the flag is "bss", then any section that is flagged as | |
1373 bss will be matched. | |
1374 </para> | |
1375 | |
1376 <para>The following directives are understood in a linker script.</para> | |
1377 <variablelist> | |
1378 <varlistentry> | |
1379 <term>section <parameter>name</parameter> load <parameter>addr</parameter></term> | |
1380 <listitem><para> | |
1381 | |
1382 This causes the section <parameter>name</parameter> to load at | |
1383 <parameter>addr</parameter>. For the raw target, only one "load at" entry is | |
1384 allowed for non-bss sections and it must be the first one. For raw targets, | |
1385 it affects the addresses the linker assigns to symbols but has no other | |
1386 affect on the output. bss sections may all have separate load addresses but | |
1387 since they will not appear in the binary anyway, this is okay. | |
1388 </para><para> | |
1389 For the decb target, each "load" entry will cause a new "block" to be | |
1390 output to the binary which will contain the load address. It is legal for | |
1391 sections to overlap in this manner - the linker assumes the loader will sort | |
1392 everything out. | |
1393 </para></listitem> | |
1394 </varlistentry> | |
1395 | |
1396 <varlistentry> | |
1397 <term>section <parameter>name</parameter></term> | |
1398 <listitem><para> | |
1399 | |
1400 This will cause the section <parameter>name</parameter> to load after the previously listed | |
1401 section. | |
1402 </para></listitem></varlistentry> | |
1403 <varlistentry> | |
1404 <term>exec <parameter>addr or sym</parameter></term> | |
1405 <listitem> | |
1406 <para> | |
1407 This will cause the execution address (entry point) to be the address | |
1408 specified (in hex) or the specified symbol name. The symbol name must | |
1409 match a symbol that is exported by one of the object files being linked. | |
1410 This has no effect for targets that do not encode the entry point into the | |
1411 resulting file. If not specified, the entry point is assumed to be address 0 | |
1412 which is probably not what you want. The default link scripts for targets | |
1413 that support this directive automatically starts at the beginning of the | |
1414 first section (usually "init" or "code") that is emitted in the binary. | |
1415 </para> | |
1416 </listitem> | |
1417 </varlistentry> | |
1418 | |
1419 <varlistentry> | |
1420 <term>pad <parameter>size</parameter></term> | |
1421 <listitem><para> | |
1422 This will cause the output file to be padded with NUL bytes to be exactly | |
1423 <parameter>size</parameter> bytes in length. This only makes sense for a raw target. | |
1424 </para> | |
1425 </listitem> | |
1426 </varlistentry> | |
1427 </variablelist> | |
1428 | |
1429 | |
1430 | |
1431 </section> | |
1432 | |
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
|
1433 </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
|
1434 |
175 | 1435 <chapter> |
1436 <title>Libraries and LWAR</title> | |
1437 | |
1438 <para> | |
1439 LWTOOLS also includes a tool for managing libraries. These are analogous to | |
1440 the static libraries created with the "ar" tool on POSIX systems. Each library | |
1441 file contains one or more object files. The linker will treat the object | |
1442 files within a library as though they had been specified individually on | |
1443 the command line except when resolving external references. External references | |
1444 are looked up first within the object files within the library and then, if | |
1445 not found, the usual lookup based on the order the files are specified on | |
1446 the command line occurs. | |
1447 </para> | |
1448 | |
1449 <para> | |
1450 The tool for creating these libary files is called LWAR. | |
1451 </para> | |
1452 | |
1453 <section> | |
1454 <title>Command Line Options</title> | |
1455 <para> | |
1456 The binary for LWAR is called "lwar". Note that the binary is in lower | |
1457 case. The options lwar understands are listed below. For archive manipulation | |
1458 options, the first non-option argument is the name of the archive. All other | |
1459 non-option arguments are the names of files to operate on. | |
1460 </para> | |
1461 | |
1462 <variablelist> | |
1463 <varlistentry> | |
1464 <term><option>--add</option></term> | |
1465 <term><option>-a</option></term> | |
1466 <listitem> | |
1467 <para> | |
1468 This option specifies that an archive is going to have files added to it. | |
1469 If the archive does not already exist, it is created. New files are added | |
1470 to the end of the archive. | |
1471 </para> | |
1472 </listitem> | |
1473 </varlistentry> | |
1474 | |
1475 <varlistentry> | |
1476 <term><option>--create</option></term> | |
1477 <term><option>-c</option></term> | |
1478 <listitem> | |
1479 <para> | |
1480 This option specifies that an archive is going to be created and have files | |
1481 added to it. If the archive already exists, it is truncated. | |
1482 </para> | |
1483 </listitem> | |
1484 </varlistentry> | |
1485 | |
1486 <varlistentry> | |
1487 <term><option>--merge</option></term> | |
1488 <term><option>-m</option></term> | |
1489 <listitem> | |
1490 <para> | |
1491 If specified, any files specified to be added to an archive will be checked | |
1492 to see if they are archives themselves. If so, their constituent members are | |
1493 added to the archive. This is useful for avoiding archives containing archives. | |
1494 </para> | |
1495 </listitem> | |
1496 </varlistentry> | |
1497 | |
1498 <varlistentry> | |
1499 <term><option>--list</option></term> | |
1500 <term><option>-l</option></term> | |
1501 <listitem> | |
1502 <para> | |
1503 This will display a list of the files contained in the archive. | |
1504 </para> | |
1505 </listitem> | |
1506 </varlistentry> | |
1507 | |
1508 <varlistentry> | |
1509 <term><option>--debug</option></term> | |
1510 <term><option>-d</option></term> | |
1511 <listitem> | |
1512 <para> | |
1513 This option increases the debugging level. It is only useful for LWTOOLS | |
1514 developers. | |
1515 </para> | |
1516 </listitem> | |
1517 </varlistentry> | |
1518 | |
1519 <varlistentry> | |
1520 <term><option>--help</option></term> | |
1521 <term><option>-?</option></term> | |
1522 <listitem> | |
1523 <para> | |
1524 This provides a listing of command line options and a brief description | |
1525 of each. | |
1526 </para> | |
1527 </listitem> | |
1528 </varlistentry> | |
1529 | |
1530 <varlistentry> | |
1531 <term><option>--usage</option></term> | |
1532 <listitem> | |
1533 <para> | |
1534 This will display a usage summary. | |
1535 of each. | |
1536 </para> | |
1537 </listitem> | |
1538 </varlistentry> | |
1539 | |
1540 | |
1541 <varlistentry> | |
1542 <term><option>--version</option></term> | |
1543 <term><option>-V</option></term> | |
1544 <listitem> | |
1545 <para> | |
1546 This will display the version of LWLINK. | |
1547 of each. | |
1548 </para> | |
1549 </listitem> | |
1550 </varlistentry> | |
1551 | |
1552 </section> | |
1553 | |
1554 </chapter> | |
1555 | |
109 | 1556 <chapter id="objchap"> |
1557 <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
|
1558 <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
|
1559 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
|
1560 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
|
1561 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
|
1562 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
|
1563 </para> |
150 | 1564 |
1565 <para> | |
1566 An object file consists of a series of sections each of which contains a | |
1567 list of exported symbols, a list of incomplete references, and a list of | |
1568 "local" symbols which may be used in calculating incomplete references. Each | |
1569 section will obviously also contain the object code. | |
1570 </para> | |
1571 | |
1572 <para> | |
1573 Exported symbols must be completely resolved to an address within the | |
1574 section it is exported from. That is, an exported symbol must be a constant | |
1575 rather than defined in terms of other symbols.</para> | |
1576 | |
1577 <para> | |
1578 Each object file starts with a magic number and version number. The magic | |
1579 number is the string "LWOBJ16" for this 16 bit object file format. The only | |
1580 defined version number is currently 0. Thus, the first 8 bytes of the object | |
1581 file are <code>4C574F424A313600</code> | |
1582 </para> | |
1583 | |
1584 <para> | |
1585 Each section has the following items in order: | |
1586 </para> | |
1587 | |
1588 <itemizedlist> | |
1589 <listitem><para>section name</para></listitem> | |
1590 <listitem><para>flags</para></listitem> | |
1591 <listitem><para>list of local symbols (and addresses within the section)</para></listitem> | |
1592 <listitem><para>list of exported symbols (and addresses within the section)</para></listitem> | |
1593 <listitem><para>list of incomplete references along with the expressions to calculate them</para></listitem> | |
1594 <listitem><para>the actual object code (for non-BSS sections)</para></listitem> | |
1595 </itemizedlist> | |
1596 | |
1597 <para> | |
1598 The section starts with the name of the section with a NUL termination | |
1599 followed by a series of flag bytes terminated by NUL. There are only two | |
1600 flag bytes defined. A NUL (0) indicates no more flags and a value of 1 | |
1601 indicates the section is a BSS section. For a BSS section, no actual | |
1602 code is included in the object file. | |
1603 </para> | |
1604 | |
1605 <para> | |
1606 Either a NULL section name or end of file indicate the presence of no more | |
1607 sections. | |
1608 </para> | |
1609 | |
1610 <para> | |
1611 Each entry in the exported and local symbols table consists of the symbol | |
1612 (NUL terminated) followed by two bytes which contain the value in big endian | |
1613 order. The end of a symbol table is indicated by a NULL symbol name. | |
1614 </para> | |
1615 | |
1616 <para> | |
1617 Each entry in the incomplete references table consists of an expression | |
1618 followed by a 16 bit offset where the reference goes. Expressions are | |
1619 defined as a series of terms up to an "end of expression" term. Each term | |
1620 consists of a single byte which identifies the type of term (see below) | |
1621 followed by any data required by the term. Then end of the list is flagged | |
1622 by a NULL expression (only an end of expression term). | |
1623 </para> | |
1624 | |
1625 <table frame="all"><title>Object File Term Types</title> | |
1626 <tgroup cols="2"> | |
1627 <thead> | |
1628 <row> | |
1629 <entry>TERMTYPE</entry> | |
1630 <entry>Meaning</entry> | |
1631 </row> | |
1632 </thead> | |
1633 <tbody> | |
1634 <row> | |
1635 <entry>00</entry> | |
1636 <entry>end of expression</entry> | |
1637 </row> | |
1638 | |
1639 <row> | |
1640 <entry>01</entry> | |
1641 <entry>integer (16 bit in big endian order follows)</entry> | |
1642 </row> | |
1643 <row> | |
1644 <entry>02</entry> | |
1645 <entry> external symbol reference (NUL terminated symbol name follows)</entry> | |
1646 </row> | |
1647 | |
1648 <row> | |
1649 <entry>03</entry> | |
1650 <entry>local symbol reference (NUL terminated symbol name follows)</entry> | |
1651 </row> | |
1652 | |
1653 <row> | |
1654 <entry>04</entry> | |
1655 <entry>operator (1 byte operator number)</entry> | |
1656 </row> | |
1657 <row> | |
1658 <entry>05</entry> | |
1659 <entry>section base address reference</entry> | |
1660 </row> | |
1661 </tbody> | |
1662 </tgroup> | |
1663 </table> | |
1664 | |
1665 <para> | |
1666 External references are resolved using other object files while local | |
1667 references are resolved using the local symbol table(s) from this file. This | |
1668 allows local symbols that are not exported to have the same names as | |
1669 exported symbols or external references. | |
1670 </para> | |
1671 | |
1672 <table frame="all"><title>Object File Operator Numbers</title> | |
1673 <tgroup cols="2"> | |
1674 <thead> | |
1675 <row> | |
1676 <entry>Number</entry> | |
1677 <entry>Operator</entry> | |
1678 </row> | |
1679 </thead> | |
1680 <tbody> | |
1681 <row> | |
1682 <entry>01</entry> | |
1683 <entry>addition (+)</entry> | |
1684 </row> | |
1685 <row> | |
1686 <entry>02</entry> | |
1687 <entry>subtraction (-)</entry> | |
1688 </row> | |
1689 <row> | |
1690 <entry>03</entry> | |
1691 <entry>multiplication (*)</entry> | |
1692 </row> | |
1693 <row> | |
1694 <entry>04</entry> | |
1695 <entry>division (/)</entry> | |
1696 </row> | |
1697 <row> | |
1698 <entry>05</entry> | |
1699 <entry>modulus (%)</entry> | |
1700 </row> | |
1701 <row> | |
1702 <entry>06</entry> | |
1703 <entry>integer division (\) (same as division)</entry> | |
1704 </row> | |
1705 | |
1706 <row> | |
1707 <entry>07</entry> | |
1708 <entry>bitwise and</entry> | |
1709 </row> | |
1710 | |
1711 <row> | |
1712 <entry>08</entry> | |
1713 <entry>bitwise or</entry> | |
1714 </row> | |
1715 | |
1716 <row> | |
1717 <entry>09</entry> | |
1718 <entry>bitwise xor</entry> | |
1719 </row> | |
1720 | |
1721 <row> | |
1722 <entry>0A</entry> | |
1723 <entry>boolean and</entry> | |
1724 </row> | |
1725 | |
1726 <row> | |
1727 <entry>0B</entry> | |
1728 <entry>boolean or</entry> | |
1729 </row> | |
1730 | |
1731 <row> | |
1732 <entry>0C</entry> | |
1733 <entry>unary negation, 2's complement (-)</entry> | |
1734 </row> | |
1735 | |
1736 <row> | |
1737 <entry>0D</entry> | |
1738 <entry>unary 1's complement (^)</entry> | |
1739 </row> | |
1740 </tbody> | |
1741 </tgroup> | |
1742 </table> | |
1743 | |
1744 <para> | |
1745 An expression is represented in a postfix manner with both operands for | |
1746 binary operators preceding the operator and the single operand for unary | |
1747 operators preceding the operator. | |
1748 </para> | |
1749 | |
109 | 1750 </chapter> |
1751 </book> | |
1752 |