brokkr

Bytecode virtual machine for Valhalla.
git clone git://git.knutsen.co/brokkr
Log | Files | Refs | README | LICENSE

commit ba358a35bfa3587fecff3add83421426880723d9
parent e93541bf05ccfde3f530e238c13b52ad1f571c3c
Author: Demonstrandum <moi@knutsen.co>
Date:   Tue, 30 Jul 2019 00:11:43 +0100

Document more bytecode operators.

Diffstat:
MBYTECODE.md | 2++
Mbytecode_spec.yaml | 23+++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/BYTECODE.md b/BYTECODE.md @@ -37,3 +37,5 @@ Sizes are as follows: | `00110110` | `I_DIV` | | Division between two pointer-sized signed integers. Pops top two elements from the stacks and finds their quotient, pushing the result. | | `00110111` | `R_DIV` | | Division between two 64-bit floating-point numbers. Pops top two elements from the stacks and finds their quotient, pushing the result. | | `00111000` | `U_DIV` | | Division between two values of unknown types, found out at runtime. Pops top two elements from the stacks and finds their quotient, pushing the result. | +| `11111110` | `SET_LINE` | 1 — Current line number, given directly as `u16`. Operand value is line number. | Sets the current line number that the subsequent bytecode instructions correspond to in the code source file. | +| `11111111` | `NOP` | | <u>N</u>o <u>Op</u>eration. Does nothing. You shouldn't see this in the final compiled bytecode, it may only exists temporarily while the bytecode is being produced. | diff --git a/bytecode_spec.yaml b/bytecode_spec.yaml @@ -219,4 +219,23 @@ :desc: >- Division between two values of unknown types, found out at runtime. Pops top two elements from the stacks and finds their - quotient, pushing the result.- \ No newline at end of file + quotient, pushing the result. + + +- :byte: 254 + :name: SET_LINE + :operands: 1 + :operand_desc: ['Current line number, given directly as `u16`. Operand value is line number.'] + :desc: >- + Sets the current line number that the subsequent + bytecode instructions correspond to in the code + source file. + +- :byte: 255 + :name: NOP + :operands: 0 + :desc: >- + <u>N</u>o <u>Op</u>eration. Does nothing. + You shouldn't see this in the final compiled + bytecode, it may only exists temporarily while the + bytecode is being produced.+ \ No newline at end of file