diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-11-09 06:39:02 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-11-09 06:39:02 -0500 |
commit | 0810456e9c5c19a47511a682eeabc71008632a2c (patch) | |
tree | 9153fe7d3f42fde88491090b59aeb77519d270dc /libalee/dictionary.hpp | |
parent | 513136558e55f8a843f8f326ccafe1503acf67e4 (diff) |
MaxDistance constant; some .cpp comments
Diffstat (limited to 'libalee/dictionary.hpp')
-rw-r--r-- | libalee/dictionary.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libalee/dictionary.hpp b/libalee/dictionary.hpp index 7cf1c9d..f6f6bbe 100644 --- a/libalee/dictionary.hpp +++ b/libalee/dictionary.hpp @@ -41,7 +41,7 @@ * - bits 0..4: Length of name * - bit 5: Set if word is immediate * - bits 6..15: Distance (backwards) to the next entry - * - If bits 6..15 are all one-bits then distance is in the following cell. + * - If bits 6..15 are all one-bits then "long" distance in following cell. * - "Length" bytes of name * - Zero or more bytes for address alignment * - Zero or more bytes of the definition's contents @@ -70,10 +70,10 @@ public: /** Stores the dictionary's "beginning" i.e. where new definitions begin. */ constexpr static Addr Begin = sizeof(Cell) * 8 + InputCells; - /** - * The "immediate" identifier bit used in a definition's information cell. - */ + /** "Immediate" marker bit for a word's definition. */ constexpr static Cell Immediate = (1 << 5); + /** Maximum "short" distance between two definitions. */ + constexpr static Cell MaxDistance = (1 << (sizeof(Cell) * 8 - 6)) - 1; /** Returns the value of the cell at the given address. */ virtual Cell read(Addr) const noexcept = 0; |