Skip to main content

pythonRSC ( Relatively Simple Computer in Python )

pythonRSC is an emulator for the RSC architecture written in Python.

With this program, you can generate bytecode from microcode files for Logisim or just emulate microcode files out right. Additionally, you can debug your program and see its every step or even generate a control flow graph of your emulated program.

Introduction Video

Installing pythonRSC

To download the package, you can simply use pip.

pip install pythonRSC

Emulating your microcode using pythonRSC

After downloading the package, you should have access to a command called 'pythonRSC'. To use this command, you will need a microcode file to emulate. There are some test files provided.

pythonRSC run microcode.txt

This will parse the given microcode and output the state at the end of emulation.

Generating bytecode using pythonRSC

If you desire to use the in-built assembler to parse the microcode into logisim bytecode, there is a command for that. You will need to provide a microcode input file and it requires an output file to function.

pythonRSC assemble microcode.txt -o output.txt

Emulating and debugging your microcode (timelessly) using pythonRSC

If you want to debug your program, pythonRSC provides an easy-to-use debugger similar to GDB Debugger, but it is timeless! Timeless means you can go forwards and backwards in execution, so this will prevent you having to restart the emulator chasing an issue. To start the emulator with the debugger, use the following command.

pythonRSC debug microcode.txt

After executing, you will be met with a blinking >> awaiting your next command. The list of commands accepted by the debugger are listed below.

stepi [stepsize] This will 'step' forward once if stepsize is not provided, otherwise it will step as many times as provided in stepsize.

backi [stepsize] This will 'step' backwards once if stepsize is not provided, otherwise it will step as many times as provided in stepsize.

bp [addr|label] ... This will set a breakpoint at the given address(es) in hex or decimal or at given label(s). Breakpoints are enabled on initialization.

enable [addr|label] ... This will turn on a breakpoint if it was disabled, it can take a variadic amount of breakpoints to be enabled.

disable [addr|label] ... This will turn off a breakpoint, it can take a variadic amount of breakpoints to be disabled.

disas [start] [end] This will take a range of addresses and disassemble the instructions. Hexadecimal or decimal.

disas This variation of the disassemble command will try to identify if you are inside a label and disassemble that label for you.

print [type] [reg] This will print a register in your desired format (type). The types are /d (decimal) /t (binary) /x (hexadecimal).

run Resumes emulation unless a breakpoint is hit or HALT is met.

info This will print the current state of the emulator, in other words print all registers.

help This will just list the possible commands.

Generating a control flow graph for your microcode

If you wish to generate a control flow graph from your microcode, you simply pass a flag to the CLI.

pythonRSC run microcode.txt -cfg pdf or pythonRSC debug microcode.txt -cfg png

Graphviz is required to be downloaded and on your PATH for this to work properly.

The control flow graph will appear at the end of execution. The graph is rendered using Graphviz and the library pythonCFG.

An example graph:

image

Metadata

Release files for pythonRSC 1.2.3

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

Source distribution (sdist)

Source distribution for pythonRSC 1.2.3
File Size Uploaded Provenance Actions
pythonRSC-1.2.3.tar.gz 23.3 kB Without provenance Details for pythonRSC-1.2.3.tar.gz

Built distribution (wheel)

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

Total release size: 46.1 kB

Release files / pythonRSC-1.2.3.tar.gz

Download URL pythonRSC-1.2.3.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
aec2fd20a81c1cada90f88bebbe054785847ff577d2964ad820ed51b3c7db521
BLAKE2b-256 checksum
How to use checksums
a9a92f8f879d0c1ab91ba61fc3c74a3628070f7a31c2864504520be7125423af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / pythonRSC-1.2.3-py3-none-any.whl

Download URL pythonRSC-1.2.3-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e3e779fe3a18b6256a4bb4fc056c062927ab68569b96c8f3ba6ea87bcbd05ab
BLAKE2b-256 checksum
How to use checksums
dc9ad42120f9cbd8a92095211068ea2408f22ccf1cae06063ad09f798d1d14ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for pythonRSC 1.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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