Microsoft MACRO-80 compatible assembler toolchain for Linux
Project description
um80 - Microsoft MACRO-80 Compatible Toolchain for Linux
A complete Unix/Linux implementation of Microsoft's classic CP/M development tools from the 1980s:
- um80 - MACRO-80 compatible assembler for 8080/Z80
- ul80 - LINK-80 compatible linker
- ulib80 - LIB-80 compatible library manager
- ucref80 - Cross-reference utility
- ud80 - 8080/Z80 disassembler for CP/M .COM files
- ux80 - 8080 to Z80 assembly source translator
These tools can assemble, link, and manage 8080/Z80 assembly code to produce CP/M-compatible .COM executables on modern Linux systems.
Installation
From PyPI (recommended)
pip install um80
From source
git clone https://github.com/um80/um80_and_friends.git
cd um80_and_friends
pip install -e .
Quick Start
Assemble a source file
um80 program.mac # Creates program.rel
um80 -o output.rel program.mac # Specify output name
um80 -l listing.prn program.mac # Generate listing file
um80 -g program.mac # Export all symbols as PUBLIC (for debug)
Link object files
ul80 program.rel # Creates program.com
ul80 -o output.com a.rel b.rel # Link multiple files
ul80 -s program.rel # Generate symbol file (.sym)
ul80 -S symbols.sym program.rel # Specify symbol file name
ul80 -p E000 program.rel # Set origin address (hex)
ul80 --prl program.rel # Output MP/M .PRL format
Disassemble a COM file
ud80 program.com # Creates program.mac
ud80 -z program.com # Z80 mode
ud80 -e 0200 program.com # Add entry point at 0200h
ud80 -d 0500-05FF program.com # Mark range as data
Create/manage libraries
ulib80 -c mylib.lib a.rel b.rel # Create library
ulib80 -l mylib.lib # List contents
ulib80 -p mylib.lib # Show public symbols
ulib80 -x mylib.lib module # Extract module
ulib80 -a mylib.lib new.rel # Add module
ulib80 -d mylib.lib module # Delete module
Generate cross-reference
ucref80 program.mac # Print to stdout
ucref80 -o xref.txt *.mac # Output to file
Translate 8080 to Z80 assembly
ux80 program.mac # Creates program_z80.mac
ux80 -o output.mac program.mac # Specify output name
Tools Reference
um80 - Assembler
Microsoft MACRO-80 compatible assembler supporting:
- 8080 and Z80 instruction sets
- Macros with parameters (MACRO/ENDM)
- Repeat blocks (REPT, IRP, IRPC)
- Conditional assembly (IF/ELSE/ENDIF, IFDEF, etc.)
- Segments (CSEG, DSEG, ASEG, COMMON)
- PUBLIC/EXTRN for module linking
- Include files
- All standard directives (ORG, EQU, SET, DB, DW, DS, etc.)
See man um80 for full documentation, or refer to the original Microsoft M80 Manual.
ul80 - Linker
LINK-80 compatible linker that:
- Links multiple .REL relocatable object files
- Resolves external references
- Produces CP/M .COM executables
- Supports COMMON blocks
- Can output Intel HEX format
- Can output MP/M .PRL (Page Relocatable) format
- Provides
__END__symbol for dynamic memory allocation
Predefined Symbols
The linker provides a predefined __END__ symbol that points to the first free byte after all linked segments (code + data + common blocks). This is useful for implementing heap allocation:
EXTRN __END__ ; Import linker symbol
START: LXI H,__END__ ; Load end of program
SHLD HEAP ; Initialize heap pointer
...
DSEG
HEAP: DW 0 ; Heap pointer
See man ul80 for full documentation, or refer to the original Microsoft L80 Manual.
ulib80 - Library Manager
LIB-80 compatible library manager for:
- Creating .LIB library archives
- Listing library contents and public symbols
- Adding/removing/extracting modules
See man ulib80 for full documentation, or refer to the original Microsoft CREF/LIB Manual.
ucref80 - Cross-Reference
Generates cross-reference listings showing:
- Symbol definitions
- Symbol references by file and line
- PUBLIC and EXTRN declarations
See man ucref80 for full documentation.
ud80 - Disassembler
8080/Z80 disassembler that:
- Disassembles CP/M .COM files to .MAC source
- Produces output compatible with um80
- Supports both 8080 and Z80 instruction sets
- Allows marking data ranges and entry points
- Generates re-assemblable source code
See man ud80 for full documentation (no Microsoft equivalent exists).
ux80 - 8080 to Z80 Translator
Source-to-source translator that converts Intel 8080 assembly to Zilog Z80 assembly:
- Translates all 8080 instructions to equivalent Z80 mnemonics
- Preserves all comments, labels, and formatting
- Produces byte-identical output when assembled
- Automatically adds
.Z80directive to output - Handles all assembler directives (passes them through unchanged)
Translation examples:
| 8080 | Z80 |
|---|---|
MOV A,B |
LD A,B |
MVI A,42H |
LD A,42H |
LXI H,1234H |
LD HL,1234H |
LDA addr |
LD A,(addr) |
LHLD addr |
LD HL,(addr) |
LDAX B |
LD A,(BC) |
INR A |
INC A |
INX H |
INC HL |
DAD D |
ADD HL,DE |
ADD B |
ADD B |
ADI 10 |
ADD 10 |
JMP addr |
JP addr |
JNZ addr |
JP NZ,addr |
CALL addr |
CALL addr |
CNZ addr |
CALL NZ,addr |
RET / RNZ |
RET / RET NZ |
RLC |
RLCA |
CMA |
CPL |
HLT |
HALT |
PCHL |
JP (HL) |
XCHG |
EX DE,HL |
IN port |
IN A,(port) |
OUT port |
OUT (port),A |
PSW |
AF |
M (memory) |
(HL) |
See man ux80 for full documentation.
File Formats
| Extension | Description |
|---|---|
| .MAC | Assembly source (MACRO-80 format) |
| .REL | Relocatable object file |
| .COM | CP/M executable |
| .PRL | MP/M Page Relocatable executable |
| .LIB | Library archive |
| .PRN | Assembly listing |
| .SYM | Symbol file |
Compatibility Notes
These tools aim for compatibility with the original Microsoft tools while running on modern Unix/Linux systems:
- Source files use Unix line endings (LF), but CR/LF is also accepted
- File names are case-insensitive for symbols (converted to uppercase)
- Default origin is 0100h (standard CP/M load address)
- Output files are binary-compatible with original CP/M tools
Documentation
- Man pages:
man um80,man ul80,man ulib80,man ucref80,man ud80,man ux80 - Original Microsoft manuals in
docs/external/:m80.pdf- MACRO-80 assemblerl80.pdf- LINK-80 linkercref_lib.pdf- CREF and LIB-808080asm.pdf- 8080 assembly reference
Example Workflow
# Assemble source files
um80 -o main.rel main.mac
um80 -o util.rel util.mac
# Create a library
ulib80 -c mylib.lib helper.rel support.rel
# Link everything together
ul80 -o program.com main.rel util.rel mylib.lib
# Run in CP/M emulator
cpm program.com
Installing Man Pages
After pip installation, install the man pages manually:
# Find where the package is installed
PKGDIR=$(python3 -c "import um80; print(um80.__path__[0])")
# Copy man pages to system location (requires sudo)
sudo cp "$PKGDIR/../docs/man/"*.1 /usr/local/share/man/man1/
sudo mandb
Or view them directly:
man docs/man/um80.1
License
GNU General Public License v3.0 or later (GPLv3+). See LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file um80-0.3.16.tar.gz.
File metadata
- Download URL: um80-0.3.16.tar.gz
- Upload date:
- Size: 26.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac5083fe27897f14060904380393ee5877b8a5869ab71f66362d81ef57df9c31
|
|
| MD5 |
1a4e700a42b2b005c2cbce9a0ce49fba
|
|
| BLAKE2b-256 |
9d1ef03cf8610162731634c17c04c9dafc28c913e4a08702c0846566b47d055e
|
File details
Details for the file um80-0.3.16-py3-none-any.whl.
File metadata
- Download URL: um80-0.3.16-py3-none-any.whl
- Upload date:
- Size: 79.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d28e70f262ef032677e7a821ba59e17a4d931672d7f4502149240c2d7ef0705b
|
|
| MD5 |
762206c090b667949bf87b527a3ee375
|
|
| BLAKE2b-256 |
075927d39cac7ee963a0b193084b83937a1835b1ee1a8570d3a2dbbeb471e5cf
|