https://github.com/darkseriuscode/svm
Simple Virtual Machine
https://github.com/darkseriuscode/svm
Last synced: 5 months ago
JSON representation
Simple Virtual Machine
- Host: GitHub
- URL: https://github.com/darkseriuscode/svm
- Owner: DarkSeriusCode
- Created: 2024-10-09T14:45:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-17T16:31:26.000Z (about 1 year ago)
- Last Synced: 2025-02-17T17:35:10.956Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SVM (Simple virtual machine)
SVM is a 16-bit virtual machine based on my own architecture. This project was created for my
educational purposes. The goal of the project is to develop my own architecture and create the VM
without any third-party dependencies. Currently, most features are not yet implemented.
## Building
All you need is `make` and a C compiler.
```bash
git clone https://github.com/DarkSeriusCode/svm
cd svm
make
./build/sasm --help
./build/svm --help
```
`sasm` is an assembler for SVM.
`svm` is the virtual machine itself.
## Example
Let's run this program (named `main.asm`):
```asm
_main:
movi r0, 34
movi r1, 35
add r0, r1
```
```bash
sasm -o main main.asm
svm main
```
Because the project is unfinished, the execution result will be saved in `vm.dump`
`r0: 0x0045` means that register `r0` contains 0x0045 (69 in decimal).
For more information about the assembler see `docs/assembler.md`