annotate doc/manual/manual.html @ 285:9010796c6253 2.3 2.3.1

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