barebones bytecode interpreter in C
Go to file
Peter McGoron 7239582251 test encode and decode 2023-02-07 06:19:40 +00:00
.gitignore prototype bytecode interpreter 2023-02-05 11:44:37 +00:00
LICENSE.md prototype bytecode interpreter 2023-02-05 11:44:37 +00:00
Makefile test encode and decode 2023-02-07 06:19:40 +00:00
README.md fixing precedence issue in test 2023-02-07 04:50:50 +00:00
creole.c test encode and decode 2023-02-07 06:19:40 +00:00
creole.h openmp parallelized encoding testing 2023-02-07 05:25:30 +00:00
greatest.h prototype bytecode interpreter 2023-02-05 11:44:37 +00:00
test_creole.c openmp parallelized encoding testing 2023-02-07 05:25:30 +00:00
test_encode_decode.c test encode and decode 2023-02-07 06:19:40 +00:00

README.md

Creole is a bytecode designed for simple implementations.

Bytecode Format

Each creole line consists of pseudo-UTF-8 characters. The first byte is an unsigned number between 0 and 127 (the high bit is clear). Each suceeding pseudo-UTF-8 character is encoded as follows:

  • 110HHHHx 10xxxxxx
  • 1110HHHH 10xxxxxx 10xxxxxx
  • 11110HHH 10Hxxxxx 10xxxxxx 10xxxxxx
  • 111110HH 10HHxxxx 10xxxxxx 10xxxxxx 10xxxxxx
  • 1111110H 10HHHxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
  • 11111110 10HHHHxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx

The first four bytes determine the type:

  • 0: Value is a register.
  • 1: Value is immediate.

All other values are reserved. Overlong values are allowed, and for some argument values they are necessary. All lines are terminated by a byte of all zeros.