Skip to main content

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.

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/

Metadata

Release files for comet2txt 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comet2txt 1.0.1
File Size Uploaded
comet2txt-1.0.1.tar.gz 75.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for comet2txt 1.0.1
File Interpreter ABI Platform
comet2txt-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 82.0 kB

Release files / comet2txt-1.0.1.tar.gz

Download URL comet2txt-1.0.1.tar.gz
Size 75.7 kB
Tags Source
SHA-256 checksum
How to use checksums
019299ade335958e05ac096f1cbcd4b32f0258fab86513c273bb873e5e13e048
BLAKE2b-256 checksum
How to use checksums
19fef050740c864c874a4be66289ad47936c33db4e3754d8473f78180276db31
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / comet2txt-1.0.1-py3-none-any.whl

Download URL comet2txt-1.0.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9df770c13633e505b38714202ae31c2b0ea9df76044baf6278d5efef5dfff697
BLAKE2b-256 checksum
How to use checksums
bec02291f08a758fdb08790991cdbb98349780e612f3e4ea2dba0bdebed489a0
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page