Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Virmic

Very simple virtual microprocessor based on the one created by Dr Frederic Maire.
Thanks also to Tristan Strathearn for his version. http://pixls.com.au/apps/vmc/

How to use Virmic

Virmic takes a binary file as a single argument. The binary file is loaded into memory and executed.

eg. './virmic test.prog'

The processor will halt on the instruction 0x00, or any non-valid instruction. See full instruction set below.

Instruction Set

Note:

(n) indicates a value stores at address n.
A is shorthand for (pc + 1).

OpcodeInstruction
0x00Halt CPU
0x01R0 <- R0 + R1
0x02R0 <- R0 - R1
0x03R0 <- R0 + 1
0x04R1 <- R1 + 1
0x05R0 <- R0 - 1
0x06R1 <- R1 - 1
0x07Print (A)
0x08R0 <- (A)
0x09R1 <- (A)
0x0a(A) <- R0
0x0b(A) <- R1
0x0cJump to A
0x0dJump to A if R0 == 0
0x0eJump to A if R0 != 0

About

Very simple virtual microprocessor based on the one created by Dr Frederic Maire.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages