Giter VIP home page Giter VIP logo

demo-asm-vm's Introduction

Demo Assembler and Virtual Machine

This is a simplified assembler and virtual machine used in a classrooms setting to teach the principle of assembly and memory.

Registers

The program has 4 registers available. Each are readable and writable.

  • reg1
  • reg2
  • reg3
  • reg4

Assembler instructions

All instructions start with an instruction number, starting from 1. Instructions are read and executed from top to bottom, except if a jump or zjump instruction is called.

Values are numbers between 0 and 9 (included).

Write

[Instruction number] write [register] [value]

That instruction will write the value of the specified register at cursor position.

Jump

[Instruction number] jump [Instruction to jump to]

That instruction will jump to the specified Instruction to jump to.

ZJump

[Instruction number] zjump [Instruction to jump to] [register] [value]

That instruction will jump to the specified Instruction to jump to if the specified register has the specified value.

Add

[Instruction number] add [register] [value]

That instruction will add value to the specified register. If the sum is more than 9, 9 will be written.

Sub

[Instruction number] add [register] [value]

That instruction will add value to the specified register. If the diffrence is less than 0, 0 will be written.

Move

[Instruction number] move [value]

That instruction will move the program cursor value blocks in the memory. Value must be between -5 and 5.

demo-asm-vm's People

Contributors

gaellan avatar

Stargazers

Benoît 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.