https://github.com/nerett/cpu
Software CPU model & emulator with registers, RAM and custom opcodes written in C
https://github.com/nerett/cpu
cpu-emulator opcodes ram registers
Last synced: 12 months ago
JSON representation
Software CPU model & emulator with registers, RAM and custom opcodes written in C
- Host: GitHub
- URL: https://github.com/nerett/cpu
- Owner: nerett
- License: gpl-3.0
- Created: 2021-10-11T19:42:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-02T16:27:43.000Z (about 3 years ago)
- Last Synced: 2025-02-17T05:14:37.107Z (about 1 year ago)
- Topics: cpu-emulator, opcodes, ram, registers
- Language: C++
- Homepage:
- Size: 395 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CPU
This project is an implementation of software cpu model, that consists of registers, RAM and stack and can execute compiled specific assembler code (specific machine code) with its built-in instructions. It automatically checks whether this code is supported or not. There are html logs from `stack` and from `cpu` itself (but they're not fully-featured unfortunately).
This project is written in C with some handy C++ adjustments.
## Usage
If you've already built and added `cpu` to `$PATH`, run `cpu ` to execute a file with the machine code supported. Otherwise build the project and execute with `./Debug/cpu` or `make run` (from project root directory).
## Building from source
Download this repository with
```
git clone https://github.com/nerett/cpu.git
```
Download dependencies with
```
cd cpu/
make install-dependencies
```
...or download the repositiries required manually.
Build the project
```
make
```
Run Software CPU with (machine code file path is set to default)
```
make run
```
or use `make rund` instead to run with `valgrind`.
You can also run this binary with
```
./Debug/cpu
```
To totally rebuild the project run
```
make clean
make
```
## Documentation
https://nerett.github.io/cpu/
## About project
This programm was written during MIPT **Ded's** cource.