home .. forth .. colorforth mail list archive ..

[colorforth] colorforth code in ASCII


Please excuse the pedantry. Here is a logical basis for making ASCII/colorForth
translations.

1) There are no 'compile' or 'numeric input' modes. Every string token is
interpreted. e.g. 'Green', typically within a colon definition, execute the
code for 'Green' which delimits the next string token, looks it up in the
dictionary and compiles it.

2) All colors operate in a similar manner, i.e. delimit the next string token
and perform some operation on/with it.The basic ops are:

a) ':' := create new dictionary entry.

b) '[' := null definition. Used to visually indicate entering 'IMMEDIATE' mode.
        i.e. keep interpreting. Same thing as no prefix.

c) ']' := compile a call to the immediately following string token.

d) '$' := convert the following string token to TOS as a hex number.

e) '&' := convert the following string token to TOS as a decimal number.

f) 'L' := compile number TOS as an inline literal


g) ';' := exit/return from the current word, tail recursion conditionally
performed here.


h) 'v' := create a named variable, initialized to zero.

i) '(' := comment; skip characters until terminating ')' found.

4word is a 32bit flat real-mode color forth implemented in ASCII, written to
use these translations.
See http://www.users.qwest.net/~loveall/binary/4word18.zip
for working binaries and source.
See "Color Forth" section of
http://www.users.qwest.net/~loveall/binary/concluse.txt
for a more detailed operational description.

A formal proof is provided in the two color forth text editor source files:
4wdec.p (ASCII format) and 4wcedit.p (color format) which generate identical
binaries when compiled by 4word. The formatting of these two files has been
tweaked to make them visually similar when viewed with a conventional text
editor that does not break displaying embedded color codes.

These semantic equivalents are also a close fit to Chuck's colorForth.. The
specific colors are implementation dependent.

Regards,
Terry Loveall
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com