Git Product home page Git Product logo

alsi's Introduction

Assembly-Like Symbolic Instruction

A Virtual Machine and an assembler that converts code written in ALSI, an assembly-like language to bytecode the VM can execute.

Usage

  1. Build
# clone this repository
git clone https://github.com/AnurupDey/alsi.git

# generate build files
cd alsi
mkdir build && cd build
cmake ..

# run the build (here we use make on linux)
make
  1. Run the program
# Run one of the examples
./alsi

Examples

Some example programs can be found in example_programs directory.

Example of Output

Here is an example of assembling and running the recursive factorial program.

$ ./alsi
Main Menu
1. Assemble file to bytecode
2. Execute bytecode
3. Assemble and execute
0. Exit

Enter choice 1
Enter source file name: ../example_programs/FactorialRec.txt
Enter bytecode file name: prog
Assemblage complete

Main Menu
1. Assemble file to bytecode
2. Execute bytecode
3. Assemble and execute
0. Exit

Enter choice 2
Enter bytecode file name: prog
 Enter a number: 5
 The Factorial of 5 is 120
Instructions Executed: 57

Main Menu
1. Assemble file to bytecode
2. Execute bytecode
3. Assemble and execute
0. Exit

Enter choice 0

Writing ALSI code

Refer to the examples to learn how to write ALSI code. ALSI is an assembly language. Refer to headers/opcodes.hpp for a list and description of all the supported opcodes.

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.