Search code examples
forthcolor-forth

How can I write my own colon definition in ColorForth?


How can I write my own colon definitions in ColorForth?

I tried to write : in interpretation mode, but it shows :?.

Do I need to change the entry colour in interpretation mode?

Do I need to use the editor? If so, on what block?

I entered my colon definition in block 300 (I found it empty), but I cannot execute it. Do I need to compile the block?

Enter image description here

I found that I have to load the block with ll, and it works.

Is this the correct way?


Solution

  • In colorForth, the red word is a definition of a new Forth word, and there isn't any need to start with the ":" character. colorForth doesn't know the ":" word, and it displays "?" after any word not defined.

    A newer version, of colorForth 4.2c (2011), a win32 version, but an old release now, it is at: https://www.greenarraychips.com/home/support/index.php#software

    The same information about the colorForth 2001 version: https://colorforth.github.io/

    There is a NASM, cf2023 modified version, by Howerd Oakford at https://github.com/Howerd/colorForth.