Skip to content
/ Relang Public

Basic bytecode virtual machine written in C++20.

Notifications You must be signed in to change notification settings

NeddX/Relang

Repository files navigation

Blend

About

Basic 64bit register-based bytecode virtual machine written in C++20. The bytecode mnemonics are almost identical to that of x86. Has 32 64bit wide general purpose registers %r0 - %r31. Ships with a basic assembler that is inspired by NASM and MASM.

Build instructions

Linux

  • Requires CMake 3.20+
  • Clang 16.0.6+
  • Make

Do

chmod 772 build

and then run

./build

If the compilation was successful, you should see the binaries in the bin/ directory.

Windows

Coming up.

Usage

BASM

Command format: basm [file] [options] Compiles the BLEND assembler code to bytecode in binary.

Options:

  • -o [path]: Specifies the output location.
  • -d: Prints the code generated by the assembler.
  • -D: Stores the code generated by the assembler in a file ending with .int.

Blend

Command format: blend [file] Execute the bytecode.

TODO:

  • [ ]: Write a few basic terminal based games in BASM.
    • [ ]: Snake
    • [ ]: Tetris
  • [ ]: Write a basic C Compiler In Rust which will compile to BASM.
    • [x]: Create the Rust sub-project and integrate it with Blend’s buildsystem.
    • [ ]: Write the Lexer.
    • [ ]: Write the Linguistic Parser.
    • [ ]: Write the Code Generator.
  • [ ]: Compile Blend bytecode to architecture specific machine code.
  • [ ]: Write a compiler for Reflekt that compiles to BASM.