ULIB80(1)

NAME
ulib80 - Microsoft LIB-80 compatible library manager for 8080/Z80

SYNOPSIS
ulib80 -c library.lib file.rel [file.rel]...
ulib80 -l library.lib
ulib80 -p library.lib
ulib80 -x library.lib [module]...
ulib80 -a library.lib file.rel [file.rel]...
ulib80 -d library.lib module [module]...

DESCRIPTION
ulib80 is a Microsoft LIB-80 compatible library manager for creating and maintaining libraries of relocatable object modules (.REL files) for use with the ul80(1) linker.

Libraries allow commonly used routines to be collected into a single file. When linking, only the modules needed to satisfy undefined references are included in the output, keeping executables small.

OPTIONS

-v, --version
    Display version information and exit.

Exactly one operation must be specified:

-c  Create a new library from the specified .REL files. If the library file exists, it is overwritten.

-l  List the modules contained in the library, showing module names and sizes.

-p  Print the public symbols defined in each module of the library.

-x  Extract modules from the library. If no module names are given, all modules are extracted. Extracted modules are written as module.rel files.

-a  Add .REL files to an existing library. The library must already exist.

-d  Delete the named modules from the library.

ARGUMENTS

library.lib
    The library file to operate on. By convention, library files use the .lib extension.

file.rel
    Relocatable object files to add to the library.

module
    Module name (without .rel extension) for extraction or deletion.

LIBRARY FORMAT
The ulib80 library format (ULIB) consists of:

•   Magic header "ULIB"

•   Version number

•   Module directory with names, offsets, and public symbol lists

•   Concatenated module data

This format is specific to ulib80 and differs from the original Microsoft LIB-80 format, but serves the same purpose.

EXAMPLES

Create a library:
    ulib80 -c mylib.lib io.rel math.rel string.rel

List library contents:
    ulib80 -l mylib.lib

Show public symbols:
    ulib80 -p mylib.lib

Extract all modules:
    ulib80 -x mylib.lib

Extract specific module:
    ulib80 -x mylib.lib math

Add a module:
    ulib80 -a mylib.lib newmod.rel

Delete a module:
    ulib80 -d mylib.lib oldmod

EXIT STATUS

0   Operation successful.

1   Operation failed due to errors.

FILES

library.lib
    Library archive file.

module.rel
    Relocatable object file.

TYPICAL WORKFLOW

    # Assemble source files
    um80 -o io.rel io.mac
    um80 -o math.rel math.mac
    um80 -o string.rel string.mac
    # Create library
    ulib80 -c stdlib.lib io.rel math.rel string.rel
    # Link with library
    ul80 -o program.com main.rel stdlib.lib

SEE ALSO
um80(1), ul80(1), ucref80(1), ud80(1)

The original Microsoft LIB-80 manual is available at docs/external/cref_lib.pdf

NOTES

•   Module names are derived from the .REL file name (without extension) and are converted to uppercase.

•   A library cannot contain duplicate module names.

•   When the linker searches a library, it only includes modules that define symbols referenced by other modules.

AUTHOR
um80 project contributors.