Virtual Machine

SOURCE

I wrote a virtual machine. It works; it's garbage. There are tons of arbitrary limitations:

Oh, and the assembler doesn't have symbols.

The machine is bad, but it's still good enough to write simple programs in. Here, I jump over some constants and then start a loop to copy them into memory. Finally, the programs halts.

jmp 7
db 0x41
db 0x4C
db 0x59
db 0x53
db 0x53
db 0x41
db 0x00
movi 1
movr c, accum
movr d, accum	
jz 3
lod 0
str 1
jmp -4
hlt

Currently there's no input, but I did add memory mapped I/O: virtual-machine-display.png

ncurses is pretty neat.