<itemize>
<item>none
+ <item>module
<item>apple2
<item>apple2enh
<item>atari
<item>c16 (works also for the c116 with memory up to 32K)
<item>c64
<item>c128
- <item>plus4
<item>cbm510 (CBM-II series with 40 column video)
<item>cbm610 (all CBM series-II computers with 80 column video)
- <item>pet (all CBM PET systems except the 2001)
- <item>geos
+ <item>geos-apple
+ <item>geos-cbm
<item>lunix
- <item>atmos
+ <item>lynx
<item>nes
+ <item>pet (all CBM PET systems except the 2001)
+ <item>plus4
<item>supervision
+ <item>vic20
</itemize>
There are a few more targets defined but neither of them is actually
written to this file. Using the <tt/-g/ option for the compiler and assembler
will increase the amount of information available. Please note that debug
information generation is currently being developed, so the format of the
- file and it's contents are subject to change without further notice.
+ file and its contents are subject to change without further notice.
<tag><tt>--lib file</tt></tag>
name="Configuration files">).
After that, the linker is ready to produce an output file. Before doing that,
-it checks it's data for consistency. That is, it checks for unresolved
+it checks its data for consistency. That is, it checks for unresolved
externals (if the output format is not relocatable) and for symbol type
mismatches (for example a zero page symbol is imported by a module as absolute
symbol).
will create an empty output file. This may be suppressed by assigning an empty
file name to that memory area.
+The <tt/%O/ sequence is also allowed inside a string. So using
+
+<tscreen><verb>
+ MEMORY {
+ ROM1: start = $A000, size = $2000, file = "%O-1.bin";
+ ROM2: start = $E000, size = $2000, file = "%O-2.bin";
+ }
+</verb></tscreen>
+
+would write two files that start with the name of the output file specified on
+the command line, with "-1.bin" and "-2.bin" appended respectively. Because
+'%' is used as an escape char, the sequence "%%" has to be used if a single
+percent sign is required.
<sect1>LOAD and RUN addresses (ROMable code)<p>
goes into <tt/ROM2/. Read/write data will be loaded into <tt/ROM2/ but is run
in <tt/RAM2/. That means that all references to labels in the <tt/DATA/
segment are relocated to be in <tt/RAM2/, but the segment is written to
-<tt/ROM2/. All your startup code has to do is, to copy the data from it's
+<tt/ROM2/. All your startup code has to do is, to copy the data from its
location in <tt/ROM2/ to the final location in <tt/RAM2/.
So, how do you know, where the data is located? This is the second point,
}
</verb></tscreen>
-This will define three external symbols that may be used in your code:
+This will define some external symbols that may be used in your code:
<tscreen><verb>
__STACK_START__ This is set to the start of the memory
- area, $C000 in this example.
+ area, $C000 in this example.
__STACK_SIZE__ The size of the area, here $1000.
__STACK_LAST__ This is NOT the same as START+SIZE.
- Instead, it it defined as the first
- address that is not used by data. If we
- don't define any segments for this area,
- the value will be the same as START.
+ Instead, it it defined as the first
+ address that is not used by data. If we
+ don't define any segments for this area,
+ the value will be the same as START.
+ __STACK_FILEOFFS__ The binary offset in the output file. This
+ is not defined for relocatable output file
+ formats (o65).
</verb></tscreen>
A memory section may also have a type. Valid types are
value given on the command line with the <tt><ref id="option-S" name="-S"></tt>
option).
+To support systems with banked memory, a special attribute named <tt/bank/ is
+available. The attribute value is an arbitrary 32 bit integer. The assembler
+has a builtin function named <tt/.BANK/ which may be used with an argument
+that has a segment reference (for example a symbol). The result of this
+function is the value of the bank attribute for the run memory area of the
+segment.
+
<sect1>Other SEGMENT attributes<p>
The <tt/FORMAT/ section is used to describe file formats. The default (binary)
format has currently no attributes, so, while it may be listed in this
-section, the attribute list is empty. The second supported format, o65, has
-several attributes that may be defined here.
+section, the attribute list is empty. The second supported format,
+<htmlurl url="http://www.6502.org/users/andre/o65/fileformat.html" name="o65">,
+has several attributes that may be defined here.
<tscreen><verb>
FORMATS {
<sect1>The SYMBOLS section<label id="SYMBOLS"><p>
The configuration file may also be used to define symbols used in the link
-stage. The mandatory attribute for a symbol is its value. A second, boolean
-attribute named <tt/weak/ is available. If a symbol is marked as weak, it may
-be overridden by defining a symbol of the same name from the command line. The
-default for symbols is that they're strong, which means that an attempt to
-define a symbol with the same name from the command line will lead to an
-error.
+stage or to force symbols imports. This is done in the SYMBOLS section. The
+symbol name is followed by a colon and symbol attributes.
+
+The following symbol attributes are supported:
+
+<descrip>
+
+ <tag><tt>addrsize</tt></tag>
+
+ The <tt/addrsize/ attribute specifies the address size of the symbol and
+ may be one of
+<itemize>
+ <item><tt/zp/, <tt/zeropage/ or <tt/direct/
+ <item><tt/abs/, <tt/absolute/ or <tt/near/
+ <item><tt/far/
+ <item><tt/long/ or <tt/dword/.
+</itemize>
+
+Without this attribute, the default address size is <tt/abs/.
+
+ <tag><tt>type</tt></tag>
+
+ This attribute is mandatory. Its value is one of <tt/export/, <tt/import/ or
+ <tt/weak/. <tt/export/ means that the symbol is defined and exported from
+ the linker config. <tt/import/ means that an import is generated for this
+ symbol, eventually forcing a module that exports this symbol to be included
+ in the output. <tt/weak/ is similar as <tt/export/. However, the symbol is
+ only defined if it is not defined elsewhere.
+
+ <tag><tt>value</tt></tag>
+
+ This must only be given for symbols of type <tt/export/ or <tt/weak/. It
+ defines the value of the symbol and may be an expression.
+
+</descrip>
The following example defines the stack size for an application, but allows
the programmer to override the value by specifying <tt/--define
<tscreen><verb>
SYMBOLS {
# Define the stack size for the application
- __STACKSIZE__: value = $800, weak = yes;
+ __STACKSIZE__: type = weak, value = $800;
}
</verb></tscreen>