Skip to main content

A Python software implementation of the Intel 4004 processor.

Project description

Pyntel4004

Pyntel 4004 Logo

Build Pipeline Documentation Status GitHub PyPI version PyPI - Downloads Plant Tree

SonarCloud

A Python software implementation of the Intel 4004 processor and the MCS-4 computer.

General Information

  • Two pass assembler using the original mnemonics, directives and comments syntax
  • Disassembler
  • Monitor facility to step through code and examine registers, memory etc
  • Cross-assembler for Retroshield 4004 Arduino

Requirements

  • Python >= 3.8.2

Installation Instructions


PyPI

Pyntel4004 can be installed from PyPI by using the command:

    $ pip install Pyntel4004

Source Code

Pyntel4004’s git repo is available on GitHub, which can be browsed here and cloned using:

    $ git clone https://github.com/alshapton/pyntel4004 pyntel4004

Verify the installation by running unit tests:

    $ cd pyntel4004/test
    $ pytest

Questions, Answers and Issues

Please use the github discussion board for questions, to ensure the right people see them in a timely manner.

Github Pyntel4004 Discussion Board

and the github issue tracker to raise any issues.

Github Pyntel4004 Issues Board


Usage Instructions

To use this software implementation of the Intel 4004 from the command line, you should install the Pyntel4004-cli using pip install pyntel4004-cli

The user instructions can be found here

Design goals

  • As much of the internals as possible should be carried out using binary arithmetic and operations.
  • No 3rd party libraries to be used (i.e. pure Python).
  • Build a fully-working i4004 opcode emulator.
  • Build a fully-working assembler which generates correct op-codes.
  • Construct a fully-working software-based i4004 chip which can use the generated object code from the assembler.
  • Enable code assembled with Pyntel4004 to be run on a real i4004 chipset
  • Enable code assembled with Pyntel4004 to be run on a retroShield4004 for Arduino

Status

22-MAY-2022 First release of configuration file support 20-MAR-2022: Command Line functionality is now deprecated 02-MAR-2022: Finalised split - Pyntel4004 is now the core library 21-FEB-2022: Started to split into two - (chip, assembler, dissassembler) and CLI 04-FEB-2022: Cross-assemble to retroShield4004 for Arduino, completing documentation 23-SEP-2021: Publishing releases to PyPi
10-SEP-2021: Documentation building and hosted with READTHEDOCS
12-JUN-2021: Auto-build with GITHUB Actions implemented
18-MAY-2021: Implementing full test suite
21-APR-2021: Instruction Set functionally complete Entering Testing Phase

Example

Assembler Directives and other additions

Assembler directives are not part of the program itself, but can control things like starting address, and various environmental settings.

Directive Example Meaning
end end Indicating end of program, but not necessarily end of code
org org 100 Assemble and place object code commencing at address 100
pin pin 1 Value of i4004's Pin 10 (test pin)
/ / Author: ALS A comment
label, loop, A label can be referred to in various control transfer statements. It MUST end in a comma (,)

Assemble and Run

Monitor Commands

Command Example Meaning
"Enter" "Enter" Execute the current instruction and move to the next
acc acc Show the current contents of the Accumulator
b n b 71 Create a breakpoint at address n
carry carry Show the current contents of the Carry Bit
crb crb Show the currently selected RAM Bank
off off Continue to execute the program with no trace
pc pc Show the Program Counter
pin10 pin10 Show the status of PIN10 on the i4004 chip (test pin)
q q Quit the monitor without executing any further commands
ram ram Show the complete contents of RAM
reg n reg 7 Show content of a specified register
regs regs Show all 16 registers
rom rom Show the complete contents of ROM
stack stack Show the stack and the location of the stack pointer

Licence

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Credits

Pyntel 4004 Logo

.. _Python: https://www.python.org

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

Pyntel4004-1.0.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

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

Pyntel4004-1.0.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file Pyntel4004-1.0.0.tar.gz.

File metadata

  • Download URL: Pyntel4004-1.0.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for Pyntel4004-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8aca9ec8c75a5f74bdb2c8a4e8b049416b25681a8fe001bed3a300997c98d651
MD5 d806a6849ce27ff8b265b1fc84c7131b
BLAKE2b-256 56c09366ef7fc2003c69ffd55d3bc7a9fd27a9af142ce3d7f50c29cf9942a26e

See more details on using hashes here.

File details

Details for the file Pyntel4004-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: Pyntel4004-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for Pyntel4004-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61d9e1942dd066d4f3371fe7069e6f579da503024da049f567db3aca59e27ab4
MD5 ca8fde2571a63805c7de42497b3be4e6
BLAKE2b-256 a6fa9a27911b91803311ad6050c0c426ea400cda31d644f78dde9ff5d2ab0114

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