etherForth Code

Here are some blocks of etherCode. This is code I wrote for my own use. I present it here to illustrate using GreenArrays' Eval Board and programming the GA144. The formatting conventions of etherCode are described below.

I'm the only one using etherForth. GreenArrays has other versions of colorForth much better documented. But the code looks much the same.

So far there's no way to download etherCode. So the screen shots show code which must be re-typed if interesting. I doubt if anyone would want the code exactly as displayed, anyway.

Each block of code is supposed to have a shadow block of comments. Some do. But more extensive comments are provided here. The code is not necessarily optimal, merely good enough. Improvements can always be made to code or hardware, but the greatest improvement is always in the strategy/algorithm.


Generating images on a monitor:


Routing data about the chip:Routing packets:


An example of text output: displays 64 octal words of RAM.



Here are some of the functions I've coded. Every function has its own pecularity: range, precision, etc. None are as simple as evaluating a polynomial. They show that a GA144 node can calculate nicely.

It's fun to see a plot of the function. It verifies gross correctness. And displaying errors against a reference will validate accuracy. There's unlimited opportunity to improve and expand this code

Multi-word functions

This code resides in a node that will receive instructions and data from a neighbor.


Using the 5GHz a/d counter to time some of this code


My goal is a graphic display of the night sky. Here are steps along the way:

etherCode format

This is a sample block of etherCode. Rather simple code that displays a blue screen. Some common features of etherCode blocks are:

There is a comment on the first line to identify the code. It includes the node number (as text) and ideally a unique word that colorForth can search for so you don't have to remember block numbers. In this case dth (death).

An etherCode block initializes the code address to 0; ie, it has an implicit 0 org. Code follows; in this case the words sol and go are defined.

The yellow word init (for initialize) marks the end of code compiled into RAM and the beginning of code that will be executed from the comm port at load time. In this case, register b will point to the io register; register a to the up port. 41af and 4155 will be left on the stack and execution started at go.

This initialization is extremely useful is saving space in RAM. That's not important here, but is a nice habit to form. Much can be done from the port.

The last line tells etherForth where to load the code. It describes a path starting at node 608: go right 9 nodes and turn up. That takes you to node 717.

The grey number 007, tells you that code takes 7 words of RAM. This must be less than 041, of course. The number 00e, tells you that 14 words will be transferred to 717. The last 7 will be executed (from the down port since that's where ether loads the code).