Skip to content

A simple virtual machine for educational purposes

Notifications You must be signed in to change notification settings

felipe-costa-ft/mac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

mac

A simple virtual machine for educational purposes. Made following blog post.

Instruction set

  • PSH ; push to the stack
  • ADD ; pop two values on top of the stack, adds them pushes to stack
  • POP ; pops the value on the stack, will also print it for debugging
  • SET ; set a value into a register
  • HLT ; stop the program

Test program

PSH, 5,

PSH, 6,

ADD,

POP

HLT


The test program will push 5 and 6 to the stack, then add the two values and psuh the result back on the stack. The POP instruction will print the result value for debugging purposes.

Compile and Run

Requirements

  • CMAKE

use 'make' to compile and run with './mac'

About

A simple virtual machine for educational purposes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published