commit cdc6f72ee39afd45ee92695d020be677bc9c1b9f
parent 8c661027e7acd45238476b88649ad6380cd2f31d
Author: Demonstrandum <moi@knutsen.co>
Date: Sat, 27 Jul 2019 03:01:41 +0100
Specify sizes.
Diffstat:
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/BYTECODE.md b/BYTECODE.md
@@ -1,4 +1,13 @@
# Brokkr Bytecode Specification
+
+Sizes are as follows:
+
+| Type | Size |
+|----------|--------------------------|
+| Operator | 1 Byte (8 Bits, `u8`) |
+| Operand | 2 Bytes (16 Bits, `u16`) |
+
+## Bytecodes
| Byte | Name | Operands | Description |
|:---:|:---:|---|---|
| `00000000` | `HALT` | 1 — Exit Code (Integer) | Stops execution. |
diff --git a/scripts/gen_bytecode_md_spec.rb b/scripts/gen_bytecode_md_spec.rb
@@ -28,5 +28,18 @@ end
LINE = "\n|:---:|:---:|---|---|\n"
TABLE = HEAD + LINE + rows.join("\n")
+KEY = <<EOF
+
+Sizes are as follows:
+
+| Type | Size |
+|----------|--------------------------|
+| Operator | 1 Byte (8 Bits, `u8`) |
+| Operand | 2 Bytes (16 Bits, `u16`) |
+
+EOF
+
puts "# Brokkr Bytecode Specification"
+puts KEY
+puts "## Bytecodes"
puts TABLE