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

John Dulaney 32512f4284 Update TODO hace 9 años
src f3f745ef91 Moved state into core struct hace 9 años
tests 2f6b4359a5 update to newest rev hace 9 años
LICENSE 9789d76e4c Initial commit hace 9 años
Makefile 2e9089537b Atomize memory operations hace 9 años
README fa14ca55f0 Added bitshifting instructions hace 9 años
TODO 32512f4284 Update TODO hace 9 años
dis.sh 5ec8fc7b85 dis.sh use new src dir hace 9 años

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)))))