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

Re: [colorforth] cf files identical


On Fri, Mar 06, 2009 at 07:00:35PM -0700, John Comeau wrote:
> Has anyone noticed that OkadWork.cf and QuertyOkadWork.cf are
> identical? I mean down to every exact byte; the sha1sums match.
>
> I was going to see what the difference was between them, and was
> surprised to find that.
>
> I'm not running Windows, but I'd guess that, if their behavior is
> different, it's only because CF2.exe triggers on the filename to
> decide which keyboard layout to make default.
> --
> John Comeau <jc@xxxxxxxxxxxx> http://jc.unternet.net/
> "A place for everything, and everything
> all over the place"

I have been playing with the Okad.cf file.

The following (in combination with tools from the colorforth
stuff on my ftp site) has had some success in extracting
labels like X_erase from the Huffman tables.

It is clear to me that the code actually executes at
address 20,0000 and is copied.
Because everything is relative the crawling works out.
(Crawling starts at addresses in the ForthHuff-src table.)

We should start with figuring out the sections in the source
file. Please note that in the color tools, I mistakenly
have used the name SEGMENT for sections.
(Hope to fix that in a future release.)
In the future the
\ HEADER X_erase
is to be replaced by
HEADER X_erase
where HEADER generates stuff in both tables.
(Such as I have done in the original color.com).

--------------------SNIP------------------

0020,2C6C EQU ForthHuff-src
0020,2DD4 EQU ForthHuffXT

: >O   0020,0000 - ;

\ Use COLORNAME to label ADDRESS.
: LABEL-COLOR   SWAP CN>X_ASC  LABELED ;

CREATE TEXTBUF 30 ALLOT

CREATE $HEADER 30 ALLOT         \ Contains "HEADER"/"MHEADER"
"\ HEADER " $HEADER $!

\ Add a directive for COLORNAME at label ADDRESS to give a Forth header.
: LABEL-DIRECTIVE   >R   $HEADER $@ TEXTBUF $!   BL TEXTBUF $C+
    CN>ASC TEXTBUF $+!  TEXTBUF $@ R> DIRECTIVE ;

\ Add information about word with addresses in dictionary HUFF and XT ,
\ This means crawl from the xt-address and add the xt-address with a
\ name derived from the huff-address.
\ Leave incremented HUFF and XT.
: CRAWL-ONE-C  DUP L@ >O >R 4 + SWAP   DUP L@ >R 4 + SWAP
    R> R>   2DUP LABEL-COLOR   DUP CRAWL   LABEL-DIRECTIVE ;

\ Add information about a dictionary corresponding HUFFTABLE and XTTABLE .
\ Heuristically we have found how xttable ends, by an out of table address.
\ Leave HUFF and XT at end of table.
: CRAWL-0 BEGIN DUP L@ .S WHILE CRAWL-ONE-C REPEAT ;

ForthHuff-src >O  ForthHuffXT >O   CRAWL-0

--------------------SNIP------------------

--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

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