annotate doc/manual.docbook.sgml @ 229:59a138df0401

Fixed additional parsing problems with pseudo ops
author lost
date Fri, 12 Jun 2009 01:31:18 +0000
parents 4c60c3a09597
children 10abe422efce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
f21a5593a661 Updated docs
lost
parents:
diff changeset
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.5//EN">
f21a5593a661 Updated docs
lost
parents:
diff changeset
2 <book>
f21a5593a661 Updated docs
lost
parents:
diff changeset
3 <bookinfo>
f21a5593a661 Updated docs
lost
parents:
diff changeset
4 <title>LW Tool Chain</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
5 <author><firstname>William</firstname><surname>Astle</surname></author>
f21a5593a661 Updated docs
lost
parents:
diff changeset
6 <copyright><year>2009</year><holder>William Astle</holder></copyright>
f21a5593a661 Updated docs
lost
parents:
diff changeset
7 </bookinfo>
f21a5593a661 Updated docs
lost
parents:
diff changeset
8 <chapter>
f21a5593a661 Updated docs
lost
parents:
diff changeset
9
f21a5593a661 Updated docs
lost
parents:
diff changeset
10 <title>Introduction</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
11
f21a5593a661 Updated docs
lost
parents:
diff changeset
12 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
13 The LW tool chain provides utilities for building binaries for MC6809 and
f21a5593a661 Updated docs
lost
parents:
diff changeset
14 HD6309 CPUs. The tool chain includes a cross-assembler and a cross-linker
f21a5593a661 Updated docs
lost
parents:
diff changeset
15 which support several styles of output.
f21a5593a661 Updated docs
lost
parents:
diff changeset
16 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
17
f21a5593a661 Updated docs
lost
parents:
diff changeset
18 <section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
19 <title>History</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
20 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
21 For a long time, I have had an interest in creating an operating system for
f21a5593a661 Updated docs
lost
parents:
diff changeset
22 the Coco3. I finally started working on that project around the beginning of
f21a5593a661 Updated docs
lost
parents:
diff changeset
23 2006. I had a number of assemblers I could choose from. Eventually, I settled
f21a5593a661 Updated docs
lost
parents:
diff changeset
24 on one and started tinkering. After a while, I realized that assembler was not
f21a5593a661 Updated docs
lost
parents:
diff changeset
25 going to be sufficient due to lack of macros and issues with forward references.
f21a5593a661 Updated docs
lost
parents:
diff changeset
26 Then I tried another which handled forward references correctly but still did
f21a5593a661 Updated docs
lost
parents:
diff changeset
27 not support macros. I looked around at other assemblers and they all lacked
f21a5593a661 Updated docs
lost
parents:
diff changeset
28 one feature or another that I really wanted for creating my operating system.
f21a5593a661 Updated docs
lost
parents:
diff changeset
29 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
30
f21a5593a661 Updated docs
lost
parents:
diff changeset
31 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
32 The solution seemed clear at that point. I am a fair programmer so I figured
f21a5593a661 Updated docs
lost
parents:
diff changeset
33 I could write an assembler that would do everything I wanted an assembler to
f21a5593a661 Updated docs
lost
parents:
diff changeset
34 do. Thus the LWASM probject was born. After more than two years of on and off
f21a5593a661 Updated docs
lost
parents:
diff changeset
35 work, version 1.0 of LWASM was released in October of 2008.
f21a5593a661 Updated docs
lost
parents:
diff changeset
36 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
37
f21a5593a661 Updated docs
lost
parents:
diff changeset
38 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
39 As the aforementioned operating system project progressed further, it became
f21a5593a661 Updated docs
lost
parents:
diff changeset
40 clear that while assembling the whole project through a single file was doable,
f21a5593a661 Updated docs
lost
parents:
diff changeset
41 it was not practical. When I found myself playing some fancy games with macros
f21a5593a661 Updated docs
lost
parents:
diff changeset
42 in a bid to simulate sections, I realized I needed a means of assembling
f21a5593a661 Updated docs
lost
parents:
diff changeset
43 source files separately and linking them later. This spawned a major development
f21a5593a661 Updated docs
lost
parents:
diff changeset
44 effort to add an object file support to LWASM. It also spawned the LWLINK
f21a5593a661 Updated docs
lost
parents:
diff changeset
45 project to provide a means to actually link the files.
f21a5593a661 Updated docs
lost
parents:
diff changeset
46 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
47
f21a5593a661 Updated docs
lost
parents:
diff changeset
48 </section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
49
f21a5593a661 Updated docs
lost
parents:
diff changeset
50 </chapter>
f21a5593a661 Updated docs
lost
parents:
diff changeset
51
f21a5593a661 Updated docs
lost
parents:
diff changeset
52 <chapter>
f21a5593a661 Updated docs
lost
parents:
diff changeset
53 <title>Output Formats</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
54
f21a5593a661 Updated docs
lost
parents:
diff changeset
55 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
56 The LW tool chain supports multiple output formats. Each format has its
f21a5593a661 Updated docs
lost
parents:
diff changeset
57 advantages and disadvantages. Each format is described below.
f21a5593a661 Updated docs
lost
parents:
diff changeset
58 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
59
f21a5593a661 Updated docs
lost
parents:
diff changeset
60 <section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
61 <title>Raw Binaries</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
62 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
63 A raw binary is simply a string of bytes. There are no headers or other
f21a5593a661 Updated docs
lost
parents:
diff changeset
64 niceties. Both LWLINK and LWASM support generating raw binaries. ORG directives
f21a5593a661 Updated docs
lost
parents:
diff changeset
65 in the source code only serve to set the addresses that will be used for
f21a5593a661 Updated docs
lost
parents:
diff changeset
66 symbols but otherwise have no direct impact on the resulting binary.
f21a5593a661 Updated docs
lost
parents:
diff changeset
67 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
68
f21a5593a661 Updated docs
lost
parents:
diff changeset
69 </section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
70 <section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
71 <title>DECB Binaries</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
72
f21a5593a661 Updated docs
lost
parents:
diff changeset
73 <para>A DECB binary is compatible with the LOADM command in Disk Extended
f21a5593a661 Updated docs
lost
parents:
diff changeset
74 Color Basic on the CoCo. They are also compatible with CLOADM from Extended
f21a5593a661 Updated docs
lost
parents:
diff changeset
75 Color Basic. These binaries include the load address of the binary as well
f21a5593a661 Updated docs
lost
parents:
diff changeset
76 as encoding an execution address. These binaries may contain multiple loadable
f21a5593a661 Updated docs
lost
parents:
diff changeset
77 sections, each of which has its own load address.</para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
78
f21a5593a661 Updated docs
lost
parents:
diff changeset
79 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
80 Each binary starts with a preamble. Each preamble is five bytes long. The
f21a5593a661 Updated docs
lost
parents:
diff changeset
81 first byte is zero. The next two bytes specify the number of bytes to load
f21a5593a661 Updated docs
lost
parents:
diff changeset
82 and the last two bytes specify the address to load the bytes at. Then, a
f21a5593a661 Updated docs
lost
parents:
diff changeset
83 string of bytes follows. After this string of bytes, there may be another
f21a5593a661 Updated docs
lost
parents:
diff changeset
84 preamble or a postamble. A postamble is also five bytes in length. The first
f21a5593a661 Updated docs
lost
parents:
diff changeset
85 byte of the postamble is $FF, the next two are zero, and the last two are
f21a5593a661 Updated docs
lost
parents:
diff changeset
86 the execution address for the binary.
f21a5593a661 Updated docs
lost
parents:
diff changeset
87 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
88
f21a5593a661 Updated docs
lost
parents:
diff changeset
89 <para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
90 Both LWASM and LWLINK can output this format.
f21a5593a661 Updated docs
lost
parents:
diff changeset
91 </para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
92 </section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
93
f21a5593a661 Updated docs
lost
parents:
diff changeset
94 <section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
95 <title>Object Files</title>
f21a5593a661 Updated docs
lost
parents:
diff changeset
96 <para>LWASM supports generating a proprietary object file format which is
f21a5593a661 Updated docs
lost
parents:
diff changeset
97 described in <xref linkend="objchap">. LWLINK is then used to link these
f21a5593a661 Updated docs
lost
parents:
diff changeset
98 object files into a final binary in any of LWLINK's supported binary
f21a5593a661 Updated docs
lost
parents:
diff changeset
99 formats.</para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
100
f21a5593a661 Updated docs
lost
parents:
diff changeset
101 <para>Object files also support the concept of sections which are not valid
f21a5593a661 Updated docs
lost
parents:
diff changeset
102 for other output types. This allows related code from each object file
f21a5593a661 Updated docs
lost
parents:
diff changeset
103 linked to be collapsed together in the final binary.</para>
f21a5593a661 Updated docs
lost
parents:
diff changeset
104
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
105 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
106 Object files are very flexible in that they allow references that are not
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
107 known at assembly time to be resolved at link time. However, because the
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
108 addresses of such references are not known at assembly time, there is no way
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
109 for the assembler to deduce that an eight bit addressing mode is possible.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
110 That means the assember will default to using sixteen bit addressing
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
111 whenever an external or cross-section reference is used.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
112 </para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
113
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
114 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
115 As of LWASM 2.4, it is possible to force direct page addressing for an
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
116 external reference. Care must be taken to ensure the resulting addresses
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
117 are really in the direct page since the linker does not know what the direct
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
118 page is supposed to be and does not emit errors for byte overflows.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
119 </para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
120
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
121 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
122 It is also possible to use external references in an eight bit immediate
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
123 mode instruction. In this case, only the low order eight bits will be used.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
124 Again, no byte overflows will be flagged.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
125 </para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
126
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
127
109
f21a5593a661 Updated docs
lost
parents:
diff changeset
128 </section>
f21a5593a661 Updated docs
lost
parents:
diff changeset
129
f21a5593a661 Updated docs
lost
parents:
diff changeset
130 </chapter>
f21a5593a661 Updated docs
lost
parents:
diff changeset
131
145
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
132 <chapter>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
133 <title>LWASM</title>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
134 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
135 The LWTOOLS assembler is called LWASM. This chapter documents the various
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
136 features of the assembler. It is not, however, a tutorial on 6x09 assembly
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
137 language programming.
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
138 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
139
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
140 <section>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
141 <title>Command Line Options</title>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
142 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
143 The binary for LWASM is called "lwasm". Note that the binary is in lower
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
144 case. lwasm takes the following command line arguments.
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
145 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
146
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
147 <variablelist>
afe30454382f Made development 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 <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
149 <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
150 <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
151 <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
152 <para>
afe30454382f Made development 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 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
154 </para>
afe30454382f Made development 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 </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
156 </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
157
afe30454382f Made development 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 <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
159 <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
160 <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
161 <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
162 <para>
afe30454382f Made development 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 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
164 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
165 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
166 </para>
afe30454382f Made development 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 </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
168 </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
169
afe30454382f Made development 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 <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
171 <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
172 <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
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 <para>
afe30454382f Made development 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 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
176 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
177 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
178 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
179 </listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
180 </varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
181
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
182 <varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
183 <term><option>--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
184 <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
185 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
186 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
187 </para>
afe30454382f Made development 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 </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
189 </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
190
afe30454382f Made development 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 <varlistentry>
150
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
192 <term><option>--output=FILE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
193 <term><option>-o FILE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
194 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
195 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
196 This option specifies the name of the output file. If not specified, the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
197 default is <option>a.out</option>.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
198 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
199 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
200 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
201
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
202 <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
203 <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
204 <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
205 <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
206 <para>
afe30454382f Made development 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 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
208 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
209 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
210 </para>
afe30454382f Made development 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 </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
212 </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
213
afe30454382f Made development 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 <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
215 <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
216 <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
217 <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
218 <para>
afe30454382f Made development 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 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
220 </para>
afe30454382f Made development 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 </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
223
afe30454382f Made development 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 <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
225 <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
226 <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
227 <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
228 <para>
afe30454382f Made development 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 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
230 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
231 </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 </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
233
afe30454382f Made development 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 <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
235 <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
236 <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
237 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
238 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
239 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
240 </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
241 </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
242
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
243 <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
244 <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
245 <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
246 <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
247 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
248 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
249 </para>
afe30454382f Made development 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 </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
251 </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
252
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
253 <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
254 <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
255 <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
256 <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
257 <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
258 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
259 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
260 </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
261 </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
262 </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
263
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
264 </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
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 </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
267
afe30454382f Made development 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 <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
269 <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
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 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
272 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
273 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
274 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
275 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
276 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
277 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
278 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
279 </para>
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
283 hash sign ("#") for immediate mode, the less than sign ("&lt;") 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
284 eight bit modes, and the greater than sign ("&gt;") 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
285 </para>
afe30454382f Made development 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
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
287 <para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
288 Additionally, LWASM supports using the asterisk ("*") to indicate
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
289 base page addressing. This should not be used in hand-written source code,
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
290 however, because it is non-standard and may or may not be present in future
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
291 versions of LWASM.
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
292 </para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
293
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
294 </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
295
afe30454382f Made development 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 <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
297 <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
298
afe30454382f Made development 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 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
301 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
302 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
303 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
304 <para>
afe30454382f Made development 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 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
306 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
307 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
308 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
309 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
310 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
311 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
312 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
313 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
314 <para>
afe30454382f Made development 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 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
316 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
317 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
318 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
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 <para>
175
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
322 For compatibility with the output generated by some C preprocessors, LWASM
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
323 will also ignore lines that begin with a #. This should not be used as a general
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
324 comment character, however.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
325 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
326
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
327 <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
328 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
329 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
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 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
334 </para>
afe30454382f Made development 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
afe30454382f Made development 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 </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
337
afe30454382f Made development 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 <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
339 <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
340
afe30454382f Made development 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 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
343 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
344 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
345 </para>
afe30454382f Made development 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
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
347 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
348 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
349 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
350 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
351 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
352 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
353 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
354 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
355 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
356 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
357
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
358 </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
359
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
360 <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
361 <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
362 <para>
175
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
363
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
364 Numbers can be expressed in binary, octal, decimal, or hexadecimal. Binary
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
365 numbers may be prefixed with a "%" symbol or suffixed with a "b" or "B".
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
366 Octal numbers may be prefixed with "@" or suffixed with "Q", "q", "O", or
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
367 "o". Hexadecimal numbers may be prefixed with "$", "0x" or "0X", or suffixed
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
368 with "H". No prefix or suffix is required for decimal numbers but they can
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
369 be prefixed with "&amp;" if desired. Any constant which begins with a letter
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
370 must be expressed with the correct prefix base identifier or be prefixed
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
371 with a 0. Thus hexadecimal FF would have to be written either 0FFH or $FF.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
372 Numbers are not case sensitive.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
373
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
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> 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
377 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
378 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
379
afe30454382f Made development 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>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
381 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
382 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
383
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
384 <para>
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
385
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
386 LWASM supports the following basic binary operators: +, -, *, /, and %.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
387 These represent addition, subtraction, multiplication, division, and
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
388 modulus. It also supports unary negation and unary 1's complement (- and ^
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
389 respectively). It is also possible to use ~ for the unary 1's complement
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
390 operator. For completeness, a unary positive (+) is supported though it is
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
391 a no-op. LWASM also supports using |, &, and ^ for bitwise or, bitwise and,
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
392 and bitwise exclusive or respectively.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
393
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
394 </para>
afe30454382f Made development 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
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
396 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
397
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
398 Operator precedence follows the usual rules. Multiplication, division, and
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
399 modulus take precedence over addition and subtraction. Unary operators take
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
400 precedence over binary operators. Bitwise operators are lower precdence
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
401 than addition and subtraction. To force a specific order of evaluation,
145
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
402 parentheses can be used in the usual manner.
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
403
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
404 </para>
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
405
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
406 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
407
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
408 As of LWASM 2.5, the operators && and || are recognized for boolean and and
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
409 boolean or respectively. They will return either 0 or 1 (false or true).
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
410 They have the lowest precedence of all the binary operators.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
411
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
412 </para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
413
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
414 </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
415
afe30454382f Made development 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 <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
417 <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
418 <para>
afe30454382f Made development 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 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
420 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
421 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
422 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
423 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
424
afe30454382f Made development 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 <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
426 <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
427 <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
428 <varlistentry><term>FCB <parameter>expr[,...]</parameter></term>
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
429 <term>.DB <parameter>expr[,...]</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
430 <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
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 <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
433 </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
434 </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
435
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
436 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
437 <term>FDB <parameter>expr[,...]</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
438 <term>.DW <parameter>expr[,...]</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
439 <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
440 <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
441 <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
442 </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
443 </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
444
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
445 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
446 <term>FQB <parameter>expr[,...]</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
447 <term>.QUAD <parameter>expr[,...]</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
448 <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
449 <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
450 <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
451 </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
452 </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
453
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
454 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
455 <term>FCC <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
456 <term>.ASCII <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
457 <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
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 <para>
afe30454382f Made development 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 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
461 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
462 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
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 </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
465 </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
466
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
467 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
468 <term>FCN <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
469 <term>.ASCIZ <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
470 <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
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 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
474 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
475 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
476 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
477 </para>
afe30454382f Made development 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 </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
479 </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
480
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
481 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
482 <term>FCS <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
483 <term>.ASCIS <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
484 <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
485 <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
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 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
488 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
489 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
490 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
491 </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
492 </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
493
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
494 <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
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 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
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 </para>
afe30454382f Made development 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 </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
501 </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
502
afe30454382f Made development 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 <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
504 <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
505 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
506 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
507 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
508 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
509 </para>
afe30454382f Made development 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 </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
511 </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
512
afe30454382f Made development 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 <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
514 <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
515 <para>
afe30454382f Made development 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 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
517 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
518 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
519 </para>
afe30454382f Made development 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 </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
521 </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
522
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
523 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
524 <term>RMB <parameter>expr</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
525 <term>.BLKB <parameter>expr</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
526 <term>.DS <parameter>expr</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
527 <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
528 <listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
529 <para>
afe30454382f Made development 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 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
531 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
532 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
533 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
534 </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 </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
536
afe30454382f Made development 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 <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
538 <listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
539 <para>
afe30454382f Made development 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 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
541 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
542 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
543 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
544 </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
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
afe30454382f Made development 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 <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
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>
afe30454382f Made development 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 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
551 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
552 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
553 </para>
afe30454382f Made development 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 </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
555 </varlistentry>
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
556
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
557 <varlistentry>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
558 <term>INCLUDEBIN <parameter>filename</parameter></term>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
559 <listitem>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
560 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
561 Treat the contents of <parameter>filename</parameter> as a string of bytes to
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
562 be included literally at the current assembly point. This has the same effect
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
563 as converting the file contents to a series of FCB statements and including
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
564 those at the current assembly point.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
565 </para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
566 </listitem>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
567 </varlistentry>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
568
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
569 </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
570
afe30454382f Made development 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 </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
572
afe30454382f Made development 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 <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
574 <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
575 <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
576 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
577
afe30454382f Made development 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 <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
579 <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
580 <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
581 <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
582 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
583 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
584 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
585 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
586 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
587 </para>
afe30454382f Made development 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 </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
589 </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
590
afe30454382f Made development 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 <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
592 <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
593 <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
594 <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
595 <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
596 </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
597 </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
598
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
599 <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
600 <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
601 <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
602 <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
603 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
604 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
605 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
606 </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
607 </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
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 <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
610 <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
611 <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
612 <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
613 <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
614 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
615 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
616 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
617 </para>
afe30454382f Made development 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 <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
619 </para>
afe30454382f Made development 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 </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
621 </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
622
afe30454382f Made development 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 <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
624 <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
625 <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
626 <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
627 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
628 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
629 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
630 <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
631 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
632 </para>
afe30454382f Made development 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 </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
634 </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
635
afe30454382f Made development 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 </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
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 </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
639
afe30454382f Made development 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 <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
641 <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
642 <para>
afe30454382f Made development 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 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
644 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
645 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
646 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
647 <para>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
648 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
649 </para>
afe30454382f Made development 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>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
651 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
652 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
653 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
654
afe30454382f Made development 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 <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
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>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
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 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>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
667 <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
668 <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
669 <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
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>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
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>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
679 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
680 </para>
afe30454382f Made development 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 </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
682 </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
683
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
684 <varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
685 <term>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
686 <listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
687 <para>If <parameter>expr</parameter> evaluates to 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
688 will be considered true.
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
689 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
690 </listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
691 </varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
692
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
693 <varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
694 <term>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
695 <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
696 <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
697 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
698 </para>
afe30454382f Made development 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 </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
700 </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
701
afe30454382f Made development 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 <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
703 <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
704 <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
705 <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
706 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
707 </para>
afe30454382f Made development 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 </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
709 </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
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 <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
712 <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
713 <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
714 <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
715 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
716 will be considered true.
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
717 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
718 </listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
719 </varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
720
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
721 <varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
722 <term>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
723 <listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
724 <para>If <parameter>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
725 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
726 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
727 </para>
afe30454382f Made development 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 </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
729 </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
730
afe30454382f Made development 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 <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
732 <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
733 <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
734 <para>
afe30454382f Made development 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 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
736 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
737 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
738 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
739 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
740 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
741 </para>
afe30454382f Made development 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 </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
743
afe30454382f Made development 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 <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
745 <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
746 <listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
747 <para>
afe30454382f Made development 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 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
749 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
750 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
751 </listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
752 </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
753
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
754 </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
755 </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
756
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
757 <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
758 <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
759
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
760 <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
761 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
762
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
763 <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
764
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
765 <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
766 <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
767 <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
768 <para>
afe30454382f Made development 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 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
770 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
771 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
772 </para>
afe30454382f Made development 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 </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
774 </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
775
afe30454382f Made development 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 <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
777 <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
778 <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
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 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
781 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
782 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
783 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
784 </para>
afe30454382f Made development 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 </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
786 </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
787
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
788 <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
789 <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
790 <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
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 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
793 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
794 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
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 </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
797 </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
798
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
799 <varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
800 <term>.MODULE <parameter>string</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
801 <listitem>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
802 <para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
803 This directive is ignored for most output targets. If the output target
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
804 supports encoding a module name into it, <parameter>string</parameter>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
805 will be used as the module name.
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
806 </para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
807 <para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
808 As of version 2.2, no supported output targets support this directive.
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
809 </para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
810 </listitem>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
811 </varlistentry>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
812
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
813 </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
814 </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
815
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
816 </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
817
afe30454382f Made development 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 <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
819 <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
820 <para>
afe30454382f Made development 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 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
822 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
823 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
824 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
825 </para>
afe30454382f Made development 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 <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
827 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
828 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
829 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
830 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
831 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
832 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
833 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
834 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
835 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
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 <para>
afe30454382f Made development 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 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
839 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
840 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
841 </para>
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
844 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
845 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
846 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
847
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
848 <para>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
849 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
850 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
851 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
852 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
853 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
854 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
855 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
856 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
857 </para>
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
860 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
861 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
862 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
863 </para>
afe30454382f Made development 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
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
865 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
866 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
867 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
868 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
869 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
870
afe30454382f Made development 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 <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
872
afe30454382f Made development 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 <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
874 <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
875 <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
876 <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
877 <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
878 <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
879 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
880 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
881 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
882 </para>
afe30454382f Made development 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 </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
884 </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
885
afe30454382f Made development 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 <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
887 <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
888 <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
889 <para>
afe30454382f Made development 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 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
891 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
892 </para>
afe30454382f Made development 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 </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
894 </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
895
afe30454382f Made development 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 </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
897
afe30454382f Made development 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 <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
899 <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
900 <para>
afe30454382f Made development 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 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
902 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
903 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
904 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
905 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
906 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
907 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
908 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
909 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
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
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
914 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
915 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
916 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
917 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
918 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
919 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
920 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
921 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
922 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
923 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
924 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
925 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
926 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
927 </para>
afe30454382f Made development 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
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
931 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
932 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
933 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
934 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
935 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
936 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
937 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
938
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
941 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
942 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
943 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
944 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
945 </para>
afe30454382f Made development 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
afe30454382f Made development 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 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
949 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
950 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
951 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
952 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
953 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
954 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
955
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
956 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
957 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
958 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
959 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
960 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
961 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
962 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
963 </para>
afe30454382f Made development 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 <para>
afe30454382f Made development 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 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
967 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
968 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
969 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
970 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
971 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
972 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
973 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
974 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
975 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
976 </para>
afe30454382f Made development 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
afe30454382f Made development 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 <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
979
afe30454382f Made development 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 <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
981 <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
982 <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
983 <term>SECT <parameter>name[,flags]</parameter></term>
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
984 <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
985 <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
986 <para>
afe30454382f Made development 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 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
988 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
989 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
990 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
991 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
992 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
993 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
994 <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
995 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
996 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
997 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
998 <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
999 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
1000 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
1001 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
1002 </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
1003 <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
1004 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
1005 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
1006 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
1007 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1008 </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
1009 </varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1010
afe30454382f Made development 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 <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
1012 <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
1013 <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
1014 <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
1015 <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
1016 <para>
afe30454382f Made development 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 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
1018 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
1019 </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
1020 </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
1021
afe30454382f Made development 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 <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
1023 <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
1024 <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
1025 <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
1026 <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
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 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
1029 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
1030 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
1031 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
1032 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
1033 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
1034 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
1035 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1036 </listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1037 </varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1038
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1039 <varlistentry>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1040 <term><parameter>sym</parameter> EXPORT</term>
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1041 <term><parameter>sym</parameter> .GLOBL</term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1042
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1043 <term>EXPORT <parameter>sym</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1044 <term>.GLOBL <parameter>sym</parameter></term>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1045
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
1046 <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
1047 <para>
afe30454382f Made development 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 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
1049 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
1050 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
1051 </para>
167
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1052 <para>
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1053 Note that <parameter>sym</parameter> may appear as the operand or as the
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1054 statement's symbol. If there is a symbol on the statement, that will
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1055 take precedence over any operand that is present.
751b99efb1fc Updated docs
lost
parents: 159
diff changeset
1056 </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
1057 </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
1058 </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
1059
afe30454382f Made development 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 </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
1063
afe30454382f Made development 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 <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
1065 <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
1066 <para>
afe30454382f Made development 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 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
1068 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
1069 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
1070 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
1071 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
1072 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
1073 </para>
afe30454382f Made development 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
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1075 <para>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
1076 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
1077 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
1078 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
1079 </para>
afe30454382f Made development 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
afe30454382f Made development 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 <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
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 <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
1084 <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
1085 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1086 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
1087 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
1088 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
1089 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
1090 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1091 </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
1092 </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
1093
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1094 <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
1095 <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
1096 <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
1097 <para>
afe30454382f Made development 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 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
1099 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
1100 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
1101 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
1102 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
1103 </para>
afe30454382f Made development 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 </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
1105 </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
1106 </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
1107
afe30454382f Made development 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>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
1109 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
1110 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
1111 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
1112 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
1113
afe30454382f Made development 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 <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
1115
afe30454382f Made development 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 <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
1117 <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
1118 <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
1119 <listitem>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1120 <para>
afe30454382f Made development 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 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
1122 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
1123 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
1124 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
1125 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
1126 </para>
afe30454382f Made development 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 </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
1128 </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
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 <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
1131 <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
1132 <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
1133 <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
1134 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
1135 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
1136 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
1137 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
1138 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
1139 </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
1140 </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
1141 </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
1142
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
1143 <varlistentry>
227
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1144 <term>importundefexport</term>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1145 <listitem>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1146 <para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1147 This pragma is only valid for targets that support external references. When
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1148 in force, it will cause the EXPORT directive to act as IMPORT if the symbol
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1149 to be exported is not defined. This is provided for compatibility with the
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1150 output of gcc6809 and should not be used in hand written code. Because of
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1151 the confusion this pragma can cause, it is disabled by default.
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1152 </para>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1153 </listitem>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1154 </varlistentry>
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1155
4c60c3a09597 Various updates to the manual
lost
parents: 186
diff changeset
1156 <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
1157 <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
1158 <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
1159 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1160 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
1161 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
1162 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
1163 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
1164 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
1165 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
1166 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1167 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1168 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
1169 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
1170 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
1171 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
1172 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
1173 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
1174 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
1175 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1176 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1177 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
1178 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
1179 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
1180 </para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1181 </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
1182 </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
1183 </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
1184
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1185 </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
1186
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1187 </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
1188
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1189 <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
1190 <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
1191 <para>
150
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1192 The LWTOOLS linker is called LWLINK. This chapter documents the various features
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1193 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
1194 </para>
150
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1195
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1196 <section>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1197 <title>Command Line Options</title>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1198 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1199 The binary for LWLINK is called "lwlink". Note that the binary is in lower
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1200 case. lwlink takes the following command line arguments.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1201 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1202 <variablelist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1203 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1204 <term><option>--decb</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1205 <term><option>-b</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1206 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1207 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1208 Selects the DECB output format target. This is equivalent to <option>--format=decb</option>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1209 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1210 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1211 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1212
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1213 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1214 <term><option>--output=FILE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1215 <term><option>-o FILE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1216 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1217 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1218 This option specifies the name of the output file. If not specified, the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1219 default is <option>a.out</option>.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1220 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1221 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1222 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1223
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1224 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1225 <term><option>--format=TYPE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1226 <term><option>-f TYPE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1227 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1228 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1229 This option specifies the output format. Valid values are <option>decb</option>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1230 and <option>raw</option>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1231 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1232 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1233 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1234
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1235 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1236 <term><option>--raw</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1237 <term><option>-r</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1238 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1239 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1240 This option specifies the raw output format.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1241 It is equivalent to <option>--format=raw</option>.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1242 and <option>raw</option>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1243 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1244 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1245 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1246
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1247 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1248 <term><option>--script=FILE</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1249 <term><option>-s</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1250 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1251 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1252 This option allows specifying a linking script to override the linker's
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1253 built in defaults.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1254 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1255 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1256 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1257
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1258 <varlistentry>
186
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1259 <term><option>--section-base=SECT=BASE</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1260 <listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1261 <para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1262 Cause section SECT to load at base address BASE. This will be prepended
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1263 to the built-in link script. It is ignored if a link script is provided.
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1264 </para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1265 </listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1266 </varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1267
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1268 <varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1269 <term><option>--map=FILE</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1270 <term><option>-m FILE</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1271 <listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1272 <para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1273 This will output a description of the link result to FILE.
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1274 </para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1275 </listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1276 </varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1277
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1278 <varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1279 <term><option>--library=LIBSPEC</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1280 <term><option>-l LIBSPEC</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1281 <listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1282 <para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1283 Load a library using the library search path. LIBSPEC will have "lib" prepended
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1284 and ".a" appended.
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1285 </para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1286 </listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1287 </varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1288
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1289 <varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1290 <term><option>--library-path=DIR</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1291 <term><option>-L DIR</option></term>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1292 <listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1293 <para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1294 Add DIR to the library search path.
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1295 </para>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1296 </listitem>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1297 </varlistentry>
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1298
bc2fae9438eb Updated documentation to reflect recent changes
lost
parents: 175
diff changeset
1299 <varlistentry>
150
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1300 <term><option>--debug</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1301 <term><option>-d</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1302 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1303 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1304 This option increases the debugging level. It is only useful for LWTOOLS
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1305 developers.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1306 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1307 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1308 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1309
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1310 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1311 <term><option>--help</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1312 <term><option>-?</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1313 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1314 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1315 This provides a listing of command line options and a brief description
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1316 of each.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1317 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1318 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1319 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1320
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1321 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1322 <term><option>--usage</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1323 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1324 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1325 This will display a usage summary.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1326 of each.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1327 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1328 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1329 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1330
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1331
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1332 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1333 <term><option>--version</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1334 <term><option>-V</option></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1335 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1336 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1337 This will display the version of LWLINK.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1338 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1339 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1340 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1341
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1342 </section>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1343
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1344 <section>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1345 <title>Linker Operation</title>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1346
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1347 <para>
175
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1348
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1349 LWLINK takes one or more files in supported input formats and links them
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1350 into a single binary. Currently supported formats are the LWTOOLS object
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1351 file format and the archive format used by LWAR. While the precise method is
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1352 slightly different, linking can be conceptualized as the following steps.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1353
150
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1354 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1355
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1356 <orderedlist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1357 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1358 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1359 First, the linker loads a linking script. If no script is specified, it
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1360 loads a built-in default script based on the output format selected. This
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1361 script tells the linker how to lay out the various sections in the final
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1362 binary.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1363 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1364 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1365
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1366 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1367 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1368 Next, the linker reads all the input files into memory. At this time, it
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1369 flags any format errors in those files. It constructs a table of symbols
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1370 for each object at this time.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1371 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1372 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1373
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1374 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1375 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1376 The linker then proceeds with organizing the sections loaded from each file
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1377 according to the linking script. As it does so, it is able to assign addresses
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1378 to each symbol defined in each object file. At this time, the linker may
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1379 also collapse different instances of the same section name into a single
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1380 section by appending the data from each subsequent instance of the section
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1381 to the first instance of the section.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1382 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1383 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1384
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1385 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1386 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1387 Next, the linker looks through every object file for every incomplete reference.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1388 It then attempts to fully resolve that reference. If it cannot do so, it
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1389 throws an error. Once a reference is resolved, the value is placed into
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1390 the binary code at the specified section. It should be noted that an
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1391 incomplete reference can reference either a symbol internal to the object
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1392 file or an external symbol which is in the export list of another object
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1393 file.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1394 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1395 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1396
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1397 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1398 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1399 If all of the above steps are successful, the linker opens the output file
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1400 and actually constructs the binary.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1401 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1402 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1403 </orderedlist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1404
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1405 </section>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1406
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1407 <section
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1408 <title>Linking Scripts</title>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1409 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1410 A linker script is used to instruct the linker about how to assemble the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1411 various sections into a completed binary. It consists of a series of
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1412 directives which are considered in the order they are encountered.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1413 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1414 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1415 The sections will appear in the resulting binary in the order they are
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1416 specified in the script file. If a referenced section is not found, the linker will behave as though the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1417 section did exist but had a zero size, no relocations, and no exports.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1418 A section should only be referenced once. Any subsequent references will have
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1419 an undefined effect.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1420 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1421
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1422 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1423 All numbers are in linking scripts are specified in hexadecimal. All directives
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1424 are case sensitive although the hexadecimal numbers are not.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1425 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1426
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1427 <para>A section name can be specified as a "*", then any section not
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1428 already matched by the script will be matched. The "*" can be followed
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1429 by a comma and a flag to narrow the section down slightly, also.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1430 If the flag is "!bss", then any section that is not flagged as a bss section
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1431 will be matched. If the flag is "bss", then any section that is flagged as
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1432 bss will be matched.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1433 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1434
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1435 <para>The following directives are understood in a linker script.</para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1436 <variablelist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1437 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1438 <term>section <parameter>name</parameter> load <parameter>addr</parameter></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1439 <listitem><para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1440
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1441 This causes the section <parameter>name</parameter> to load at
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1442 <parameter>addr</parameter>. For the raw target, only one "load at" entry is
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1443 allowed for non-bss sections and it must be the first one. For raw targets,
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1444 it affects the addresses the linker assigns to symbols but has no other
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1445 affect on the output. bss sections may all have separate load addresses but
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1446 since they will not appear in the binary anyway, this is okay.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1447 </para><para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1448 For the decb target, each "load" entry will cause a new "block" to be
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1449 output to the binary which will contain the load address. It is legal for
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1450 sections to overlap in this manner - the linker assumes the loader will sort
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1451 everything out.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1452 </para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1453 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1454
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1455 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1456 <term>section <parameter>name</parameter></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1457 <listitem><para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1458
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1459 This will cause the section <parameter>name</parameter> to load after the previously listed
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1460 section.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1461 </para></listitem></varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1462 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1463 <term>exec <parameter>addr or sym</parameter></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1464 <listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1465 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1466 This will cause the execution address (entry point) to be the address
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1467 specified (in hex) or the specified symbol name. The symbol name must
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1468 match a symbol that is exported by one of the object files being linked.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1469 This has no effect for targets that do not encode the entry point into the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1470 resulting file. If not specified, the entry point is assumed to be address 0
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1471 which is probably not what you want. The default link scripts for targets
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1472 that support this directive automatically starts at the beginning of the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1473 first section (usually "init" or "code") that is emitted in the binary.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1474 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1475 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1476 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1477
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1478 <varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1479 <term>pad <parameter>size</parameter></term>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1480 <listitem><para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1481 This will cause the output file to be padded with NUL bytes to be exactly
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1482 <parameter>size</parameter> bytes in length. This only makes sense for a raw target.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1483 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1484 </listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1485 </varlistentry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1486 </variablelist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1487
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1488
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1489
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1490 </section>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1491
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
1492 </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
1493
175
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1494 <chapter>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1495 <title>Libraries and LWAR</title>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1496
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1497 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1498 LWTOOLS also includes a tool for managing libraries. These are analogous to
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1499 the static libraries created with the "ar" tool on POSIX systems. Each library
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1500 file contains one or more object files. The linker will treat the object
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1501 files within a library as though they had been specified individually on
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1502 the command line except when resolving external references. External references
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1503 are looked up first within the object files within the library and then, if
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1504 not found, the usual lookup based on the order the files are specified on
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1505 the command line occurs.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1506 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1507
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1508 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1509 The tool for creating these libary files is called LWAR.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1510 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1511
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1512 <section>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1513 <title>Command Line Options</title>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1514 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1515 The binary for LWAR is called "lwar". Note that the binary is in lower
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1516 case. The options lwar understands are listed below. For archive manipulation
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1517 options, the first non-option argument is the name of the archive. All other
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1518 non-option arguments are the names of files to operate on.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1519 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1520
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1521 <variablelist>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1522 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1523 <term><option>--add</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1524 <term><option>-a</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1525 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1526 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1527 This option specifies that an archive is going to have files added to it.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1528 If the archive does not already exist, it is created. New files are added
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1529 to the end of the archive.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1530 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1531 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1532 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1533
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1534 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1535 <term><option>--create</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1536 <term><option>-c</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1537 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1538 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1539 This option specifies that an archive is going to be created and have files
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1540 added to it. If the archive already exists, it is truncated.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1541 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1542 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1543 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1544
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1545 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1546 <term><option>--merge</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1547 <term><option>-m</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1548 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1549 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1550 If specified, any files specified to be added to an archive will be checked
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1551 to see if they are archives themselves. If so, their constituent members are
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1552 added to the archive. This is useful for avoiding archives containing archives.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1553 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1554 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1555 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1556
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1557 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1558 <term><option>--list</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1559 <term><option>-l</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1560 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1561 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1562 This will display a list of the files contained in the archive.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1563 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1564 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1565 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1566
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1567 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1568 <term><option>--debug</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1569 <term><option>-d</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1570 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1571 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1572 This option increases the debugging level. It is only useful for LWTOOLS
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1573 developers.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1574 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1575 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1576 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1577
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1578 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1579 <term><option>--help</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1580 <term><option>-?</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1581 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1582 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1583 This provides a listing of command line options and a brief description
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1584 of each.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1585 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1586 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1587 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1588
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1589 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1590 <term><option>--usage</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1591 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1592 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1593 This will display a usage summary.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1594 of each.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1595 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1596 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1597 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1598
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1599
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1600 <varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1601 <term><option>--version</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1602 <term><option>-V</option></term>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1603 <listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1604 <para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1605 This will display the version of LWLINK.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1606 of each.
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1607 </para>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1608 </listitem>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1609 </varlistentry>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1610
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1611 </section>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1612
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1613 </chapter>
f8ec28ace0c6 Updated docs to reflect recent changes
lost
parents: 167
diff changeset
1614
109
f21a5593a661 Updated docs
lost
parents:
diff changeset
1615 <chapter id="objchap">
f21a5593a661 Updated docs
lost
parents:
diff changeset
1616 <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
1617 <para>
afe30454382f Made development version of LWASM be 2.1, not 3.0, because the next release will be an incremental feature release
lost
parents: 109
diff changeset
1618 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
1619 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
1620 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
1621 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
1622 </para>
150
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1623
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1624 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1625 An object file consists of a series of sections each of which contains a
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1626 list of exported symbols, a list of incomplete references, and a list of
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1627 "local" symbols which may be used in calculating incomplete references. Each
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1628 section will obviously also contain the object code.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1629 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1630
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1631 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1632 Exported symbols must be completely resolved to an address within the
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1633 section it is exported from. That is, an exported symbol must be a constant
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1634 rather than defined in terms of other symbols.</para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1635
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1636 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1637 Each object file starts with a magic number and version number. The magic
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1638 number is the string "LWOBJ16" for this 16 bit object file format. The only
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1639 defined version number is currently 0. Thus, the first 8 bytes of the object
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1640 file are <code>4C574F424A313600</code>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1641 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1642
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1643 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1644 Each section has the following items in order:
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1645 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1646
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1647 <itemizedlist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1648 <listitem><para>section name</para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1649 <listitem><para>flags</para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1650 <listitem><para>list of local symbols (and addresses within the section)</para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1651 <listitem><para>list of exported symbols (and addresses within the section)</para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1652 <listitem><para>list of incomplete references along with the expressions to calculate them</para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1653 <listitem><para>the actual object code (for non-BSS sections)</para></listitem>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1654 </itemizedlist>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1655
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1656 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1657 The section starts with the name of the section with a NUL termination
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1658 followed by a series of flag bytes terminated by NUL. There are only two
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1659 flag bytes defined. A NUL (0) indicates no more flags and a value of 1
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1660 indicates the section is a BSS section. For a BSS section, no actual
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1661 code is included in the object file.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1662 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1663
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1664 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1665 Either a NULL section name or end of file indicate the presence of no more
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1666 sections.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1667 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1668
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1669 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1670 Each entry in the exported and local symbols table consists of the symbol
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1671 (NUL terminated) followed by two bytes which contain the value in big endian
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1672 order. The end of a symbol table is indicated by a NULL symbol name.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1673 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1674
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1675 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1676 Each entry in the incomplete references table consists of an expression
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1677 followed by a 16 bit offset where the reference goes. Expressions are
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1678 defined as a series of terms up to an "end of expression" term. Each term
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1679 consists of a single byte which identifies the type of term (see below)
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1680 followed by any data required by the term. Then end of the list is flagged
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1681 by a NULL expression (only an end of expression term).
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1682 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1683
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1684 <table frame="all"><title>Object File Term Types</title>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1685 <tgroup cols="2">
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1686 <thead>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1687 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1688 <entry>TERMTYPE</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1689 <entry>Meaning</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1690 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1691 </thead>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1692 <tbody>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1693 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1694 <entry>00</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1695 <entry>end of expression</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1696 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1697
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1698 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1699 <entry>01</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1700 <entry>integer (16 bit in big endian order follows)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1701 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1702 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1703 <entry>02</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1704 <entry> external symbol reference (NUL terminated symbol name follows)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1705 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1706
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1707 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1708 <entry>03</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1709 <entry>local symbol reference (NUL terminated symbol name follows)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1710 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1711
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1712 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1713 <entry>04</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1714 <entry>operator (1 byte operator number)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1715 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1716 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1717 <entry>05</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1718 <entry>section base address reference</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1719 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1720 </tbody>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1721 </tgroup>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1722 </table>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1723
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1724 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1725 External references are resolved using other object files while local
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1726 references are resolved using the local symbol table(s) from this file. This
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1727 allows local symbols that are not exported to have the same names as
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1728 exported symbols or external references.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1729 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1730
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1731 <table frame="all"><title>Object File Operator Numbers</title>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1732 <tgroup cols="2">
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1733 <thead>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1734 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1735 <entry>Number</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1736 <entry>Operator</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1737 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1738 </thead>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1739 <tbody>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1740 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1741 <entry>01</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1742 <entry>addition (+)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1743 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1744 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1745 <entry>02</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1746 <entry>subtraction (-)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1747 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1748 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1749 <entry>03</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1750 <entry>multiplication (*)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1751 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1752 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1753 <entry>04</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1754 <entry>division (/)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1755 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1756 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1757 <entry>05</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1758 <entry>modulus (%)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1759 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1760 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1761 <entry>06</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1762 <entry>integer division (\) (same as division)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1763 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1764
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1765 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1766 <entry>07</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1767 <entry>bitwise and</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1768 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1769
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1770 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1771 <entry>08</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1772 <entry>bitwise or</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1773 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1774
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1775 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1776 <entry>09</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1777 <entry>bitwise xor</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1778 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1779
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1780 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1781 <entry>0A</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1782 <entry>boolean and</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1783 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1784
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1785 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1786 <entry>0B</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1787 <entry>boolean or</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1788 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1789
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1790 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1791 <entry>0C</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1792 <entry>unary negation, 2's complement (-)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1793 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1794
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1795 <row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1796 <entry>0D</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1797 <entry>unary 1's complement (^)</entry>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1798 </row>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1799 </tbody>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1800 </tgroup>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1801 </table>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1802
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1803 <para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1804 An expression is represented in a postfix manner with both operands for
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1805 binary operators preceding the operator and the single operand for unary
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1806 operators preceding the operator.
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1807 </para>
f0881c115010 More major documentation upgrades
lost
parents: 147
diff changeset
1808
109
f21a5593a661 Updated docs
lost
parents:
diff changeset
1809 </chapter>
f21a5593a661 Updated docs
lost
parents:
diff changeset
1810 </book>
f21a5593a661 Updated docs
lost
parents:
diff changeset
1811