mikaelpatel / Arduino-FVM

Byte Token Threaded Forth Virtual Machine (FVM) for Arduino

Home Page:https://mikaelpatel.github.io/Arduino-FVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add callback on illegal token/operation code

mikaelpatel opened this issue · comments

The VM is byte coded and allows for 256 tokens. The inner interpreter uses signed byte to determine if the token is executed direct (C++) or threaded call. To extend two special tokens are used. These allow the token value to exceed -128..127.

Kernel tokens are 0..127 direct, 128..255 extended.
User tokens are 256..383 direct (mapped to -1..-128), 384..511 extended.

The token space is not continues. There exists illegal tokens that needs to be captured.