wla-dx
rtd-support
  • 1. Introduction
  • 2. Assembler Directives
  • 3. Assembler Syntax
  • 4. Error Messages
  • 5. Supported ROM/RAM/Cartridge Types (WLA-GB)
  • 6. Bugs
  • 7. Files
  • 8. Temporary Files
  • 9. Compiling
  • 10. Linking
  • 11. Arithmetics
  • 12. Binary to DB Conversion
  • 13. Things you should know about coding for…
  • 14. WLA Flags
  • 15. Extra compile time definitions
  • 16. Good things to know about WLA
  • 17. WLA DX’s architectural overview
  • 18. Legal Note
  • 1. Manpage: WLA-LINK
    • 1.1. SYNOPSIS
    • 1.2. OPTIONS
    • 1.3. DESCRIPTION
    • 1.4. EXAMPLES
  • 2. Manpage: WLA-CPU
  • 3. Manpage: WLAB
wla-dx
  • Docs »
  • 1. Manpage: WLA-LINK
  • Edit on GitHub

1. Manpage: WLA-LINK¶

1.1. SYNOPSIS¶

wlalink [OPTIONS] LINK_FILE OUTPUT_FILE

1.2. OPTIONS¶

-v Display information about ROM file after a succesful linking
-s Produce NO$GMB symbol file
-S Produce WLA symbol file
-d Discard all unreferenced FREE and SEMIFREE sections
-i Write list files (Note: WLA needs -i as wel)
-L LIBDIR Look in LIBDIR for libaries before looking in CWD

Choose one:

-b OUT Program file linking
-r OUT ROM image linking

1.3. DESCRIPTION¶

wlalink(1) is a part of WLA-DX. It links one or more object files (and perhaps some library files) together to produce a ROM image / program file.

LINK_FILE is a text file that contains information about the files you want to link together. Here’s the format:

  1. You must define the group for the files. Put the name of the group inside brackets. Valid group definitions are

    [objects]
    [libraries]
    [header]
    [footer]
    [definitions]
    
  2. Start to list the file names.

    [objects]
    main.o
    vbi.o
    level_01.o
    ...
    
  3. Give parameters to the library files:

    [libraries]
    bank 0 slot 1 speed.lib
    bank 4 slot 2 map_data.lib
    ...
    

    Here you can also use base to define the 65816 CPU bank number (like .BASE works in WLA):

    [libraries]
    bank 0 slot 1 base $80 speed.lib
    bank 4 slot 2 base $80 map_data.lib
    ...
    

    You must tell WLALINK the bank and the slot for the library files.

  4. If you want to use header and/or footer in your project, you can type the following:

    [header]
    header.dat
    [footer]
    footer.dat
    
  5. If you want to make value definitions, here’s your chance:

    [definitions]
    debug 1
    max_str_len 128
    start $150
    ...
    

If flag -i is given, wlalink(1) will write list files. Note that you must compile the object and library files with -i flag as well. Otherwise wlalink(1) has no extra information it needs to build list files.

Here is an example of a list file: Let’s assume you’ve compiled a source file called main.s using the -i flag. After you’ve linked the result also with the -i flag wlalink(1) has created a list file called main.lst. This file contains the source text and the result data the source compiled into. List files are good for debugging.

Make sure you don’t create duplicate labels in different places in the memory map as they break the linking loop. Duplicate labels are allowed when they overlap each other in the destination machine’s memory.

1.4. EXAMPLES¶

wlalink -r linkfile testa.sfc
wlalink -d -i -b linkfile testb.sfc
wlalink -v -S -L ../../lib linkfile testc.sfc
Next Previous

© Copyright 2016, vhelin. Revision 9cb61af1.

Built with Sphinx using a theme provided by Read the Docs.