A Python software implementation of the Intel 4004 processor

Overview

Pyntel4004

Pyntel 4004 Logo

Build Pipeline Documentation Status GitHub Codacy Badge DeepSource DeepSource PyPI version PyPI - Downloads Plant Tree

A Python software implementation of the Intel 4004 processor.

General Information

  • Two pass assembler using the original mnemonics, directives and comments syntax
  • Monitor facility to step through code and examine registers, memory etc

Requirements

  • Python_ >= 3.8.2

Installation Instructions


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

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 compiler (possibly using micro-python or circuit python on an Ardiuno Board).

Status

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

Comments
  • Documentation fails to build correctly

    Documentation fails to build correctly

    Sphinx error messages:

    350 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:41: WARNING: Literal block expected; none found. 351 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:79: WARNING: Inline emphasis start-string without end-string. 352 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:118: WARNING: Line block ends without a blank line. 353 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:127: WARNING: Line block ends without a blank line. 354 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:139: WARNING: Inline literal start-string without end-string. 355 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:157: WARNING: Inline literal start-string without end-string. 356 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:157: WARNING: Inline interpreted text or phrase reference start-string without end-string. 357 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:118: ERROR: Undefined substitution referenced: "---". 358 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:118: ERROR: Undefined substitution referenced: "----". 359 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:118: ERROR: Undefined substitution referenced: "Invalid Parameter Combination: --quiet and --monitor cannot be used together | | asm | BadOptionUsage | --type |Invalid output type specified | | asm | BadOptionUsage | --type |Cannot specify 'ALL' with any others". 360 looking for now-outdated files... none found 361 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:118: ERROR: Undefined substitution referenced: "dis". 362 /home/runner/work/Pyntel4004/Pyntel4004/docs/source/intro/usage.rst:127: ERROR: Undefined substitution referenced: "-----------".

    documentation 
    opened by alshapton 1
  • Merge Development changes into Main (Release 0.0.1-alpha.6

    Merge Development changes into Main (Release 0.0.1-alpha.6

    [0.0.1-alpha.6] - 2021-10-24

    Added

    • Tests for WPM instruction
    • Tests for SBM instruction
    • Abstracted and tested new suboperations
    • Tests now over 98% of opcode code

    Changed

    Deprecated

    Fixed

    • Some small bugs in the WPM instruction code
    • Abstracted some functions for readability

    Removed

    Security

    opened by alshapton 1
  • Develop

    Develop

    • Improved Assembler code by simplifying
    • Simplified some low-level instruction code
    • Corrected code styling
    • Updated RDx and RDR functions
    • Completed WMP, WRx and WRR functions
    opened by alshapton 1
  • A few questions about the 4004..

    A few questions about the 4004..

    The instructions SRC and DCL save an io address / bank to read/write from the rom/ram. Where is this address saved to? Are there extra registers on the 4004 where the SRC address and DCL bank gets saved? Or is this save handled by the RAM or ROM chips? Or is it saved on the board somehow?

    The WPM instruction is the most confusing to me. Where is the "Program RAM" stored? Is it ultimately writing to the RAM, or the ROM or someplace else? Why use this instruction instead of WRM for example?

    Thank you!

    opened by veniamin-ilmer 1
  • Complete Documentation

    Complete Documentation

    Complete documentation and colourise where possible

    Check "implemented" tags on each of the 46 instruction pages

    Check that all "see section X" have been removed and replaced with cross references

    Index and document code (using docstrings)

    opened by alshapton 0
Owner
alshapton
SpaceX Enthusiast, coder, architect, doer-of-stuff
alshapton
Let's pretend you want to create a AWS Lambda project called "sns-processor".

Usage Let's pretend you want to create a AWS Lambda project called "sns-processor". Rather than using lambda and then editing the results to include y

null 1 Dec 31, 2021
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
EasyBuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way.

EasyBuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way.

EasyBuild community 87 Dec 27, 2022
Minutaria is a basic educational Python timer used to learn python and software testing libraries.

minutaria minutaria is a basic educational Python timer. The project is educational, it aims to teach myself programming, python programming, python's

null 1 Jul 16, 2021
An ongoing curated list of frameworks, libraries, learning tutorials, software and resources in Python Language.

Python Development Welcome to the world of Python. An ongoing curated list of frameworks, libraries, learning tutorials, software and resources in Pyt

Paul Veillard 2 Dec 24, 2021
Hashcrack - A non-object oriented open source, Software for Windows/Linux made in Python 3

Multi Force This project is a non-object oriented open source, Software for Wind

Radiationbolt 3 Jan 2, 2023
The Open edX platform, the software that powers edX!

This is the core repository of the Open edX software. It includes the LMS (student-facing, delivering courseware), and Studio (course authoring) compo

edX 6.2k Jan 1, 2023
Nimbus - Open Source Cloud Computing Software - 100% Apache2 licensed

⚠️ The Nimbus infrastructure project is no longer under development. ⚠️ For more information, please read the news announcement. If you are interested

Nimbus 194 Jun 30, 2022
pspsps(1) is a compyuter software to call an online catgirl to the Linux terminyal.

pspsps(1): call a catgirl from the Internyet to the Linux terminyal show processes: ps show catgirls: pspsps —@[email protected] pspsps(1) is a compyute

Melissa Boiko 32 Dec 19, 2022
An open letter in support of Richard Matthew Stallman being reinstated by the Free Software Foundation

An open letter in support of RMS. To sign, click here and name the file <username>.yaml (replace <username> with your name) with the following content

null 2.4k Jan 7, 2023
A deployer and package manager for OceanBase open-source software.

OceanBase Deploy OceanBase Deploy (简称 OBD)是 OceanBase 开源软件的安装部署工具。OBD 同时也是包管理器,可以用来管理 OceanBase 所有的开源软件。本文介绍如何安装 OBD、使用 OBD 和 OBD 的命令。 安装 OBD 您可以使用以下方

OceanBase 59 Dec 27, 2022
LSO, also known as Linux Swap Operator, is a software with both GUI and terminal versions that you can manage the Swap area for Linux operating systems.

LSO - Linux Swap Operator Türkçe - LSO Nedir? LSO, diğer adıyla Linux Swap Operator Linux işletim sistemleri için Swap alanını yönetebileceğiniz hem G

Eren İnce 4 Feb 9, 2022
Choice Coin 633 Dec 23, 2022
A basic ticketing software.

Ticketer A basic ticketing software. Screenshots Program Launched Issuing Ticket Show your Ticket Entry Done Program Exited Code Features to implement

Samyak Jain 2 Feb 10, 2022
The official repository of iGEM Paris Bettencourt team's software tools.

iGEM_ParisBettencourt21 The official repository of iGEM Paris Bettencourt team's software tools. Cell counting There are two programs dedicated to the

Abhay Koushik 1 Oct 21, 2021
Modify version of impacket wmiexec.py, get output(data,response) from registry, don't need SMB connection, also bypassing antivirus-software in lateral movement like WMIHACKER.

wmiexec-RegOut Modify version of impacket wmiexec.py,wmipersist.py. Got output(data,response) from registry, don't need SMB connection, but I'm in the

小离 228 Jan 4, 2023
Launcher program to select which version of the Q-Sys software to launch.

QSC-QSYS Launcher Launcher program to select which version of the Q-Sys software to launch. Instructions To use the application simply save the "Q-Sys

Zach Lisko 2 Sep 28, 2022
A software dedicated to automaticaly select the agent of your desire in Valorant

AUTOPICKER A software dedicated to automaticaly select the agent of your desire in Valorant GUIDE Before stariting to use this program check if you ha

p1n00 0 Sep 24, 2022