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

Re: [colorforth] About a byte-sized colorforth


Thanks for your input!

I was thinking of a token oriented editor. I wrote a display routine that display evey token sequentially with a predefined color. Its all written in assembly. The cursor would highlight whole tokens (words). When a change must be made, a special token input subroutine kicks in. e.g. for bincopy, it only accepts
0...F characters and an even number of them.

I want  to keep isomorphism, here's an example of what I'm thinking now;
To handle literals, I could use a macro called "#" that would:
1- call the ?dup macro, defined previously in source
2- Save the current address for subsequent ?lit (see colorforth source, search for list and list+4)
  For this I use "mov edx, ebx | mov ebx, edi"
3- Compile the correct opcode, b8h  "mov EAX, imm32"
Each lit could be written as a binary token prefixed with this # word.
#78563412, with correct colors, would mean a litteral.

And ?lit becomes ?#. (123, !@#, store fetch lit... ;o)
Theres many scheme but this one would be the most elegant, because of its
simplicity and the fact that WYSIWYG. But a higher level editor could be made, giving litterals a new color, etc. But isomorphism get the boot, it brings complexity in.

I don't understand your suggestions about definitions going inside indices.
I know 128 definitions isn't much, but its enough for most program
I came to think about. I thought about the difficulty to link program blocks
between themselves with let say a LOAD word. I have not resolved it yet,
maybe because its a non-problem, since the editor could enable you to easy
copy tokens between blocks.

Adam Marquis

Mark Slicker wrote:

How would the editor work for this source code? You use dictionary
indices for compiling calls, but defintions could possibly be put in
different indicies depending on what was loaded previously.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com