I want to implement the Forth words VALUE and TO on a RPC/8 (an emulated computer in a Minecraft mod). My best attempts get me a set of words that work fine so long as I don't use them while compiling. More sepecificly VALUE works, but TO does not.
: VALUE CREATE , DOES> @ ;
: TO ' 3 + ! ;
I have tried everything I can think of to get it working and my best attempt gets me this:
['] NameOfAValue 3 + !
Note that the processor is not a pure 6502 but a 65EL02, a custom variant of the 65816.
EDIT #1: Somehow I forgot the call to CREATE in value. It should have been there all along.
EDIT #2: I also got 3 and + switched around in TO... oops. It should have been the other way all along.