GithubHelp home page GithubHelp logo

svm's Introduction

virtual machine thingy

It's turing complete too :)

The destination register is the first one, and the resulting are the arguments.

Number Instruction Description Examples
0 HALT Stop execution HALT
1 ADD Add values in R1 specified registers ADD R1 R2 R3
2 MULT Multiply values in specified registers MULT R1 R2 R2
3 DIV Divide values in specified registers DIV R1 R2 R3
4 SET Set register to operand SET R1 954
5 PRNT Print value of register to stdout PRNT R1
6 NOP Do nothing NOP
7 RJMP Jump to instruction relative to current RJMP -3 (will jump 3 instructions back)
8 IF If the specified register equals the register in operand, set IP to second operand IF R1 R4 R5 (if R1 equals R4 set IP to R5)
9 XOR XOR the values in specified registers and output to first specified register XOR R1 R2 R7
10 CFR Copy from register to register CFR R3 R5
11 AND Execute an AND bitwise operation on the values in two registers, and store in the first AND R5 R1 R1
12 IFN If the specified register does not equal the register in operand, set IP to second operand IFN R1 R4 R5 (if R1 does not equal R4 set IP to R5)
13 PUSH Push number in register to stack PUSH R1
14 POP Pop number in stack into register POP R1

NOTE: To compile, first write the correct ASM, then call vmasm on the file to convert it to instructions. Then, call vm on the instruction file.

svm's People

Contributors

sunflsks avatar

Watchers

 avatar

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.