UCREF80(1)

NAME
ucref80 - cross-reference utility for MACRO-80 assembly files

SYNOPSIS
ucref80 [-v] [-o output.txt] file.mac [file.mac]...

DESCRIPTION
ucref80 generates a cross-reference listing for MACRO-80 assembly source files. The listing shows where each symbol is defined and referenced, making it easier to understand and maintain assembly code.

The cross-reference output includes:

•   Alphabetized list of all symbols

•   Definition locations (file and line number)

•   Reference locations (file and line number)

•   Symbol attributes (PUBLIC, EXTERNAL, MACRO)

OPTIONS

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

-o output.txt
    Write the cross-reference listing to the specified file instead of standard output.

ARGUMENTS

file.mac
    One or more assembly source files to analyze. Multiple files are processed together, so cross-file references are tracked.

OUTPUT FORMAT
The output consists of one entry per symbol:

    SYMBOL_NAME
      Def:   filename.mac:line
      Refs:  filename.mac:line, filename.mac:line, ...

Special attributes are noted after the symbol name:

•   (PUBLIC) - Symbol declared PUBLIC

•   (EXTERNAL) - Symbol declared EXTRN

•   (MACRO) - Symbol is a macro name

SYMBOLS TRACKED
The cross-reference tracks:

•   Labels (lines ending with colon)

•   EQU/SET/DEFL definitions

•   PUBLIC declarations

•   EXTRN declarations

•   Macro names

•   All symbol references in instructions and expressions

Reserved words (instructions, directives, registers) are excluded from the listing.

EXAMPLES

Analyze a single file:
    ucref80 program.mac

Analyze multiple files:
    ucref80 main.mac io.mac util.mac

Save to file:
    ucref80 -o xref.txt *.mac

Analyze all .mac files:
    ucref80 *.mac

EXIT STATUS

0   Analysis successful.

1   Error occurred (file not found, etc.).

USE CASES

•   Finding unused symbols: Symbols with no references may be dead code.

•   Impact analysis: Before modifying a symbol, see everywhere it's used.

•   Code documentation: The cross-reference serves as a symbol index.

•   Debugging: Verify symbols are defined and referenced correctly.

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

The original Microsoft CREF manual is available at docs/external/cref_lib.pdf

LIMITATIONS

•   Only processes .MAC source files (not .REL object files).

•   Macro expansion is not performed; references inside macros are to the parameter names, not the expanded values.

•   Conditional assembly is not evaluated; all branches are scanned.

AUTHOR
um80 project contributors.