A free and open-source Intel 8051 emulator built with Python (Brython) and React (with MUI) as a final thesis (BE).
Clone the repo (Installing Git):
git clone https://github.com/estarq/i8051emu
Change directory:
cd i8051emu
Docker (Installing Docker)
Use Compose (Installing Compose):
docker compose up -d
or
Build an image:
docker build -t i8051emu .
Run as a container:
docker run -d -p 3000:3000 --name i8051emu i8051emu
Install dependencies (Installing Node.js):
npm install --legacy-peer-deps
Compile JSX, bundle up dependencies, optimize the output:
npm run build
Follow the steps for Web
, then:
Change directory:
cd electron
Install dependencies:
npm install
Build for Mac (arm64, x64):
npm run distMac
Build for Linux (AppImage):
npm run distLinux
Build for Window:
npm run distWindows
Executable files are saved to electron/dist/
.
Webserver is required because of restrictions of the "file" protocol (Brython makes Ajax calls), thus Electron app utilizes Express to serve static content and the firewall may prompt to accept incoming network connections.
Most of the python code is covered with unit tests (pytest).
Please note that because of Brython, not everything that passes the tests is guaranteed to work, so it's necessary to test everything in a browser.
Download the latest release.
Docker (Installing Docker)
Pull from Docker Hub:
docker pull estarq/i8051emu
Superuser privileges may be required.
Doubleclick on .dmg
file and move i8051emu.app
to Applications
.
Doubleclick on .AppImage
file.
Make it executable if necessary:
chmod +x i8051emu-1.0.0.AppImage
Doubleclick on .exe
file.
Docker (Installing Docker)
Download an image and run it as a container:
docker run -d -p 3000:3000 --name i8051emu estarq/i8051emu
Superuser privileges may be required.
1st - Loading an Intel HEX file from the disk
2nd - Resetting the state of the microcontroller leaving the content of the ROM
3rd - Execution of the next instruction
4th - Execution of the program up to the clicked row
5th - Automatic execution of the next instruction every 500 ms. When clicked, the icon turns into a pause button
Each line represents one assembly instruction.
The row highlighted in blue is next in the sequence of program execution.
Description of the columns:
Addr - the ROM address where the instruction is stored
Bytes - number of bytes (1-4) that the instruction occupies in the ROM memory
Opcode - instruction machine code (0-255)
Arg1, Arg2 - subsequent arguments of the instruction (0-255 each)
Mnemonic - disassembled form of the instruction
All numbers except those ending with h (hexadecimal numbers) are decimal.
Contains consecutive cells of the selected memory (RAM by default). The memory type can be changed by selecting the desired memory type from the drop-down list. Rendering is virtualized using react-virtualized and mui-virtualized-table, which causes errors in browsers not based on Chromium.
All numbers are decimal.
Contains the most important registers of the microcontroller along with their values.
All numbers are decimal.
Contains flags of IE, IP, PSW, TCON, and TMOD registers. The flag name in bold indicates that it is set.
Contains consecutive bits (binary representations) of the P0-P3 ports.
Contains consecutive bits (binary representations) of the CSDS, CSDB, CSKB0, and CSKB1 registers.
1st - Seven-segment display
2nd - Buzzer
3rd - LED
The device icon in bold indicates that the device is on.
The digits (with dots) represent the state of the CSDS register. The segments represent the state of the CSDB register.
This keyboard is associated with a seven-segment display and uses the CSDS register to determine whether to respond to a given key.
In continuous operation mode (next instruction every 500ms), hold the button for a while so that the microcontroller has enough time to notice the change.
This keyboard is not associated with a seven-segment display. Clicking on the button changes the relevant bit in the CSKB0 or CSKB1 register.
In continuous operation mode (next instruction every 500ms), hold the button for a while so that the microcontroller has enough time to notice the change.
Licensed under the MIT license.