home *** CD-ROM | disk | FTP | other *** search
- ABSLINK - an absolute linker
-
- ==========================================================================
- The programs and documentation in this distribution are
-
- Copyright (c) 1993, Doug Walker, Cary, NC, USA
- All Rights Reserved
-
- This software is freely redistributable on a non-profit basis. Please
- contact the author for appropriate permissions if it is used in commercial
- products.
-
- THIS SOFTWARE IS PROVIDED ON AN AS-IS BASIS. USE IT AT YOUR OWN RISK. The
- author will not be liable for any damages, direct or indirect, from the use
- of this software.
-
- ==========================================================================
-
- ABSLINK is a quick little hack I threw together to solve some problems that
- arise when attempting to compile code on the Amiga and move it into a ROM
- or EPROM. Code to be moved into a ROM or EPROM is usually bound to a
- specific address - the address of the ROM. Amiga executables aren't bound
- to a specific address until the system loader loads them.
-
- ABSLINK gets around this. It reads an Amiga executable and binds it to a
- specific address.
-
- The entire program, code and data, is bound to consecutive memory locations
- starting at the address you specify (or 0 as the default). It would be
- easy to bind each hunk to a different address, but I'll leave that as an
- exercise for the reader.
-
- ABSLINK requires version 2.0 or higher of AmigaDOS and Version 6 of the
- SAS/C® Development System.
-
- SYNTAX:
-
- ABSLINK [EXE] <executable> [OUT] <output file> [ADDRESS <number>]
-
- The keywords EXE and OUT are optional. If specified, ADDRESS is required.
-
- EXE takes an AmigaDOS executable as its argument.
-
- OUT takes an AmigaDOS filename for use as an output file as its argument.
-
- ADDRESS takes the address you want to bind your program to. The default is
- address zero. You may specify a decimal number or a hexadecimal number
- beginning with 0x, 0X, or $.
-
- EXAMPLES:
-
- abslink myprog foo ; bind 'myprog' to address 0 and put it
- in file 'foo'
-
- abslink exe=myprog foo addr=10 ; bind 'myprog' to address 10, output to
- 'foo'
-
- abslink myprog foo addr=$a ; Same as the last one
-
- abslink myprog foo addr=0xa ; Same as the last two
-
- The resulting output file will be plain hex data with no relocations at
- all. If you copied the output file to RAM, starting at the specified ADDR
- value, then branched to the ADDR value, it would effectively run your
- program.
-
- The test program "runtest" does exactly this. "runtest" looks to see how
- big a program is, allocates enough memory for it, runs ABSLINK to bind it
- to the memory allocated, loads the output file into that memory, and jumps
- to the program.
-
- You can try this out. Run SMAKE with no arguments to compile ABSLINK,
- TEST, and RUNTEST. Then type
-
- RUNTEST TEST
-
- The source code being the ultimate documentation, I'll leave you to that.
-
- --Doug Walker
-