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

Re: [colorforth] About a byte-sized colorforth


On Tue, 8 Jul 2003, Adam Marquis wrote:

> 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.

That is the easy case. What I'm interested in is how you compute the index
when you enter a word in the editor, also how word names can be displayed
from this index.

>
> 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.

What is the of advantage bincopy token over a number token? A number token
would compile code to push a literal on the stack.

Mark


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