home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d906 / phxass.lha / PhxAss / PhxLnk.doc < prev    next >
Text File  |  1993-08-28  |  5KB  |  143 lines

  1.  
  2.                   P h x L n k
  3.  
  4.             AMIGA-DOS Module Linker
  5.  
  6.  
  7.  
  8. Contents
  9. --------
  10.  
  11. I.    Introduction
  12. II.   Usage
  13. III.  Bugs
  14.  
  15.  
  16.  
  17. I. Introduction
  18. ===============
  19.  
  20. This program was written, because I had no Linker which can process object-
  21. modules using the small-code and small-data model in a good time. I have got
  22. the LN-Linker from Manx (Aztec-C), which is too slow, and the public-domain
  23. linker BLink V6.7 which is unable to process small-data modules.
  24. PhxLnk is only 7 kB large, in most cases faster than BLink (31 kB) and many
  25. times faster than LN.
  26. PhxLnk was written in pure assembler-code, assembled with PhxAss and linked
  27. with BLink (first version) and PhxLnk itself.
  28.  
  29. PhxLnk is FREEWARE and copyright © 1992,93 by Frank Wille.
  30. Commercial usage of this program is strictly forbidden!
  31.  
  32.  
  33.  
  34. II. Usage
  35. =========
  36.  
  37. The linker can be used from CLI only. You may copy it to the C-directory of
  38. your workdisk, then type :
  39.  
  40.    PhxLnk [<-options>] <object- or library-module names ...>
  41.  
  42. to start PhxLnk. Starting PhxLnk with no argument or with a single '?' will
  43. display a short instruction.
  44.  
  45. There are two types of modules which can be linked:
  46. o  Object modules with extension ".o" or ".obj" which normally consist of one
  47.    unit. PhxLnk also links object modules with several units.
  48. o  Library modules with extension ".lib" which can consist of any number of
  49.    units. PhxLnk will only include units, if at least one ext_def-symbol is
  50.    referenced in an object module unit or in an already included library unit.
  51.  
  52. The module names can appear in any order, provided the first is an object
  53. module which contains the startup code.
  54.  
  55.  
  56. Options:
  57.  
  58. -o<Name>    Sets the name of the output file. If not specified, the output
  59.         name is the name of the first module without extension,
  60.         e.g. "phxlnk prog1.o prog2.o c.lib m.lib"  will produce a load-
  61.         file with the name "prog1".
  62.  
  63. -a        This option forces all sections to be loaded to Chip-Memory.
  64.  
  65. -c        Normally only the sections of the same type and name will be
  66.         linked together. -c ignores the names of the Code sections,
  67.         they will be linked to one large Code section. Usually -c is set
  68.         when using small-code model.
  69.  
  70. -d        As with -c the section names are ignored, but now for the Data and
  71.         Bss sections. Data and Bss will not be mixed! This large section
  72.         will contain first all the Data and then all the Bss.
  73.         Important! When PhxLnk writes the load-file, only the Data-part of
  74.         this section will be saved. The Bss-part, which is zero in any
  75.         case, must be recreated by the startup code of the program (see
  76.         Linker-Symbols for more information). Nevertheless all pointers
  77.         and references to, or symbols of this section will be calculated
  78.         as if the Bss section were directly behind the Data. -d will be
  79.         needed when using small-data model for both Data and Bss sections.
  80.  
  81. -s        The hunk_symbol($3f0) and hunk_debug($3f1) blocks which contain
  82.         information for a debugger will not be written to the load-file.
  83.  
  84. -b<num>     Sets the maximum number of sections per unit to <num>. The default
  85.         value is 16 (which should be enough for most cases).
  86.  
  87.  
  88. Linker-Symbols:
  89.  
  90. The linker itself creates one ext_def($01xxxxxx) and two ext_abs($02xxxxxx)
  91. symbols which will be needed by the startup code of a program using the small-
  92. data model.
  93.  
  94. _DATA_BAS_  (ext_def) Base address of the Data section.
  95. _DATA_LEN_  (ext_abs) Length of the Data section in Bytes.
  96. _BSS_LEN_   (ext_abs) Length of the (not existing) Bss section in Bytes.
  97.  
  98. The startup code should allocate _DATA_LEN_ + _BSS_LEN_ + 8 Bytes of cleared
  99. memory. Then copy the Data section from _DATA_BAS_ to this new memory space.
  100. As a last step, the new Data/Bss section must be inserted in the segment-list
  101. instead of the old one.
  102.  
  103.  
  104. Small-Data:
  105.  
  106. Small-data symbols can be accessed in a range of 65534 ($fffe) bytes. When a
  107. symbol is outside of this range, the linker will display an error.
  108. The small-data model must be initialized by the startup code. When you're
  109. using A4 as small-data pointer, the initialization would look like this:
  110.  
  111.  lea     SmallDataBase,a4
  112.  lea     32766(a4),a4
  113.  
  114. Don't write "lea  SmallDataBase+32766,a4". Some assemblers could change this
  115. address during optimization.
  116. I chose 32766 instead of 32768, because this is the way most assemblers and
  117. linkers do it (e.g. DICE).
  118.  
  119.  
  120.  
  121. III. Bugs
  122. =========
  123.  
  124. The linker does not support overlay-hunks, something which could be added in
  125. future updates.
  126.  
  127. If any errors or questions occur, please write to :
  128.  
  129.             Frank Wille
  130.             Auf dem Dreische 45
  131.             32049 Herford
  132.             GERMANY
  133.            __
  134.           ///
  135.          ///
  136.         ///
  137.    __       ///
  138.    \\\      ///
  139.     \\\  ///
  140.      \\\///
  141.       \XX/      A M I G A   F O R E V E R  !
  142.  
  143.