Skip to content

eldh0se/mac

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MAC

MAC is a really simple virtual machine. It's written in C and is [as of writing this] only one small C file.

Registers

register	purpose
-------------------------------
A			general purpose
B			general purpose
C			general purpose
D			general purpose
E			general purpose
F			general purpose
IP			instruction pointer
SP			stack pointer

Instructions

op   val    function
---------------------------------------------------------------------
HLT  0		halts the program
PSH  1		pushes the next instruction
POP  2		pops the stack
ADD  3		pops stack twice, adds result pushes to stack
MUL  4		pops stack twice, multiplies the result pushes to stack
DIV  5		pops stack twice, divides result pushes to stack
SUB  6		pops stack twice, substracts result pushes to stack
NOP  7		nothing

About

MAC - Simple virtual machine in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 97.0%
  • Makefile 3.0%