Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A collection of stupid little virtual machines.
C Python
branch: develop

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
common/include
lab1vm
mu0
stuff
.gitignore
README.md

README.md

Greg's Virtual Machine Collection

A collection of stupid little virtual machines for the purpose of learning how to do interpretation and optimiztion.

Lab 1 VM - Virtual Machine Example for 0618.303

This is an example virtual machine for Lab 1 of 0618.303 (Microcomputers).

It is a very basic introduction to processing opcodes and simple optimization using GCC.

Specifications

  • Four 4-bit registers
  • 4 operations, no Program Counter
  • Pretty useless

Op-codes

  • MOV Rsrc, Rdest - Copy value from src register to dest register
    • MOV R1, R3 - Copy value from R1 to R3
  • ST Rsrc - 'Store to memory' (in this case print to stdio)
    • ST R3 - Print R3 to stdio
  • LI #val, Rdest - Load the immediate value into dest register
    • LI #3, R1 - Load the number 3 into R1
  • DIS #val - Print the immediate value
    • DIS #5 - Print the number 5 to stdio

MU0 VM - Virtual Machine for MU0

MU0 is a simple academic microcomputer that is sometimes used to present the basics of a microcomputer to students. This is a little VM for it.

Link to lecture notes

Specifications

  • Von Numan based architecture
  • no general purpose registers
  • accumulator based
  • load/store based

Assembling the example

xxd -r examples/first.hex > examples/first.bit
xxd -r examples/first-heap.hex > examples/first-heap.bit

Running the example

./mu0 examples/first.bit examples/first-heap.bit

Cool resources

Labels as values

Something went wrong with that request. Please try again.