Skip to content

Instantly share code, notes, and snippets.

@daoleno
Created March 5, 2018 03:14
Show Gist options
  • Save daoleno/b0233e3e6627f6ea21e96cd505ae2dcc to your computer and use it in GitHub Desktop.
Save daoleno/b0233e3e6627f6ea21e96cd505ae2dcc to your computer and use it in GitHub Desktop.
What should a virtual machine generally implement?
  • Compilation of source language into VM specific bytecode
  • Data structures to contains instructions and operands (the data the instructions process)
  • A call stack for function call operations
  • An ‘Instruction Pointer’ (IP) pointing to the next instruction to execute
  • A virtual ‘CPU’ – the instruction dispatcher that
    • Fetches the next instruction (addressed by the instruction pointer)
    • Decodes the operands
    • Executes the instruction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment