MCPcopy Index your code
hub / github.com/6809/MC6809

github.com/6809/MC6809 @v0.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8.0 ↗ · + Follow
677 symbols 2,392 edges 71 files 179 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MC6809 CPU emulator written in Python

MC6809 is a Open source (GPL v3 or later) emulator for the legendary 6809 CPU, used old homecomputer Dragon 32/64 and Tandy TRS-80 Color Computer (CoCo) built in the 1980s...

Tested with Python 3.8, 3.9, 3.10 and PyPy3

tests codecov MC6809 @ PyPi Python Versions License GPL-3.0-or-later

A example usage can be find in: MC6809/example6809.py

Getting started:

~$ git clone https://github.com/6809/MC6809.git
~$ cd MC6809
~/MC6809 $ ./cli.py --help

The output of ./cli.py --help looks like:

usage: ./cli.py [-h] {benchmark,example,profile,version}



╭─ options ────────────────────────────────────────────────────────────────────────╮
│ -h, --help        show this help message and exit                                │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─ subcommands ────────────────────────────────────────────────────────────────────╮
│ {benchmark,example,profile,version}                                              │
│     benchmark     Run a MC6809 emulation benchmark                               │
│     example       Just run the MC6809/example6809.py example (CRC32 calculation) │
│     profile       Profile the MC6809 emulation benchmark                         │
│     version       Print version and exit                                         │
╰──────────────────────────────────────────────────────────────────────────────────╯

There is a simple benchmark. Run e.g.:

~/MC6809$ ./cli.py benchmark --help

The output of ./cli.py benchmark --help looks like:

usage: ./cli.py benchmark [-h] [--loops INT] [--multiply INT] [-v]

Run a MC6809 emulation benchmark

╭─ options ──────────────────────────────────────────────────────────────────────╮
│ -h, --help             show this help message and exit                         │
│ --loops INT            How many benchmark loops should be run? (default: 6)    │
│ --multiply INT         Process data multiplier (default: 15)                   │
│ -v, --verbosity        Verbosity level; e.g.: -v, -vv, -vvv, etc. (repeatable) │
╰────────────────────────────────────────────────────────────────────────────────╯

profile

You can run the Python profiler against the benchmark, e.g.:

~/MC6809$ ./cli.py profile --help

The output of ./cli.py profile --help looks like:

usage: ./cli.py profile [-h] [--loops INT] [--multiply INT] [-v]

Profile the MC6809 emulation benchmark

╭─ options ──────────────────────────────────────────────────────────────────────╮
│ -h, --help             show this help message and exit                         │
│ --loops INT            How many benchmark loops should be run? (default: 6)    │
│ --multiply INT         Process data multiplier (default: 15)                   │
│ -v, --verbosity        Verbosity level; e.g.: -v, -vv, -vvv, etc. (repeatable) │
╰────────────────────────────────────────────────────────────────────────────────╯

development

For development exists dev-cli, e.g.:

~/MC6809$ ./dev-cli.py --help

The output of ./dev-cli.py --help looks like:

usage: ./dev-cli.py [-h]
                    {coverage,install,lint,mypy,nox,pip-audit,publish,test,update,update-readme-history,update-test-sn
apshot-files,version}



╭─ options ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ -h, --help        show this help message and exit                                                                  │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ subcommands ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ {coverage,install,lint,mypy,nox,pip-audit,publish,test,update,update-readme-history,update-test-snapshot-files,ver │
│ sion}                                                                                                              │
│     coverage      Run tests and show coverage report.                                                              │
│     install       Install requirements and 'MC6809' via pip as editable.                                           │
│     lint          Check/fix code style by run: "ruff check --fix"                                                  │
│     mypy          Run Mypy (configured in pyproject.toml)                                                          │
│     nox           Run nox                                                                                          │
│     pip-audit     Run pip-audit check against current requirements files                                           │
│     publish       Build and upload this project to PyPi                                                            │
│     test          Run unittests                                                                                    │
│     update        Update dependencies (uv.lock) and git pre-commit hooks                                           │
│     update-readme-history                                                                                          │
│                   Update project history base on git commits/tags in README.md Will be exited with 1 if the        │
│                   README.md was updated otherwise with 0.                                                          │
│                                                                                                                    │
│                   Also, callable via e.g.:                                                                         │
│                       python -m cli_base update-readme-history -v                                                  │
│     update-test-snapshot-files                                                                                     │
│                   Update all test snapshot files (by remove and recreate all snapshot files)                       │
│     version       Print version and exit                                                                           │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Run tests, e.g.:

~/DragonPy$ ./dev-cli.py coverage
# or just:
~/DragonPy$ ./dev-cli.py test
# or with different Python versions:
~/DragonPy$ ./dev-cli.py tox

TODO

  • Update 'cpu6809_html_debug.py'
  • Use bottle for http control server part
  • unimplemented OPs:
  • RESET
  • SWI / SWI2 / SWI3
  • SYNC

Make new release

We use cli-base-utilities to generate the history in this README.

To make a new release, do this:

  • Increase your project version number
  • Run tests to update the README
  • commit the changes
  • Create release

History

(Some of the points are related to DragonPy Emulator)

  • v0.8.0
  • 2025-09-20 - Update CLI
  • 2025-09-20 - Add PyCharm run config files
  • 2025-09-20 - manageprojects template "piptools" -> "uv"
  • 2025-09-20 - Update requirements
  • v0.7.3
  • 2024-09-24 - Bugfix "publish" command
  • 2024-09-24 - Add "example" command to app CLI
  • 2024-09-24 - + pre-commit hook
  • 2024-09-24 - Split CLI by manageprojects updates
  • 2024-09-24 - Update requirements
  • 2023-11-29 - Update requirements + fix code style + manageprojects updates
  • v0.7.2
  • 2023-11-03 - Auto generate README history
  • 2023-11-03 - Fix code style
  • 2023-11-03 - Apply manageprojects updates + Update requirements
  • 2023-11-03 - Use verbose_check_call from cli_base
  • 2023-11-02 - Bump pip from 23.2.1 to 23.3
  • v0.7.1
  • 2023-08-05 - fix publish call
  • 2023-08-05 - Split CLI by apply manageprojects update
  • 2023-08-04 - Update requirements

Expand older history entries ...

  • v0.7.0
  • 2023-03-07 - Add "benchmark" and "profile" to CLI and remove dev-shell add DocTests
  • 2023-03-07 - Apply managedprojects update: Add DocTests via bx_py_utils helper
  • 2023-03-06 - Update README.md
  • 2023-03-06 - Migrate to https://github.com/jedie/cookiecutter_templates
  • 2022-09-04 - deactivate pypy3
  • 2022-09-04 - fix tests under windows
  • 2022-09-04 - fix code style
  • 2022-09-04 - replace Makefile with "dev-shell"
  • 2022-09-04 - update Makefile
  • 2022-09-04 - update README
  • 2022-09-04 - small code update
  • 2022-09-04 - remove travis config
  • 2022-09-04 - flynt updates
  • 2022-09-04 - fix flynt call
  • 2022-09-04 - replace Creole README with markdown
  • 2022-09-04 - fix pytest config
  • 2022-09-04 - update github CI
  • 2022-09-04 - add "make update"
  • 2022-09-04 - fix editorconfig
  • v0.6.0
  • 2020-02-10 - update CLI Tests
  • 2020-02-10 - git ignore: +/publish.log
  • 2020-02-10 - update CLI and README
  • 2020-02-10 - test release v0.6.0.dev0
  • 2020-02-10 - swap autopep8 and isort
  • 2020-02-10 - update Travis CI config
  • 2020-02-10 - fix code style
  • 2020-02-10 - update .join() statements
  • 2020-02-10 - setup poetry-publish
  • 2020-02-10 - apply pyupgrade
  • 2020-02-10 - apply code formatter
  • 2020-02-10 - f-strings convert
  • 2020-02-10 - WIP
  • v0.5.0
  • 2015-10-19 - update release info/Version
  • 2015-09-10 - try to install python on osx
  • 2015-09-03 - move Condition Code Register (CC) into CPU via mixin class
  • 2015-09-03 - rename mixin classes
  • 2015-09-03 - code cleanup
  • 2015-09-03 - rename base class
  • 2015-09-03 - Optimize: Don't return value. Because not needed in every case.
  • 2015-09-03 - do it directly
  • 2015-09-03 - remove .get() calls
  • 2015-09-03 - update README and version number
  • 2015-09-01 - OSX builds do not yet support Python :(
  • 2015-09-01 - refactor/move self._convert_differend_width()
  • 2015-09-01 - Bugfix _convert_differend_width()
  • 2015-08-31 - display report
  • 2015-08-31 - Append coverage data to .coverage
  • 2015-08-31 - WIP
  • 2015-08-31 - try to run DragonPy tests, too.
  • 2015-08-31 - obsolete since nose use
  • 2015-08-26 - WIP: speedlimit <-> normal
  • 2015-08-25 - Update README.creole
  • 2015-08-24 - WIP: Split CPU code
  • v0.4.6
  • 2015-08-24 - Update README. Release as v0.4.6
  • 2015-08-24 - change speed limit stuff.
  • v0.4.5
  • 2015-08-21 - release v0.4.5
  • 2015-08-21 - update history
  • 2015-08-21 - add cli information for run via subprocess in DragonPy
  • 2015-08-21 - use click CliRunner().invoke() for cli test
  • 2015-08-21 - add info text to cli
  • 2015-08-21 - deactivate 'cpu6809_html_debug.py' - TODO: update it!
  • 2015-08-21 - cleanup
  • 2015-08-21 - Update README.creole
  • 2015-08-20 - define the entrypoint name
  • 2015-08-10 - update PyPi/Hithub links
  • v0.4.4
  • 2015-08-10 - bugfix example to run with py2 and py3
  • 2015-08-10 - remove run tests from cli
  • 2015-08-10 - remove obsolete code (has run unittests two times)
  • 2015-08-10 - test the example, too
  • v0.4.3
  • 2015-08-10 - update from:
  • 2015-08-10 - just see that nose not fail: TODO update!
  • 2015-08-10 - bugfix ;)
  • 2015-08-10 - obsolete
  • 2015-08-10 - use click
  • 2015-08-10 - cleanup
  • 2015-08-10 - Exclude from nose
  • 2015-08-10 - start using nose
  • 2015-07-02 - add flattr link
  • v0.4.2
  • 2015-05-27 - relase as v0.4.2
  • 2015-05-27 - Add MC6809/example6809.py
  • 2015-05-27 - add CPU instance in CPU to memory
  • v0.4.1
  • 2015-05-26 - Tested with Python 2.7, 3.4 and PyPy
  • v0.4.0
  • 2015-05-26 - remove obsolete file
  • 2015-05-26 - cleanup
  • 2015-05-26 - +click +MC6809 cli entry point
  • 2015-05-26 - Add unittest for cli and add "--multiply" to benchmark
  • 2015-05-26 - fixup! add --source=MC6809
  • 2015-05-26 - add --source=MC6809
  • 2015-05-26 - remove dragonlib
  • 2015-05-26 - update coveralls token
  • 2015-05

Core symbols most depended-on inside this repo

set
called by 171
MC6809/components/mc6809_cc_register.py
set_cc
called by 49
MC6809/components/mc6809_cc_register.py
read_word
called by 33
MC6809/components/memory.py
write_byte
called by 28
MC6809/components/memory.py
get_cc_value
called by 28
MC6809/components/mc6809_cc_register.py
read_byte
called by 27
MC6809/components/memory.py
write_word
called by 17
MC6809/components/memory.py
get_ea_indexed
called by 16
MC6809/components/mc6809_addressing.py

Shape

Method 532
Function 75
Class 70

Languages

Python100%

Modules by API surface

MC6809/components/cpu_utils/instruction_call.py76 symbols
MC6809/tests/test_cpu6809.py52 symbols
MC6809/components/mc6809_base.py47 symbols
MC6809/components/mc6809_cc_register.py33 symbols
MC6809/core/cpu_control_server.py26 symbols
MC6809/tests/test_6809_branch_instructions.py25 symbols
MC6809/tests/test_6809_arithmetic.py23 symbols
MC6809/components/cpu_utils/MC6809_registers.py22 symbols
MC6809/components/memory.py21 symbols
MC6809/components/mc6809_ops_logic.py21 symbols
MC6809/tests/test_6809_address_modes.py20 symbols
MC6809/components/mc6809_ops_branches.py20 symbols

For agents

$ claude mcp add MC6809 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact