Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Database

The Forth Column


AUG88: THE FORTH COLUMN

Loyal readers of this column will have noticed that I often discuss Forth's strong ties to the field of the real-time programming. This month is no exception. In addition to the usual news about chips and language products, I also have some information about the coming Real-Time Programming Conference (formerly known as the National Forth Convention).

In the hardware news this month is Harris Semiconductor's Real Time Express (formerly called the FORCE). The RTDX 2000 is a Forth-based 16-bit microprocessor that Harris is billing as "the fastest 16-bit microprocessor available." With sustained performance exceeding 10 MIPS, that claim might not be all hype.

This RISC-like microcontroller, like the Novix NC4O16 CPU before it, gets some of its speed by executing the Forth language directly. The chip has both internal parameter and return stacks (keeping the pin count down) as well as a 16 X 16 multiplier, a fast interrupt controller, and three 16-bit timers. The interrupt response time is just 400 nsec. A proprietary ASIC Bus is accessed concurrently with instruction execution and allows for the attachment of external ASICs.

The RTX 2000 is a Harris standard macro cell, that can be extended to a custom VLSI chip. The RTXD comes in an 84-lead pin-grid-array package, but will also be available as a ceramic quad package. The price is $190 each in quantities of 1,000.A MIL-Standard 883C version will also be available by the end of the year.

Harris supplies RTX 2000 evaluation boards for less than $1,500, including their RTXDS Software Development System. Alternately, Software Composers plans an IBM PC drop-in board (third quarter 1988) and VME Inc. plans a VME Bus CPU board (first quarter 1989). The Harris RTXDs Software Development System includes a monitor, debugger, and a Laboratory Microsystems Inc. (LMI)-based cross-compiler. By the end of the year, you can expect to see a full Forth Inc. polyFORTH system running on the evaluation board. Both C and ADA language translators are also in the works.

What impressed me most about this chip were the printed specifications. Harris Semiconductor's spec sheet is a 30-page document that includes timing diagrams, electrical specs, opcodes, architecture block diagrams--the works! Call 407-724- 7418 for a copy. Harris also has all day seminars and tutorials on the RTX.

As I mentioned earlier, the RTX 2000 is theoretically descended from the original Novix NC4016 CPU, which is still very much alive. You can now buy More on NC4000, Volume 7, collected by Dr. C.H. Ting, from Offete Enterprises (1306 S. B St., San Mateo, CA 94402) for $15. Better yet, get his revised and expanded Footsteps in an Empty Valley, 3d edition ($25). Dr. Ting's books remain one of the finest sources of information on this chip.

Speaking of the NC4016, Forth Inc. has announced a polyFORTH development system ($2,950) for VME Inc.'s V4000 VMEBus NC4016 CPU card ($2,795(. Call them at 213-372-8493 for more information.

And speaking of Forth-based RISC hardware, Johns Hopkins University has been showing off samples from their latest batch of JHU/APL 32-bit Forth chips running at 10 MHz! Mitch Bradley, of Sun computers, talked at the recent annual Rochester Forth Conference about how Sun is using Forth as a machine-independent language for writing drivers for their SPARC Unix systems. The Fujitsu SPARC is a core product of their fifth-generation computer effort. At the same Conference, Dr. Wicks, from Hewlett Packard, showed how a blend of Forth and Lisp is used to program the symbolic math in their calculators.

By the way, the first Australian Forth Conference has evidently been quite successful. I just heard that about 200 people attended it.

LMI's TMS34010 Metacompiler

Laboratory Microsystems announced a version of their metacompiler targeted for the Texas Instrument's TMS34010 graphics processor. This chip has a 50-MHz performance with machine-level instructions for both linear and XY-addressed line drawing, pixel block transfer, region fills, clipping, and other graphics operations. With its 16-Mbyte bit-addressed display memory, programming this chip must be quite a challenge.

The metacompiler target was written by Ron Braithwaite and produces a ROMable executable image that may be optionally downloaded to an IBM PC development board. The target sells for $1,000 and is available directly from LMI (213-306-7412).

MacForth in the News

Mac User magazine, in an article titled "Picking a Compiler," gave Creative Solution's MacForth a high rating for its toolbox support and dedicated program generation. CSI was seen at MacWorld Expo earlier this year running MacForth under the MultiFinder with color graphics. in addition, Micro Dynamics showed its optical storage WORM drive and DBMS for graphics retrieval. Rumor has it that at least some of its drivers were written in MacForth.

Unicus announced a universal terminal emulator for the Macintosh called MetaTerm. MetaTerm allows users to define the terminal parameters with a command language called ReachForth.

Another terminal support device that has recently come to my attention is the PC Port Controller from Component Systems Inc. (415-8611345). This box connects ten asynchronous RS232C/RS422 ports together. it includes 192K of buffer memory and a resident Forth running on a 64180 CPU. The proprietary CSI Forth is the control language that specifies the interconnections and buffering. The PC Port Controller can be used as a poor man's local area network, a flexible printer buffer for multiple users, a data concentrator, or as part of an electronic mail system.

Bulletin Boards

Electronic bulletin boards specializing in Forth are still one of the best ways to stay connected with the Forth community. Some of the larger ones are the North Coast Forth Board (612-483-6711), the East Coast Forth Board (703A42-8695), and the Vancouver Forth Board (604434-5886). Regretfully, the West Coast Forth Board will be closing in June. No matter where you live (well, almost anywhere), the Forth BBS on GEnie is just a local phone call away. Call client services at 800-638-9636 for the number nearest you.

Some of the more interesting files that have appeared on the boards lately include:

  • The listing for the source code in Personal Expert System by Townsend and Feucht (ECFB file PXSARC)
  • Jack Woehr's cross-assembler for the Inmos Transputer (GEnie XASMARC)
  • A complete BBS that can run in 64K and with one 360K-disk drive (GEnie ARIELARC)
  • A Prolog implementation for the Laxen and Perry F83 dialect (GEnie PROLOG2ARC)
  • A JForth version of Bob La Quey's neural network simulator (GEnie J4NEURALARC)
The East Coast Forth Board recently posted a Forth bibliography. Don Madson has compiled a comprehensive list of Forth books in the Library of Congress. You can download the list from the ECFB by reading messages 463-465.

1987 FORML Conference Proceedings

The combined proceedings of the 1987 9th Annual FORML Conference and the euroFORML 87 Conference are now available from the Forth Interest Group (408-277-0668). The conference itself was reviewed in an earlier column, and it was great. Regrettably, Dr. Ting's amazing "Simplest Line Drawing Algorithm" was lost somewhere in the shuffle, so I am reprinting it in this column (see page 116). This recursive routine draws a line by cutting it artfully in two until the endpoints lie in adjacent pixels.

Dr. C. H. Ting's amazing "Simplest Line Drawing Algorithm."

     HEX
     CODE VIDEO ( cx dx ax -- ) \IBM BIOS video service
          AX POP DX POP CX POP     10 INT    NEXT END-CODE
     : TEXT    0 0 2 VIDEO ;  \ Return to text mode.
     : GRAPH   0 0 4 VIDEO ;  \ Set high-resolution graphics mode.
     CODE PLOT ( x y color --)
     \ Given a coordinate pair and a color code,
     \ Paint one dot on the Screen.
          AX POP 0200 # AX ADD DX POP CX POP 10 INT
          NEXT END-CODE
     DECIMAL

     \ Dr. C. H. Ting's Simplest Line Drawing Algorithm
     : draw ( x1 y1 x2 y2 --)
     \ Draw a straight line between (x1, y1) and (x2,y2).
     \ Determine the end condition, where (x1,y1) and (x2,y2)
     \ are within one pixel distance.      \ Find the aid point between (x1,y1) and (x2,y2).
     \ Insert mid point between 1 and 2, then recurse twice
     \ to draw the two segments.
          2over 2over    rot  - abs >r
          - abs r> max   2 <  if 2drop 3     plot exit then
          2over 2over    rot  + 1+ 2/ >r      (y3)
          + 1+ 2/ x3)    r>   2dup 2rot recurse recurse

     : test1   640 0 do  0 0 i 400 draw 10 +loop;
     : test2   400 0 do  0 0 640 i draw 10 +loop;

Call for Presentations

This is a call for presentations for the Real-Time Programming Convention, November 1819, at the Grand Hotel in Anaheim, Calif. This event, formerly called the Forth Convention, is sponsored by the Forth Interest Group. This year's opening speaker is Ray Duncan, a well-known authority on IBM PC programming and known to DDS readers as well for his "16-bit Toolbox" column. The banquet speaker is none other than Jef Raskin, head of the original Macintosh development team and inventor of the Canon Cat.

This year the conference theme is Real-Time Programming Systems, so if you work with the real world and in real time, this is the place to be. This conference is not limited to members of the Forth community, so whether you use Forth or machine code or C, if you are performance oriented and program "down to the metal," if you use A/D's and D/A's on single-board computers, if you need the speed of language-oriented RISC machines, come to this conference.

We need presentations in the following areas:

Real-time operating systems Language-oriented RISC machines Parallel processing Languages for data acquisition and analysis Intelligent instrumentation Working neural nets Adaptive devices Software peripheral controllers Applications in Aerospace Medicine Laboratories Machine vision Digital signal processing Robotics Automation

By presentations we mean talks or demonstrations, preferably with an audio-visual component.

Of course, you will see and hear a lot of Forth at this convention. After all,Forth is one of the very best solutions for real-time programming. So come and meet your vendor or hear Chuck Moore's fireside chat and see what the real-time world has to offer.

Programming Contest

Better yet, come and see or participate in the first Fastest Programmer in the World Contest. This contest is open to any programmer using any computer, any software. See the down-sized poster on page 114 for details. We anticipate a large response, so there will be some sort of screening before the contest. Write for rules to the Programmer's Contest, c/o the Forth Interest Group, P.O. Box 8231, San Jose, CA 95155.

_THE FORTH COLUMN_ by Martin Tracy

[LISTING ONE]

<a name="0184_000c">



\ Dr. C.H. Ting's Simplest Line Drawing Algorithm
HEX
CODE VIDEO ( cx dx ax -- )   \ IBM BIOS video service
   AX POP  DX POP  CX POP   10 INT   NEXT END-CODE
: TEXT    0 0 2 VIDEO ;   \ Return to text mode.
: GRAPH   0 0 4 VIDEO ;   \ Set high-resolution graphics mode.
CODE PLOT ( x y color -- )
\ Given a coordinate pair and a color code,
\ paint one dot on the screen.
   AX POP  0200 # AX ADD   DX POP  CX POP   10 INT
   NEXT END-CODE
DECIMAL


\ Dr. C. H. Ting's Simplest Line Drawing Algorithm
: draw  ( x1 y1 x2 y2 -- )
\ Draw a straight line between (x1, y1) and (x2,y2).
\ Determine the end condition, where (x1,y1) and (x2,y2)
\ are within one pixel distance.
\ Find the mid point between (x1,y1) and (x2,y2).
\ Insert mid point between 1 and 2, then recurse twice
\ to draw the two segments.
   2over 2over   rot - abs >r
   - abs r> max  2 < if 2drop 3 plot exit then
   2over 2over   rot + 1+ 2/ >r ( y3)
   + 1+ 2/ ( x3) r>  2dup 2rot  recurse  recurse ;

: test1   640 0 do  0 0 i 400  draw  10 +loop ;
: test2   400 0 do  0 0 640 i  draw  10 +loop ;









Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.