An assembler, simulator, and browser-based playground for a custom 16-bit instruction set.
Simple-Assembler/: Python assembler. It reads assembly source from standard input and writes machine code to standard output.SimpleSimulator/: Python simulator for the generated machine code.frontend/: React application for assembling and simulating programs in the browser.automatedTesting/: Grading scripts and reference programs for the assembler and simulator.
- Python 3
- Node.js and npm
- On Linux, Pillow may require
libjpeg-devandzlib1g-dev.
From the repository root:
pip3 install -r requirements.txt
cd frontend
npm cicd frontend
npm startThe development server opens the React application at http://localhost:3000.
To create a production build:
cd frontend
npm run buildThe compiled files are written to frontend/build/. The available npm start script runs the development server.
Assemble a source file and write the resulting machine code to a file:
cd Simple-Assembler
python3 assembler.py < ../path/to/program.asm > program.binRun the simulator by piping the generated machine code into it:
cd SimpleSimulator
python3 simulator.py < ../Simple-Assembler/program.binFrom the repository root, run:
cd automatedTesting
./runAvailable options:
--verbose: print verbose output.--no-asm: skip assembler tests.--no-sim: skip simulator tests.
For example:
./run --verbose --no-simRun the frontend unit tests with:
cd frontend
npm test