diff options
| author | 2023-02-05 11:44:37 +0000 | |
|---|---|---|
| committer | 2023-02-05 11:44:37 +0000 | |
| commit | f63d6cdd3df24d869437f9f689cbfff5d4bfb435 (patch) | |
| tree | ee6c907242abe6d27edd87cf87979db6c928693a /README.md | |
prototype bytecode interpreter
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..ac53f79 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +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: + +* `110xxxxx 10xxxxxx` +* `1110xxxx 10xxxxxx 10xxxxxx` +* `11110xxx 10xxxxxx 10xxxxxx 10xxxxxx` +* `111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx` +* `1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx` +* `11111110 10xxxxxx 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. |
