This project implements a virtual machine (VM) for the Synacor Challenge. The VM is capable of running the provided binary according to the specified architecture.
vm/src/main.rs
: The entry point of the program, responsible for loading the binary and executing the VM.vm/src/lib.rs
: Contains the core implementation of the VM, including operations, memory management, and execution logic.vm/Cargo.toml
: The Rust project configuration file.challenge.bin
: The binary file to be executed by the VM (not included in the repository).
- Rust programming language (edition 2018 or later)
- Cargo (Rust's package manager)
byteorder
: Used for reading little-endian binary data.
- Ensure you have Rust and Cargo installed on your system.
- Navigate to the
vm
directory. - Build the project:
cargo build --release
- Place the
challenge.bin
file in the parent directory of thevm
folder. - Run the VM:
cargo run --release
The VM implements the following specifications:
- 15-bit address space storing 16-bit values
- 8 registers
- Unbounded stack for 16-bit values
- All numbers are unsigned integers 0..32767 (15-bit)
- All math is modulo 32768
For detailed opcode listings and binary format, refer to the arch-spec
file.
- The VM supports all specified operations, including arithmetic, logic, memory access, and control flow.
- Input/output operations are handled through a console interface.
- The VM executes instructions until a
halt
operation is encountered or an error occurs.
- This implementation is part of the Synacor Challenge. Codes found during execution can be submitted to the challenge website to track progress.
- The
challenge.bin
file is not included in this repository and should be obtained separately.
This project is based on the Synacor Challenge created by Eric Wastl.