heph is a mixed imperative-declarative format which seeks to fully encode a forth dictionary in a completely platform-agnostic manner. this includes encoding any native codewords, a process aided by the heph IR, a complementary minimal, platform-agnostic intermediate representation of basic machine code.
heph encodes dictionaries into bundles called packs. a pack consists of a brief header, containing among other things a rough size estimate of the decoded pack, followed by a data area containing a series of elements each describing a part of the dictionary.
| magic | vendor | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 |
| 91h | 16h | 84h | 80h | [1] | |||||
| static count | word count | ||
|---|---|---|---|
| +10 | +11 | +12 | +13 |
| [2] | [3] | ||
[1] - this should be a vendor field provided as a pair of three byte fields. namely, the first three bytes should be a vendor signature, while the last three bytes should be a system signature.
[2] - this must be the sum size of all static data elements in bytes, i.e. the length fields of octet blocks + 2 × the length fields of doublet blocks + 2 × the amount of token elements.
[3] - this must be the total word count of the file, i.e. the total amount of header elements of any kind.
| 0 | 1 | 2 | 3 | ||
| 1-op | lsh |
rsh |
neg |
sys |
|
| 2-op | +0 | mov |
jmp |
jnz |
add |
| +4 | sub |
and |
or |
xor |
|
| +8 | out |
in |
ads |
sbs |
|