Skip to content
💻 Basic Virtual Machine Implementation in C99
C CMake C++
Branch: master
Clone or download
Latest commit e3d3e46 Aug 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update FUNDING.yml Aug 14, 2019
src Update Aug 14, 2019
.gitignore Update Aug 3, 2019
.travis.yml Resolves #7 Aug 7, 2019
CMakeLists.txt Update CMakeLists.txt Aug 15, 2019
LICENSE Initial commit Jul 15, 2019
README.md
appveyor.yml Update appveyor.yml Aug 15, 2019

README.md

💻 Basic Virtual Machine in C99

Build Status CodeFactor

Notes

  • This project is for educational purposes only.
  • This project does not demonstrate best practices.

Build with CMake

$ mkdir build
$ cmake ..
$ make

Example 1

memory[0x3000] = 0x10000001; // mov r0, #1
memory[0x3001] = 0x10010002; // mov r1, #2
memory[0x3002] = 0x70020001; // add r2, r0, r1
memory[0x3003] = 0xff000000; // halt

Example 2

memory[0x3000] = 0x10000001; // mov r0, #1
memory[0x3001] = 0x10010002; // mov r1, #2
memory[0x3002] = 0x50000000; // push r0
memory[0x3003] = 0x50010000; // push r1
memory[0x3004] = 0x60000000; // pop r0
memory[0x3005] = 0x60010000; // pop r1
memory[0x3006] = 0xff000000; // halt
You can’t perform that action at this time.