home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / extras / abslink / READ.ME < prev    next >
Encoding:
Text File  |  1996-12-24  |  2.9 KB  |  80 lines

  1. ABSLINK - an absolute linker
  2.  
  3. ==========================================================================
  4. The programs and documentation in this distribution are 
  5.  
  6.    Copyright (c) 1993, Doug Walker, Cary, NC, USA
  7.    All Rights Reserved
  8.  
  9. This software is freely redistributable on a non-profit basis.  Please
  10. contact the author for appropriate permissions if it is used in commercial
  11. products.
  12.  
  13. THIS SOFTWARE IS PROVIDED ON AN AS-IS BASIS.  USE IT AT YOUR OWN RISK.  The
  14. author will not be liable for any damages, direct or indirect, from the use
  15. of this software.
  16.  
  17. ==========================================================================
  18.  
  19. ABSLINK is a quick little hack I threw together to solve some problems that
  20. arise when attempting to compile code on the Amiga and move it into a ROM
  21. or EPROM.  Code to be moved into a ROM or EPROM is usually bound to a 
  22. specific address - the address of the ROM.  Amiga executables aren't bound
  23. to a specific address until the system loader loads them.
  24.  
  25. ABSLINK gets around this.  It reads an Amiga executable and binds it to a
  26. specific address.
  27.  
  28. The entire program, code and data, is bound to consecutive memory locations
  29. starting at the address you specify (or 0 as the default).  It would be
  30. easy to bind each hunk to a different address, but I'll leave that as an
  31. exercise for the reader.
  32.  
  33. ABSLINK requires version 2.0 or higher of AmigaDOS and Version 6 of the
  34. SAS/C® Development System.
  35.  
  36. SYNTAX:
  37.  
  38.    ABSLINK [EXE] <executable> [OUT] <output file> [ADDRESS <number>]
  39.  
  40. The keywords EXE and OUT are optional.  If specified, ADDRESS is required.
  41.  
  42. EXE takes an AmigaDOS executable as its argument.
  43.  
  44. OUT takes an AmigaDOS filename for use as an output file as its argument.
  45.  
  46. ADDRESS takes the address you want to bind your program to.  The default is
  47. address zero.  You may specify a decimal number or a hexadecimal number 
  48. beginning with 0x, 0X, or $.
  49.  
  50. EXAMPLES:
  51.  
  52.    abslink myprog foo             ; bind 'myprog' to address 0 and put it 
  53.                                     in file 'foo'
  54.    
  55.    abslink exe=myprog foo addr=10 ; bind 'myprog' to address 10, output to
  56.                                     'foo'
  57.    
  58.    abslink myprog foo addr=$a     ; Same as the last one
  59.    
  60.    abslink myprog foo addr=0xa    ; Same as the last two
  61.  
  62. The resulting output file will be plain hex data with no relocations at 
  63. all.  If you copied the output file to RAM, starting at the specified ADDR
  64. value, then branched to the ADDR value, it would effectively run your
  65. program.
  66.  
  67. The test program "runtest" does exactly this.  "runtest" looks to see how
  68. big a program is, allocates enough memory for it, runs ABSLINK to bind it
  69. to the memory allocated, loads the output file into that memory, and jumps
  70. to the program.
  71.  
  72. You can try this out.  Run SMAKE with no arguments to compile ABSLINK, 
  73. TEST, and RUNTEST.  Then type
  74.  
  75.    RUNTEST TEST
  76.  
  77. The source code being the ultimate documentation, I'll leave you to that.
  78.  
  79. --Doug Walker
  80.