Skip to content
Synacor virtual machine and assembler.
C Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
include
src
tests
.gitignore
README.md
architecture-spec.txt
assemble.py
challenge.bin
makefile

README.md

Description

An implementation of the Synacor virtual machine. Comes with an assembler (assembler.py) that features sugar such as string printing, comments and memory labels. Here's an extract from an example 50-line FizzBuzz program (available in examples/fizzbuzz.syn).

;;; Main
set r1 1
loop-start: mod r2 r1 3
eq r2 r2 0
mod r3 r1 5
eq r3 r3 0
and r4 r2 r3
jf r4 not-multiple-of-both

Setup

Building

git clone https://github.com/Kevinpgalligan/SynacorVM.git
cd ./SynacorVM
make

Running

./synacor challenge.bin

...where challenge.bin is a binary-encoded program in the spec-defined assembly language.

Or, to use the assembler (requires Python 3):

./assembler.py examples/fizzbuzz.syn
./synacor examples/fizzbuzz.bin

Building / running tests

Requires the Check unit testing library and Valgrind.

make test
You can’t perform that action at this time.