Compiler/virtual machine interpreter: Difference between revisions

Content added Content deleted
(New post.)
(We have a {{task}} macro and a {{task heading|}} macro - the second requires a vertical bar before its argument to distinguish it from the first in the current wiki implementation (and an empty argument seems meaningless))
 
Line 1: Line 1:
{{task}}Virtual Machine Interpreter
{{task}}{{task heading|Virtual Machine Interpreter}}


A virtual machine implements a computer in software.
A virtual machine implements a computer in software.

{{task heading}}


Write a virtual machine interpreter. This interpreter should be able to run virtual
Write a virtual machine interpreter. This interpreter should be able to run virtual
Line 12: Line 10:
stdout.
stdout.


Input format:
{{task heading|Input format}}


Given the following program:
Given the following program:
Line 68: Line 66:
depending on the instruction.
depending on the instruction.


Registers:
{{task heading|Registers}}


sp:
sp:
Line 82: Line 80:
string pool
string pool


Instructions:
{{task heading|Instructions}}


Each instruction is one byte. The following instructions also have a 32-bit integer
Each instruction is one byte. The following instructions also have a 32-bit integer