Skip to content

taiki45/hs-vm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hs-vm Build Status

Simple Virtual Machine written in Haskell.

About

hs-vm is based on a stack machine architecture.

Status

experiment phase

Usage

To run example just:

cabal sandbox init
cabal configure --enable-tests
cabal install --enable-tests --only-dependencies
cabal build
./dist/build/hs-vm/hs-vm example/fib.hsvm

To test it:

cabal build && cabal test

hs-vm's instructions are in src/VM/Instruction.hs.

All label setting instructions are executed in preprocess phase.

A valid hs-vm program has main function. To set main function, use Label main.

To define function, use Label func_name. To return to calling point, use Ret.

hs-vm stacks Local Data Stack when calls a function. And when returned from function, hs-vm pops back stacked one.

About

Simple Virtual Machine written in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published