News for hackers. Stuff that matters.
Re:Implementing a Virtual Machine in C by TomNomNom on Tuesday June 23, 2015 @10:10AM (#9764695)
A good read.

One thing I thought of as a little weird is this:

> But remember, we aren't decoding anything since our instructions are just given to us raw. So that means we only have to worry about fetch, and evaluate!

The 'decode' step is being done by the switch statement, it's not being skipped. I think the author may be confusing turning assembly into machine code (i.e. what an assembler does) with decoding an opcode.

I built a (very simple) VM in Go live on stage at a local mini-conference last year. I really enjoyed it. There's a video of it here: https://www.youtube.com/watch?v=GjGRhIl0xWs

Re:Implementing a Virtual Machine in C by Corun on Tuesday June 23, 2015 @02:18PM (#9766559)
I'm not sure, but I think the author means that there is no extraction of fields from the instruction, which is one way of defining the decode step.