Skip to content
/ bp-jit Public

A BytePusher Virtual Machine featuring a basic Dynamic Recompiler

Notifications You must be signed in to change notification settings

paoda/bp-jit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Byte Pusher Virtual Machine

A BytePusher virtual machine that translates the one ByteByteJump instruction to x86-64 assembly.

Scope

I wanted to explore Just-In-Time compilers with the hope of maybe writing one for a more complicated instruction set sometimes in the future. This was my "first step" towards that goal. This project's compiler is non-optimizing and so it's not actually any faster than the interpreter from what I could see (note: didn't do any serious benchmarking)

TODO

  • Audio

Usage

This application is run from the terminal. A typical command might look like: ./bp-jit ./bin/demo/nyan.bp

Building

Most recently built on Zig v2024.1.0-mach

Dependencies

Dependency Source
mach-glfw https://github.com/hexops/mach-glfw
zgui https://github.com/michal-z/zig-gamedev
zig-clap https://github.com/Hejsil/zig-clap
gl.zig https://github.com/MasterQ32/zig-opengl

gl.zig is an auto-generated file providing bindings for OpenGL

Controls

The BytePusher inherits the CHIP-8 set of controls. In this project, they're defined as:

+---+---+---+---+
| 1 | 2 | 3 | 4 |
+---+---+---+---+
| Q | W | E | R |
+---+---+---+---+
| A | S | D | F |
+---+---+---+---+
| Z | X | C | V |
+---+---+---+---+

About

A BytePusher Virtual Machine featuring a basic Dynamic Recompiler

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages