1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-09-16 21:48:45 +10:00
collapseos/blk/085
Virgil Dupras 3d2dc041fb Make word routines into word types
Instead of having wordref point to core word routines, I made them
into word 4 word types. It liberates space into the stable ABI and
should make porting to other arches easier.

I'm also thinking of combining word type with the namelen field
for precious bytes saving, but not now...
2020-06-17 21:41:01 -04:00

16 lines
576 B
Plaintext

Word types
There are 4 word types in Collapse OS. Whenever you have a
wordref, it's pointing to a byte with numbers 0 to 3. This
number is the word type and the word's behavior depends on it.
0: native. This words PFA contains native binary code and is
jumped to directly.
1: compiled. This word's PFA contains an atom list and its
execution is described in "EXECUTION MODEL" above.
2: cell. This word is usually followed by a 2-byte value in its
PFA. Upon execution, the address of the PFA is pushed to PS.
(cont.)