diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-13 22:57:02 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-13 22:57:02 -0400 |
| commit | 8371572563799b08aee171707017474db9e5e496 (patch) | |
| tree | 167129c88a8016b60f473c7d570bd07de5b164b7 /implementation | |
| parent | 7583529c468fcbbc5b99eca6fd36785305c51114 (diff) | |
Fix reference to LEBv (now LEB) in vm.md
Diffstat (limited to 'implementation')
| -rw-r--r-- | implementation/vm.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/implementation/vm.md b/implementation/vm.md index a94eadb5..3e0c7259 100644 --- a/implementation/vm.md +++ b/implementation/vm.md @@ -32,7 +32,7 @@ The starting index refers to the position where execution starts in order to eva ### LEB128 -Arguments for BQN bytecode are always natural numbers, encoded as a sequence of bytes using the unsigned [LEB128](https://en.wikipedia.org/wiki/LEB128) format. The environment only needs to decode this format and not encode it (encoding is done by `LEBv` in the compiler). +Arguments for BQN bytecode are always natural numbers, encoded as a sequence of bytes using the unsigned [LEB128](https://en.wikipedia.org/wiki/LEB128) format. The environment only needs to decode this format and not encode it (encoding is done by `LEB` in the compiler). To read a number from the byte stream, read (unsigned) bytes from the stream in sequence, stopping when a byte less than 128 is found. Each byte contributes its lowest 7 bits to the number: the byte's value if it is less than 128, and its value minus 128 otherwise. Values are accumulated starting at the lowest-order bits. To accomplish this, begin with a multiplier of 1 (shift of 0). At each step, add the 7 bits read, times the multiplier, to a running total that starts at 0, then multiply the multiplier by 128 (or add 7 to the shift). |
