Skip to content
/ VLAHB Public

A Virtual Machine written in C and an Assembler written in Python.

Notifications You must be signed in to change notification settings

Kully/VLAHB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VLAHB

  • An original assmebly langauge you can use to write your own games.
  • For details on the underlying mechanics of the language, read this blog post.

Image

Virtual machine
Linker
Assembly
Hex
Binary

Building

$ ./run.sh

(NB Pick which asm files to compile on this line of run.sh)

Statically Linking files

-s is a flag for statically-linking all the .asm files in the /asm directory. If you list 1 or more .asm filenames w/o the -s flag, it will only compile those files and start at the first one. If you list 1 or more .asm filenames with the -s flag, it will compile all the files in the /asm directory and start with the first one.

code meaning
$ python3 assembler.py A.asm B.asm C.asm Compile A, B and C and start the vm at A.asm
$ python3 assembler.py C.asm -s Compile all files in /asm and start at top of C.asm
$ python3 assembler.py B.asm C.asm -s Compile all files in /asm and start at top of B.asm

Debug Messages

Turn on DEBUG mode here to get helpful debug messages printed per instruction in terminal. Slows down virtual machine a ton.

View Machine Code

Run $ xxd -c 4 bin/file.bin to view the machine code displayed as hex in the terminal.

Specs

  • virtual machine, assembler/compiler
  • 48 opcodes
  • 262KB of ram
  • 160x144 pixel display
  • static linking capable
  • 60 fps
  • vm runs on SDL2
  • written in C and Python
  • lots of fun! 😸

Image

About

A Virtual Machine written in C and an Assembler written in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published