Code Monkey home page Code Monkey logo

vvm's Introduction

Vortex VM

screenshot

Usage

./bin/vvm ./examples/example.vvmc

Code example

Memory structure

HEADER

* 3 bytes — "VVM"
* 1 byte  — version
* 1 byte  — code offset
* 3 bytes — reserved

REGS

* 1 byte  — VM state [exec, end, error, etc]
* 2 words — ESP (stack head addr)
* 2 words — EAX and AL (low word)
* 2 words — EBX and BL (low word)
* 2 words — ECX and CL (low word)
* 2 words — EIP (instruction pointer)
* 2 words — EDI (mapped memory offset. may be removed)
* 1 byte  — flags [ZF, INTF]
* 1 byte  — interrupt code

Supported instructions

* MOV  dst[addr int] src[const int] 
* MOV  dst[addr int] src[const byte] 
* MOV  dst[addr int] src[addr  int] 
* ADD  dst[addr int] src[const int] 
* ADD  dst[addr int] src[const byte] 
* ADD  dst[addr int] src[addr  int] 
* SUB  dst[addr int] src[const int] 
* SUB  dst[addr int] src[const byte] 
* SUB  dst[addr int] src[addr  int] 
* JMP  dst[addr int] 
* JMP  dst[label str] 
* CMP  a1[addr int]  a2[const int] 
* JNE  dst[addr int] 
* JNE  dst[label str] 
* JE   dst[addr int] 
* JE   dst[label str] 
* INT  irq[code byte] 
* PUSH src[addr int] 
* POP  dst[addr int] 
* NOP 

You can use `[REG_NAME]` notation for using stored address

Supported interruptions

* FF — stop execution
* 21 — get addr from ECX, read chars until '$' and print this

TODO

  • Math and logic operations
  • Relative jumps
  • Address literals
  • Save/load for vvmc and vvm files
  • Better memory mapping
  • Breakpoints
  • Better error handling
  • Windows version (need help)
  • ...

vvm's People

Contributors

averrin avatar

Stargazers

 avatar Matt Sylvia avatar Vladislav Shevchenko avatar Aniket kumar avatar  avatar Slavkin Oleg avatar Érico Porto avatar Robert Muller avatar Pedro M. Silva avatar Kirill Dmitrievich avatar dodola avatar Chris Maughan avatar Dmitry Alimov avatar

Watchers

Chris Maughan avatar  avatar James Cloos avatar  avatar

Forkers

ra2003

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.