
16-Bit VM in JavaScript - mzehrer
https://francisstokes.wordpress.com/2017/07/20/16-bit-vm-in-javascript/
======
mysterydip
Something I've always wanted to do (16 bit as well, even) but never got around
to. Thanks for the writeup!

------
jasonhansel
Congratulations! I've been working on a similar (though less well-documented)
project in Rust:
[https://github.com/jasonhansel/kineticvm](https://github.com/jasonhansel/kineticvm)

~~~
FrancisStokes
Ah very cool! Rust seems like an awesome language, especially for something
like this. I'l going to take a dive into your project at some point in the
week

------
m1dnigh7
Is this a VM in the sense the JVM is a VM, or is it a VM in the sense of a CPU
emulator?

It seems to be the former, but I'm not well read in VM implementation.

~~~
gmiller123456
That's a very fuzzy, if not non-existent, distinction. The only real
difference is the designers' original intention. Of course the Java VM was
originally only destined to exist only in software, but hardware versions do
exists [1]. And of course x86 was always destined for hardware, but there's
more software implementations of that than can be counted. There's also a
third type in the LLVM sense, where the VM is just an intermediate step in
compiling from a high level language down to machine code. And that's where
the JVM (mostly) falls today.

The VM described in the OP could easily fit in any of the three.

[1] [http://www.jopdesign.com/](http://www.jopdesign.com/)

------
orionblastar
This is in a way that they make emulators in Javascript like that too? Might
be possible to emulate Mame and Mess machines if they haven't already?

~~~
FrancisStokes
Indeed, the core concepts are essentially exactly the same. This is a lot
simpler of course because it doesn't need to do anything with drawing or
sound.

I really like this project
[https://github.com/juchi/gameboy.js/](https://github.com/juchi/gameboy.js/) .
I'd like to do something similar myself but more in the coding style I've used
on the 16-bit VM.

------
pjmlp
Very interesting read and props for choosing _opcode D, S_.

~~~
FrancisStokes
Thanks, I've had mixed feedback about that choice!

