A virtual machine in C utilizing 48-bit machine words.

John Dulaney 5a3a091512 Split initialization out of main function 9 anni fa
src 5a3a091512 Split initialization out of main function 9 anni fa
tests 2f6b4359a5 update to newest rev 9 anni fa
LICENSE 9789d76e4c Initial commit 9 anni fa
Makefile 2e9089537b Atomize memory operations 9 anni fa
README fa14ca55f0 Added bitshifting instructions 9 anni fa
TODO 0207ff1106 Thoughts on interupts 9 anni fa
dis.sh 4a4fae7110 dis.sh support some more opcodes 9 anni fa

README

To build:
1. Compile the vm and assembler with "make vm" and "make asm"
2. Assemble the test code with "make tests" if you wish.
To assemble:
./asm [path to asm] [path to output bin]
To disassemble:
./dis.sh [path to bin]
To run binary:
./vm [path to bin]
To add a new opcode:
1. Make a new constant in vm.h
2. Define a function for the opcode in vm.c
3. Add handling for the opcode in eval() of vm.c
4. Add handling for the opcode in mainloop of asm.c
5. Add handling for the opcode in encode() of asm.c
Some emacs notes:
For line numbering in hexadecimal starting at 0 (useful for writing assembly)
(setq linum-format '(lambda (num) (format "%2x" (- num 1))))
With color (http://www.emacswiki.org/emacs/ansi-color.el):
(require 'ansi-color)
(setq linum-format '(lambda (num) (ansi-color-apply (format "\e[1m\e[37m%2x\e[0m" (- num 1)))))