Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comet2txt-1.0.1.tar.gz (75.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

comet2txt-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file comet2txt-1.0.1.tar.gz.

File metadata

  • Download URL: comet2txt-1.0.1.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

Hashes for comet2txt-1.0.1.tar.gz
Algorithm Hash digest
SHA256 019299ade335958e05ac096f1cbcd4b32f0258fab86513c273bb873e5e13e048
MD5 35ef6eec4ffeb419cb40317be7e4f664
BLAKE2b-256 19fef050740c864c874a4be66289ad47936c33db4e3754d8473f78180276db31

See more details on using hashes here.

File details

Details for the file comet2txt-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: comet2txt-1.0.1-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

Hashes for comet2txt-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9df770c13633e505b38714202ae31c2b0ea9df76044baf6278d5efef5dfff697
MD5 0cb68cd9658a906d88692aee64bfc7c3
BLAKE2b-256 bec02291f08a758fdb08790991cdbb98349780e612f3e4ea2dba0bdebed489a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page