Convert SAM Coupé Comet assembler source code to ASCII text
Project description
comet2txt
A Python program to convert SAM Coupé Comet assembler code to ASCII text.
The output text can be assembled using pyz80 for easier SAM development on modern operating systems.
Installation
Installing the tool doesn't require the source code or even Python, just uv.
Install uv if not already installed. Windows users can do that using:
winget install --id=astral-sh.uv -e
Then install the comet2txt command using:
uv tool install comet2txt
Usage
usage: comet2txt [-h] [-q] [-V] input_file [output_file]
Convert Comet assembler source to text
positional arguments:
input_file input .S file to convert
output_file output .asm file to write
options:
-h, --help show this help message and exit
-q, --quiet suppress conversion warnings
-V, --version show program's version number and exit
The input file is a .S file containing your Comet source code. Use SCADM or
SamDsk (not to be confused with SAMdisk!) to extract this from a disk image.
If no output file is supplied the converted output is written to the console.
Alternatives
Here are some existing solutions to perform the conversion, each with drawbacks:
COMET2A
Simon Cooke's Comet source convertor was released in 1995 and can convert in
both directions. It's a SAM program but can be run on real hardware or under
emulation to write the text output to a disk. The text can be extracted from a
disk image using tools such as SCADM.
There's an issue with nested comments that occur when commenting out code that already has an end of line comment. The nested comment is offset in the output and may be truncated or clipped entirely.
COM2TXT
Edwin Blink released a DOS utility in 2000, which was the official method to convert files on the PC for many years.
Modern 64-bit versions of Windows can no longer run DOS 16-bit binaries so it can no longer be executed directly. It's still possible to use under an emulated environment such as DOSbox or VirtualBox, or even FreeDOS booted natively, but it's less convenient.
Comet Print
Comet has a print function accessed via the Sym-C command menu, then entering
P to send the source listing to a connected printer. This uses the same
formatting code as the editor so compatibility is guaranteed. Running Comet
under SimCoupe you can configure a virtual printer to capture the print output
to a text file.
There's an issue with long source code lines that are clipped at 64 characters. The editor only shows 64 characters but some source files contain 66, so the final 2 characters of long comments may be lost during printing.
ChangeLog
2026-07-03
- Released as PyPi package v1.0.0, with API and CLI interfaces.
- Upgraded project development and build environment.
2025-05-05
- Initial commit.
Links
comet2txt - https://github.com/simonowen/comet2txt/
pyz80 - https://github.com/simonowen/pyz80/ (best used via VSCode extension)
SCADM - https://www.worldofsam.org/products/scadm
SimCoupe - https://simonowen.com/simcoupe/
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 comet2txt-1.0.0.tar.gz.
File metadata
- Download URL: comet2txt-1.0.0.tar.gz
- Upload date:
- Size: 75.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e2c0b1fa9f65f7832a1f0e3fb235a42e2456b66709280afe529c1eefd5d3fe5
|
|
| MD5 |
aa2b50e9f3caf7758d1e11684bb5aaa4
|
|
| BLAKE2b-256 |
add26a780eafd948e40f49e3aa6cc2084052779d91e91a9dc1b650a47605a77b
|
File details
Details for the file comet2txt-1.0.0-py3-none-any.whl.
File metadata
- Download URL: comet2txt-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f67e717e41a87c04f1fe118a9c441466b2de4a87d8f9bc3a98b8f10a82d2069c
|
|
| MD5 |
49ddcdbadc217ac5a17042efcd407010
|
|
| BLAKE2b-256 |
b5088146bfaf2936920303eabeed9b3fd8fbe6ccfa0e6f985c3efd222e4510fa
|