]> git.sur5r.net Git - cc65/blobdiff - doc/ld65.sgml
Revert "No linuxdoc here. Documenation is to be maintained as HTML in branch 'gh...
[cc65] / doc / ld65.sgml
index c077d2ee7f2f08efc057d0da635eec1049bc5384..5330a21d97d89a2ac7d98cca491ace6ae00ebc53 100644 (file)
@@ -1,4 +1,4 @@
-<!doctype linuxdoc system>
+<!doctype linuxdoc system>      <!-- -*- text-mode -*- -->
 
 <article>
 <title>ld65 Users Guide
@@ -157,7 +157,6 @@ Here is a description of all the command line options:
   <item>module
   <item>apple2
   <item>apple2enh
-  <item>apple-geos
   <item>atari
   <item>atmos
   <item>c16 (works also for the c116 with memory up to 32K)
@@ -165,7 +164,8 @@ Here is a description of all the command line options:
   <item>c128
   <item>cbm510 (CBM-II series with 40 column video)
   <item>cbm610 (all CBM series-II computers with 80 column video)
-  <item>cbm-geos
+  <item>geos-apple
+  <item>geos-cbm
   <item>lunix
   <item>lynx
   <item>nes
@@ -596,10 +596,10 @@ names here. Segments that go into <tt/ROM1/ will be written to a file named
 named "rom2.bin". The name given on the command line is ignored in both cases.
 
 Assigning an empty file name for a memory area will discard the data written
-to it. This is useful, if the a memory area has segments assigned that are
-empty (for example because they are of type bss). In that case, the linker
-will create an empty output file. This may be suppressed by assigning an empty
-file name to that memory area.
+to it. This is useful, if the memory area has segments assigned that are empty
+(for example because they are of type bss). In that case, the linker 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
 
@@ -639,9 +639,9 @@ segment, than storing it into one of the ROMs, we have to put it there. But
 unfortunately, ROM is not writable, so we have to copy it into RAM before
 running the actual code.
 
-The linker cannot help you copying the data from ROM into RAM (this must be
-done by the startup code of your program), but it has some features that will
-help you in this process.
+The linker won't copy the data from ROM into RAM for you (this must be done by
+the startup code of your program), but it has some features that will help you
+in this process.
 
 First, you may not only specify a "<tt/load/" attribute for a segment, but
 also a "<tt/run/" attribute. The "<tt/load/" attribute is mandatory, and, if
@@ -684,6 +684,10 @@ So, what your startup code must do, is to copy <tt/__DATA_SIZE__/ bytes from
 All references to labels in the <tt/DATA/ segment are relocated to <tt/RAM2/
 by the linker, so things will work properly.
 
+There's a library subroutine called <tt/copydata/ (in a module named
+<tt/copydata.s/) that might be used to do actual copying. Be sure to have a
+look at it's inner workings before using it!
+
 
 <sect1>Other MEMORY area attributes<p>
 
@@ -699,17 +703,20 @@ useful for things like a software stack, or an i/o area.
        }
 </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
@@ -725,14 +732,24 @@ into a memory area that is marked as readonly.
 Unused memory in a memory area may be filled. Use the "<tt/fill = yes/"
 attribute to request this. The default value to fill unused space is zero. If
 you don't like this, you may specify a byte value that is used to fill these
-areas with the "<tt/fillval/" attribute. This value is also used to fill unfilled
-areas generated by the assemblers <tt/.ALIGN/ and <tt/.RES/ directives.
+areas with the "<tt/fillval/" attribute. If there is no "<tt/fillval/"
+attribute for the segment, the "<tt/fillval/" attribute of the memory area (or
+its default) is used instead. This means that the value may also be used to
+fill unfilled areas generated by the assemblers <tt/.ALIGN/ and <tt/.RES/
+directives.
 
 The symbol <tt/%S/ may be used to access the default start address (that is,
 the one defined in the <ref id="FEATURES" name="FEATURES"> section, or the
 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>
 
@@ -794,6 +811,13 @@ segment in the load memory area, in case different load and run areas have
 been specified. There are no special attributes to set start or offset for
 just the load memory area.
 
+A "<tt/fillval/" attribute may not only be specified for a memory area, but
+also for a segment. The value must be an integer between 0 and 255. It is used
+as fill value for space reserved by the assemblers <tt/.ALIGN/ and <tt/.RES/
+commands. It is also used as fill value for space between sections (part of a
+segment that comes from one object file) caused by alignment, but not for
+space that preceeds the first section.
+
 To suppress the warning, the linker issues if it encounters a segment that is
 not found in any of the input files, use "<tt/optional=yes/" as additional
 segment attribute. Be careful when using this attribute, because a missing
@@ -914,6 +938,13 @@ The <tt/CONDES/ feature has several attributes:
 
   Please note that the order of entries with equal priority is undefined.
 
+  <tag><tt>import</tt></tag>
+
+  This attribute defines a valid symbol name, that is added as an import
+  to the modules defining a constructor/desctructor of the given type.
+  This can be used to force linkage of a module if this module exports the
+  requested symbol.
+
 </descrip>
 
 Without specifying the <tt/CONDES/ feature, the linker will not create any