Volume V Number 1 $2.50

ARTICLES Interactive Computer Graphics ...... Bob Gotsch...... 3 FORTH in the Arts ...... 5 3-D Animation ...... Paul Lutus and Phil Thompson ...... 11 Space Graphics Problem ...... 14 Double-Precision Math Words ...... L.H. Bieman...... 16 Add a Break Point Tool ...... Leo Brodie ...... 19 Extending the FORTH Compiler ...... Luke Seeto ...... 20 More on Data Bases ...... Lindsay Doyle...... 27 A Simple Overlay System ...... Christian Mahr ...... 37

DEPARTMENTS New Product Announcements...... 3 1 Technotes ...... 34 FIG Chapter News ...... 40 FIG Chapters ...... 41 FORTH System Vendors ...... 42 FORTH for 2=80@,8086,68000, and IBM" PC FORTH Application Development Systems include interpreterlcompiler with virtual memory management and multi-tasking, assembler, full screen editor, decompiler, utilities, and 130 + page manual. Standard random ac- cess files used for screen storage, extensions provided for access to all operating system functions. 2-80 FORTH for CP/M@ 2.2 or MPIM II...... $ 50.00 8080 FORTH for CPIM 2.2 or MPIM II...... 8086 FORTH for CPIM-86 or MS-DOS...... $100.00 PCIFORTHTMfor PC-DOS, CPIM-86, or CCPM ...... ''$100.00 68000 FORTH for CPIM-68K...... '...... '.$250.00 1 FORTH + Systems are 32 bit implementations that allow creation of programs as large as 1 megabyte. This is the only language that supports the entire memory space of the 8086188 directly for programs and data! PClFORTH + for PC-DOS or CPIM-86...... 8086 FORTH + for CPIM-86...... $250.00 Extension Packages for FORTH systems Software floating point (Z-80,8086, PC only)...... $100.00 Intel 8087 support (8086, PC only)...... $100.00 AMD 9511 support (8086,Z-80 only)...... $100.00 Color graphics (PC only)...... $100.00 Symbolic interactive debugger (PC only) ...... 0.00 Cross reference utility ...... $ 25.00 PCIGENTM(custom character sets, PC only)...... $ 50.00 Hierarchical file manager...... $ 50.00 B-tree index manager...... $125.00 B-tree index and file manager...... $200.00 QTF + Screen editor and text formatter by Leo Brodie, for IBM PC with IBM or Epson printer...... $ 50.00

Nautilus Cross Compiler allows you to expand or modify the FORTH nucleus, recompile on a host computer for a different target computer, generate headerless code, and generate ROMable code with initialized variables. Supports forward referencing to any word or label. Produces load map, list of unresolved symbols, and ex- ecutable image in RAM or disk file. No license fee for applications created with the Cross-Compiler. Prere- quisite: one of the application development systems above for your host computer. Hosts: Z-80 (CPIM 2.2 or MPIM II), 8086188 (CPIM-86 or MS-DOS), iBM PC (PC-DOSor CP/M-86),68000 (CPIM-68K) Targets. 8080, 2-50, 8086188, 6502, LSI-11, 68000. 1802, Z-8 Cross-Compiler for one host and one target...... $300.00 Each additional target ...... 0.00 AUGUSTATM,ADAsubset compiler from Computer Linguistics, for 2-80 computers under CPIM 2.2...... $ 90.00 LEARNING FORTH computer-assisted tutorial by Laxen and Harris for CPIM, includes Brodie's "Starting FORTH"...... $ 95.00 2-80 Machine Tests Memory, disk, printer, and console tests with all source code in standard Zilog mnemonics ...... $50.00 DATA ACE, fully relational data base system from CSD, for the IBM Personal Computer. Faster and more powerful than dBASE II...... $595.00

FORTH application development systems require 48 kbytes RAM and 1 disk drive, Cross-Compilers require 64 kbytes. All software distributed on eight inch, single den- sity, soft sectored diskettes except PClFORTH on 5% inch single sided double density diskettes. Prices include shipping by UPS or first CiaSS mail within USA anc Canada. Callfornia residents add appropriate sales tax. Purchase orders accepted at our discretion. Laboratory Microsystems, Inc. 4147 Beethoven Street Los Angeles, CA 90066 (213) 306-7412

2-80 is a registered trademark of Zilog, Inc. Augusta is a trademark of Computer Linguistics dBASE II is a trademark of Ashton-Tate CPlM is a registered trademark of Digital Research, Inc. IBM is a registered trademark of International Business Machines Corp. PClFORTH and PCfGEN are trademarks of Laboratory Microsystems Inc.

2 Volume V, No. 1 FORTH Dimensions From Interactive Computer the Editor Graphics for Art, Design and learning

This issue of FORTH Dimensions marks my last as Editor. Starting with the next issue (V/2), I’m pleased to pass the baton to Marlin Ouverson, Bob Gotsch, Time Arts, Inc. higher level language than FORTH. A formerly the Editor of the distin- tremendous advantage of guished magazine Dr. Dobb’s A “video paint” program called programming at this level is that any Journal. We can all look forward to EASEL, written in FORTH for use “bugs” are completely visible. interesting issues and new ideas from with several medium-resolution Extensible Software him. Meanwhile, I’ll be dividing my graphics frame buffers (Cromemco Like FORTH, EASEL is interactive time between writing my book on and Digital Graphics Systems among and extensible. The user can select Style and Methodology, and teaching others) allows an artist to create among optional menus and add new FORTH courses. images and illustrations with menus as they become available, or electronic pen on digitizing tablet. program special application menus I want to thank all of you who Video painting is a new medium of such as TV weather effects, display contributed your articles and ideas to expression with characteristics that lettering, or key-frame animation. during the past FORTH Dimensions challenge an artist’s skill and Recently added menu operations, year. Your expertise and dedication imagination and also provide new “oblique” and “perspective,” are has helped make this magazine as creative opportunities. used to create depth illusion. The 64K useful a journal as it is. In particular address space isn’t nearly adequate for I’d like to thank Henry Laxen, a Interactive Visual Programming Interactive trial and error a large and expanding video paint tireless (and I might add, unpaid, as refinement at computer-displayed system, so menus (or more accurately are all ED. writers) columnist, for his images is much more practical than the compiled code to perform their always excellent work, and to Robert Smith, FIG’S own active archivist on with the sticky paint or dried ink of traditional graphic media. There is no standardization. (Both columnists are taking a much-deserved vacation with tube of paint that can run out. Moving, scaling, rotation, this issue, but will return next time.) FORTH Dimensions duplication, and coloring are some of I’d also like to thank regular reviewers Published by FORTH Interest Group the manipulations available. Kim Harris, Michael Perry, Klaxon Volume V, No. 1 Actions are selected in menus that Suralis, Glen Haydon and Bill May/June 1983 pop up when needed on the color Ragsdale for helping me ensure monitor screen. The position of the Editorial technical correctness of published Leo Brodie pen is always shown on the screen as material. Publisher an XORed crosshair; so with menus Roy C. Martens and positional feedback the artist I’m looking forward to more issues Tjrpesetting/F’roduction of interesting and pertinent FORTH rarely needs to take attention away LARC Computing, Inc. news and commentary. In fact I just from the screen. The hand holding the sent off my $15 renewal check. Hope pen becomes an automatic part of the you have, too. process of willing an image into being. FORTH Dimensions solicits editorial Complicated pictures can be built material, comments and letters. No re- See ya. sponsibility is assumed for accuracy of using combinations of line, rectangle, material submitted. Unless noted other- -Leo Brodie circle, and ellipse primitives, frames wise, material published by the FORTH and cells loaded from disk, digitized Interest Group is in the public domain. video images, fills and freehand Such material may be reproduced with credit given to the author and the drawing with various size “pens,” FORTH Interest Group. Cover Art “airbrushes,” and user-defined Subscription to FORTH Dimensions “brushes.” The sequence of actions is free with membership in the FORTH that will result in the desired image, Interest Group at $15.00 per year The end of another beautiful ($27.00 foreign air). For membership, definition as semi-colon sets over whether diagrammatic or illusionistic, change of address and/or to submit the Firth of Forth. -LB is often as critical as the sequence of material, the address is: FORTH Inter- instructions in programming; the est Group, P.O. Box 1105, San Carlos, sophisticated computer graphic artist CA 94070. I 1 is a “visual programmer,” using yet a

~~ ~~ Volume V, No. 1 3 FORTH Dimensions TRANSPORTABLE SOFTWARE actions) are overlays, loaded quickly when needed. Thus the number of fig-FORTH and FORTH-79 Model Systems for: available menu overlays is limited only by disk space. DEC PDP-11 RSX-11 M Access and Applications 0 Multi-User Artists and designers (even the ones Multi-Tasking who would not be intimidated by 0 Re-entrant Resident Library computers) have not had much access Shared Commons to high-priced computer graphics 0 RSX-11M Directive Support equipment. Some applications that currently justify the cost of RT-11 professional graphics systems are Compatible with RSX-11M System RT-11 Programmed Request Support video illustration and real-time animation, story-boarding for film IBM PC and video, graphic design layout, PC-DOS business graphics, scientific CPIM-86 simulation, equipment control and ROM BlOS Support engineering and architectural design. 0 Stand-Alone With cheaper memory and new TRS-80 designs, good frame buffers are TRSDOS becoming available at a fraction of the ROMSupport former cost. This will give many more 0 Stand-Alone artists and designers access to interactive graphics systems. And Data Base Support interactive tools are, most of all, useful for learning. Access to tools for Data Language including: experiment rather than production is a 0 Base Relative Variables necessary part of the creative process. 0 Advanced String Package After imitating old graphics for a 0 Many Classes of Arrays while with new technology, artists can Key File Support be expected to contribute new 0 Hashed Search techniques of graphic representation. 0 Binary Search This development would have been very difficult using the EXORset’s Additional features : BASIC, not least because the BASIC 0 Input and Output Forms Support interpreter uses the graphics display 0 Screen Editors memory, making interactive develop- 0 Execute Variable Support ment of graphics impossible! poly- 0 Extended Memory Support FORTH and its graphics package 0 Additional Control Structures however fit in about 12K bytes, leav- 0 Trace Support with Stack Snapshot ing plenty of room for graphics dis- 0 Decompiling play, data, and the application pro- Text Formatting gram. 0 Time and Date Support 0 Double Integer Support 0 Floating Point Support TransportabIe System Development

0 Consulting Services Come 0 Systems Analysis and Design 0 Communications to the 0 Networking 0 Encryption FORTH 0 Full Sources Available Convention Contact: Transportable Software, Inc. Oct. 14-15, 1983 P.O. Box 1049 Palo Alto, CA Hightstown, NJ 08520 fig-FORTHand FORTH-79 are trademarks 01 Forth Interest Group 0 DEC PDP-11 RSX-11 M RT-11 are trademarks of Digital Equipment Co 0 IBM PC PC-DOSare trademarks of International Business Machines Co 0 CPIM-66 is a trademark of Digital Research Co 0 TRS-60 TRSDOS are trademarks of Tandy Co

=ORTH Dimensions 4 Volume V. No. 1 FORTH in the Arts Three Application Stories

Simulation on the inside is animation but basically a computer graphics Shown here is a print of a digital on the outside. language. a Of computer art The movie is made up of hearts. The I suggest that those of you who are generated by Howard Pearlmutter of ‘ definition of the heart fits on one really concerned about the readability Santa Cruz, California. This valentine screen. It’s basically a loop that goes of FORTH, try doing something that is also a frame out of a one-minute over a certain range that increments is application-oriented, and try using 16mm movie called Tirclove Life ”. either by a positive or negative value the terminology of your application. It was produced on an AED 512 high depending on whether you’re going up The code is extremely readable. resolution color system running 6502 or down and uses the index of the loop Howard Pearlmutter has spurred FORTH as its operating system, to control everything from color to much activity in the area of computer graphics language, and “heart de- size to the spread. You can change the graphics. He is author of a report for scription language. ’’ Once the color table in a variety of ways. We NASA titled Interactive Computer graphics language had been imple- had three different loops built out of Graphics: the Human Interface to mented, it took only three days topro- CMOVES that were running at dif- Dynamic Simulation. Howard is also gram the entire animation, including ferent frequencies. By picking har- the contact for Figgraph, the FORTH the “heart description language. ” monics of these, and getting different graphics special interest group. Howard Pearlmutter spoke at last prime values, you could see the red (408/425-8709) year’s FIG national convention on this move in, the blue move out, and you project: move your three color tables, for the Music three primaries, to go at relatively FORTH Dimensions found Allen Digital Valentine prime frequencies. Strange, Professor of Music at San Colon definitions are great for This not only gives you the building Jose State University, using FOR TH designing scenes, and out of scenes up of elements that you’d like. It also in his campus synthesizer studio. you can build acts; out of acts you can lends itself to the most readable code, We started about one year ago with build entire movies. The natural and exploiting the possibilities of good an Ohio Scientific 6502 system nesting structure of FORTH makes it FORTH style. You get to use the procured on a small faculty grant to perfect for animation. The script for noun-verb idea, the definition of let us experiment with driving analog “Circlove Life” was done right on the scenes. Extensibility is very important synthesizers with digital logic. I was computer, after building a few special because all of this was all built very interested in developing a language types of things such as loop constructs quickly out of something that had that could be used by anyone doing that control the range and parameters nothing to do with computer art, analog synthesis. We’re not talking for the different dimensions. nothing to do with building movies, about commercial analog synthesizers

~~ ~ ~~ Volume V, No. 1 5 FORTH Dimensions . ~ ~ FOR TRS-80 MODELS 1,3 & 4 which are keyboard devices. Our At the same time there are 8 channels IBM PC, XT, AND COMPAQ studio is built around Buchla systems. of A/D input for controlled voltages, Buchla was the first manufacturer in and another 8 channels of input dedi- the early 60’s to produce commercial cated to timing logic, to start and stop The MMSFORTH synthesizers. These use all analog pro- processes in the computer, count gramming with the synthesizer itself. events, etc. System. We were interested in something I’ve been teaching this class for a Compare. that would breathe new life into couple of semesters. Originally I tried analog synthesis. Everyone talks teaching them this language without The speed, compactness and about digital synthesis and forgets getting into FORTH. But we’ve made extensibility of the about the special qualities produced a few additions that make the FORTH MMSFORTH total software more readable, so now I’m really environment, optimized for by analog. the popular IBM PC and In the arts, the big problem when teaching FORTH. One of the changes TRS-80 Models 1, 3 and 4. you’re forced to learn a language is is that we implemented the word An integrated system of that it takes you further away from INTEGER instead Of VARIABLE. INTEGER sophisticated application your art. In music your concept is returns its value to the stack without programs: word processing, translated into notes, then translated having to say “a”,and you can store database management, again into manuscript. Now the poor into by saying “number TO name”. communications, general This makes the description more ledger and more, all with computer guy has to translate it one powerful capabilities, sur- step further. But in FORTH we can natural. For instance, we’ll continual- prising speed and ease of use. call a process anything we want. ly refer back to a number that’s used With source code, for custom You’re back to being closer to your for timing information in a DO modifications by you or MMS. art. We decided FORTH was the way LOOP. If you want to change the tem- 0 The famous MMS support, to go. po, you just say the new tempo TO the including detailed manuals We’ve come up with a language call- variable. and examples, telephone tips, ed MASC-Metalanguage for Analog The students don’t come out hot- additional programs and shot programmers, but they know inexpensive program updates, Synthesizer Control. It’s a series of User Groups worldwide, the about 25 words that lets us do any- what they’re talking about. We’ve MMSFORTH Newsletter, thing we want to do. For instance, we even managed to place a few students Forth-related books, work- can cause the synthesizer to play a in industry working on video games shops and professional major scale, play a minor scale, play it where music is very important. It’s un- consulting. backwards. We can randomize the usual for a music major to graduate notes in a major scale according to and be able to step into a relatively some format. We can create timing high paying job based on the relation- structures in musical terms, such as ship between music and technology. commands called WHOLE-NOTE When we first started, we had about and HALF-NOTE . a hundred words. After doing this for We can define sequences of things. two semesters we’ve thrown out most A World of For instance, we can either play in or of these words because they conform- Difference! type in a series of notes. Then we can ed to too narrow an aesthetic. The danger of including powerful com- Personal licensing for TRS-80: it out in a variety of ways: $129.95 for MMSFORTH, or backwards, forwards, inside out, to mands is that they imply an aesthetic. “3+4TH” User System with generate musical events. The events For a lot of people, the language was FORTHWRITE. DATA- are used to compile phrases; phrases getting in the way. So we took it back HANDLER and FORTHCOM are used to compile sections; sections to the bare bones. for $399.95. to compile compositions. The lan- These questions of aesthetics can be Personal licensing for IBM guage makes it easy for the performer handled very well by FORTH just by PC: $249.95 for MMSFORTH, using this core of words. The students or enhanced “3+4TH” User to reorganize the formal aspects of his System with FORTHWRITE, music. The performer can try putting use : and to generate DATAHANDLER-PLUS and this part first, then try putting it last, their own aesthetic. MASC itself gives FORTHCOM for $549.95. etc. them only the bare tools to pass infor- Corporate Site License Exten- We’re now using a Terak Computer, mation back and forth with the sions from $1,000. which is an RT/ll-based system, a computer. At first the students get small PDP/l 1 . We conned the campus mesmerized and think that the If you recognize the difference computer center into giving us this computer can do everything. But and want to profit from it, ask us thing, and in buying the FORTH we’re careful to teach them to use the or your dealer about the world package. The system uses 32 channels. computer only for what they need it of MMSFORTH. The computer generates 8 channels of for. Like when you need an extra set control output in the range 0 to 10 of eight hands. But making it MILLER MICROCOMPUTER SERVICES complete enough to use for a complete 61 Lake Shore Road, Natlck, MA 01760 volts via D/As and 8 channels of (617) 653-61 36 timing pulses to initiate certain events. performance is too much work, and

FORTH Dimensions 6 Volume V, No. 1 CPU 68K: A/T $695, CSC $850

SPECIFICATIONS: The CPU 68K operates at 8 MHz assembled and tested (NT), and 10 MHz for the Certified System Component (CSC), version of the board.

FORTH HARDWARE REQUIREMENTS: CompuPro’s DISK 1 floppy disk controller; INTER- FACER 1, 2, 3, or 4; 64K of RAM and CPU 68K.

COMPLETE FORTH OPERATING SYSTEM: $200. FEATURES: an assembler, full screen editor, CP/M@ file transfer utility, time-of-dayldate stamping, shadow screen printing utility, and line editor, fully compatible with STARTING FORTH by Leo Brodie, as well as many other useful extensions.

All CompuPro products meet the most demanding mechanical and electrical standards, and are backed with one of the best warranties in the business (1 year limited warranty on all BOARD LEVEL products, 2 year limited warranty with exchange program for products qualified under our Certified System Component pro- gram). Call CompuPro at (415) 562-0636 for additional information or to order.

COMPLETE 68K SYSTEM - $8995 INCLUDES:

0 ENCLOSURE 2 DESK TOP 0 8 MHz CPU 68K 0 SYSTEM SUPPORT 1 0 INTERFACER 4 256K BYTES OF 16-BIT MEMORY 1.5 MBYTES OF M-DRIVE/H 0 DISK 1 CONTROLLER 0 DISK ENCLOSURE WITH 2 QUME DRIVES (2.4 MBYTES) 0 ALLCABLES 0 mapFORTH & CP/M-68KTM

CP/M IS a reglsterec trademark of Dlgrtal Research

AUTHORIZED SYSTEMS CENTERS offer complete installation and implementation of our CPU 68K SYSTEM, Call (415) 562-0636 and ask us for the name of the SYSTEMS CENTER nearest you. Price shown does not include dealer installation and support services.

CompuPro division Godbout Electronics - Oakland Airport, CA 94614

Volume V, NO. 1 7 FORTH Dimensions FOR 8080,280,8086*,68000” not worth it. MASC could probably visual mixing console that controls 16 be critized for not taking care of slide projectors and four 16mm certain things such as generating projectors, as well as an audio tape MU LTI U S E R simple envelopes or random voltages. machine with time code and music. MULTITASKING But the synthesizer itself does these The combination allows you to do a things, so there’s no need to submit very complex mix of music and images A professional quality full feature that task to the computer. Still, the in real time. FORTH Inc. was the only FORTH system at a micro price. vocabulary is there to make these consulting firm who said “we can do things, if necessary. that.” We’ve been using FORTH for A keyboard makes strong aesthetic around two years now. TaskFORTH’“ implications. Our synthesizer uses We recently bought a frame store, keys, but keys don’t necessarily mean originally as a tool for aligning the op- pitches. A keyboard is simply a tical printer. But the one we bought Single. double, triple. voltage divider. We can use the went far beyond what we needed be- quadruple and floating point keyboard to call up words. Say we cause we got a good deal on it. Once math, trigonometric functions have a word called FUNl which Paul Rother, our programmer, got it working the software happened very Case statements produces a bunch of random pitches and spins the sound around the room fast. In a month we had a full fledged Interactive debugger in our quadraphonic studio. (We can paint function, written completely in move sounds dynamically.) Then we FORTH, with all kinds of features. Novice Programmer have a word called FUN^ which plays a It’s 512 by 512 by 7 bits. We can paint Protect io n Pac ka g eTM C major scale in the right hand speak- to the RGB monitor, make slides, or er and FUN3 which plays a C major movies that interface to the optical Multiple thread dictionary chord on another speaker. We put printer. Since then we’ve used the paint program on all of our rock System datelcalender clock these words in an execution array. If we hit key 1, FUNl will play, but if we promos, including the film we Hierarchical file system hit key 16, FUN2 will play, will play, developed for Steve Miller’s etc. So we can play the structure of a A bracadabra. Screen and serial editor composition not by playing notes but On that promo we shot actors on by playing words. film, then fed it into the digitizer. Inter-task communications The keyboard is a series of Then frame by frame an animator would draw on top of the picture. The Unlimited number of tasks touchplates that know how hard you’re hitting by reacting to body electronic graphics are later Starting FORTH, FORTH-79 capacitance. So if you press the key recornposited back with the original and FORTH-83t compatible hard it will spin around the room at movie. It’s a form of electronic one rate; press soft, it will spin at rotoscoping. We created action in the Graphics support another rate. You decide what frames that was not in the original; elements you want to control and what sparkles, enhancements, etc. In one element you want to control it, then scene there’s a girl juggling scarves, lit TaskFORTH is the FORTH the commands that recognize by an overhead light. The animator system you would write. those actions. Over the last couple of tied her hand to the shadow of her if you had the time. . . years we’ve had over 50 people work hand on the floor with an electronic line as if it were a rubber band. That ALL included for just $395 on this. What we have is universal so it (plus applicable taxes) should be very useful to a lot of particular film has won awards all people. over the world. It just got nominated Available for CP/M. Northstar DOS. for best director American Video Microoolis and Stand-alone Note: The system described here will Awards 1982. be taught in a two-week course We just did one called Atomic Dog Visa & MC Accepted starting on July 11, 1983. Contact for George Clinton. We created a Allen Strange, Music Department, fictitious video game called Atomic * Available soon San Jose State. t When standard IS approved Dog, using the computer graphics.

CP/M IS a trademark of Dlgltal Research Then we had a location that matched TaskFORTH IS a reg trademark of Shaw Labs. Ltd Multi-Media and Rock Promos the game. The guy goes down into the Single user. single computer license agreement FORTH Dimensions interviewed game like TRON and the game comes IS required Peter Conn, President of Homer and alive with dancers. At the end of the Associates in Hollywood, California. four minutes he ends up back at the We have two main computer video arcade. You can see the live SHAW LABORATORIES, LIMITED 24301 Southland Drive, Suite 216 systems that work together. One is a action doors, with the computer doors Hayward, California 94545 computerized optical printer right next to them. We also have (415) 276-5953 interfaced to a paint system (raster developed a three-screen multi-media graphics). The other is a 24-channel show that will play in all the Six Flags

FORTH Dimensions 8 Volume V, No. 1 amusement parks across the country, and we did The Great Rock and Roll Time Machine which is playing at Magic Mountain right now. We developed these using the mixing console. Everything transfers to film, so the actual performance is all done on three synchronized projectors.

Developing our own paint system has saved us a lot of money. There are some products that are similar, but they’re too expensive, in the $60,000 range. We’ve spent a lot less than that, and we have special features too. The best thing about our system is that it’s programmable. You can sit there and change it, because it’s in FORTH. Chuck Moore wrote the inital application on the mixing console. Paul Rother has done all the programming since then, and he’s now part time. With their work, and with Peter Conn, owner of Homer & Associates, sits at the electronic painting station of thP+ FORTH, I’m able to set up these computerized optical printer. From an album cover drawn by Andy Warhol, Peter is creating > complex scenes myself. scene for a rock video for Billy Squier. AN software was written in FORTH by Paul Rother.

f JOIN THE APPLICATION MIGRATION! PRODUCE MACHINE TRANSPORTABLE CODE. GENERATE ROMABLE/HEADERLESS CODE. FORWARD REFERENCING ALLOWED. PUT FORTH ON OTHER COMPUTERS. PRODUCE EXECUTABLE IMAGE IN RAM OR ON DISK. PRODUCE ADDRESS MAP OF APPLICATION. NO LICENSE FEE OR ROYALTIES ON APPLICATIONS.

fig FORTH CROSS-COMPILERSby NAUTILUS SYSTEMS Apple, Atari, TRS 80 Model I, Zenith, and Northstar fig FORTH CROSS COMPILER by LABORATORY MICROSYSTEMS CP M 80, CP/M 86, IBM PC , and 68000 (requires LAB FORTH at additional cost) 79 Standard Systems by MOUNTAIN VIEW PRESS CP/M 80 $300.00 + tax and $5.00 shipping and handling

Apple IS a tradernark of Apple Computer Inc Atari IS a trademark of Atari Computer TRS-80 IS a trademark of Tandy Corp Zenith IS atrademark of Zenith Radio Corporation Northstar isatrademarkof NorthstarComputers IBM IS a trademark of International Business Machines Inc Nautilus Systems I P.O. BOX ~O~~SANTACRUZ, CA 95061

Volume V, No. 1 9 FORTH Dimensions

3-D Animation

Paul Lutus and Phil Thompson This is the technique used by object command is given. For ex- GraForth. ample, if you type: The following article is reprinted GraForth allows you to manipulate 3 OBJECT from a series titled “The Animated 3-D objects through direct high-level 30 XROT Apple With GraForth ’’ originally ap- commands. For example, the Gra- 10 SCALE pearing in Softalk Magazine. Forth word scale sets the displayed size then object 3 will be rotated 30 units In any type of computerized 3-D of a 3-D object, xrot rotates the object around the X axis and scaled to a size graphics system, you start by creating about the X axis, and ypos sets the of 10. To manipulate a number of ob- a set of points, lines, and shapes in vertical position of the object on the jects, you select each object in turn 3-D. Every point has a relationship to screen. These straight-forward com- with object, then give the appropriate every other point: it can be higher or mands provide an easy-to-follow commands for that object. lower, closer or farther away, and method of generating 3-D graphics. Here is a quick summary of the in- more to the left or right. And, of The 3-D process can be divided into dividual 3-D commands, their effects, course, this relationship depends on two parts: first, the image is created and the appropriate ranges of num- your point of view. The three different using the Image Editor supplied on the bers to use: direction aspects of a point are repre- GraForth system disk. Then, the Xpos, ypos. These set the X and Y sented using three numbers, or coor- GraForth commands are used to read position on the screen of the 3-D point dinates, labeled X, Y, and Z. It’s the the image and draw the object on the (O,O,O) for the object and are used for computer’s job to convert your set of screen with the appropriate rotation positioning the object in the appro- points according to some formula into and scale. The image may reside in any priate place on the screen. Xpos can points on a two-dimensional screen, free area of memory and is not chang- range from 0 to 255 and ypos can using only X and Y coordinates. Then ed by the drawing commands. range from 0 to 191. At the extremes, the points are connected with the ap- however, the object may overlap the propriate lines, just as the 3-D points Let’s define a couple of words for edge of the screen, causing wrap- were connected with lines. this discussion. An “image” is a set of around. There are two different philosophies 3-D points and lines as stored in Scalx, scaly, scale. These commands used in creating 3-D graphics. For the memory. An “object” is a picture of determine the size of the object on the first, imagine a universe in which all of the 3-D image as it is manipulated and screen. Scalx sets the width and scaly the 3-D objects exist. You describe the actually displayed on the screen. Im- sets the height. The word scale simply objects and tell the computer where ages can reside in memory without sets both width and height to the same they are in the universe. You then being assigned as objects and drawn; number simultaneously. The range is decide where your eye is, and which and two objects, though positioned from -3 1 to 31. A scale of 0 produces direction you’re looking. The com- and oriented differently on the screen, a displayed object with no thickness, puter figures out which objects lie in can both use the same 3-D image in and negative numbers create a mirror- that direction, converts them into a memory. (For example, two rotating image effect. Since two objects can use single two-dimensional image, and cubes on the screen can use the same the same image in memory, draws that image on the screen. This set of 3-D lines.) symmetrical objects, such as bird wings, can be created using two concept makes it fairly easy to repre- For each image, the X, Y, and Z objects side by side, with positive and sent complex scenes, but manipulating coordinates can range from -128 to negative scale numbers. individual objects within that scene 127, giving a possible 256 positions can be more time-consuming. along each of the three axes , which is Scalz. This determines the amount Another philosophy is to treat each plenty for most applications. The ac- of perspective used. Perspective is 3-D object separately on the screen. tual number of lines in an image is what causes the front of an object to You describe each 3-D object, then tell limited only by the amount of avail- appear larger than the back. A large the computer where the objects should able memory. (Each end point of line perspective number makes the front a good deal larger, and negative num- appear on the two-dimensional screen entry in the image uses four bytes of bers provide “reverse perspective,” (or if they should appear at all), what memory.) size to draw them, and how they with the back of the object larger than should be oriented. Each object is con- Up to sixteen different objects can the front. Zero perspective means the verted from three dimensions to two, be manipulated at one time in Gra- front and the back will be the same independent of every other object. Forth. They are numbered 0 through size. The range, as above, is -3 1 to 3 1. This means complex scenes can 15, and referenced with the GraForth Xrot, yrot, zrot. These commands require more programming to pro- word object. After giving an object rotate the current object around each duce, but manipulating each in- command, the 3-D commands will of the three 3-D axes. A complete dividual object is faster and easier. manipulate that object until another rotation is divided up into units from 0

Volume V, No 1 11 FORTH Dimensions to 256. Zero is no rotation, is a loop value, incrementing from 0 to Parameter Range In steps of 64 XPOS 0 10 255 1 right angle, 128 is the same as 180 256. YPOS 010 191 1 degrees, and 192 is three-quarters This type of animation is SCALX -31 to31 1 straightforward, but for most SCALY -31 1031 1 around the circle. Values greater than SCALE -311031 1 256 or less than 0 can also be used for applications a number of parameters SCALZ -31 1031 1 rotating more than once around. For need to be manipulated at once. Let's XROT 0 lo 255 2 YROT 0 to 255 2 example, a rotation to 258 units is the look at how to do more complicated ZROT 0 to 255 2 same as to 2 units. manipulations with a few examples. XTRAN - 128 to 127 1 When using a do-loop, usually one YTRAN -12810 127 1 Note: The actual rotation of the ob- 1 ject changes for every other rotation draw will be performed each time ZTRAN -12810127 value. This means that if you rotate an through the loop. The size of the loop OBJCOLOR 1,2,3,5.6.7 object in steps of 1 unit per draw, the then determines how many times the Table 1. view of the object will change every object will be drawn. To change the other draw, making the animation ap- parameters, two approaches are Now we'll look at a program pear slower. It's best to increment possible: the loop value can be used to adapted from the "rolling rotation values in steps of 2. generate the desired parameter values, tetrahedron" display in the GraForth Xtran, ytran, ztran. These com- or separate variables can be used to demonstration program. The mands translate, or "slide," the ob- keep track of each parameter. tetrahedron moves down and to the ject in each of the three directions in In the first method, the conversion right, rotates end over end, and grows space. The object can be shifted as from loop value to parameter value is and shrinks, giving the appearance of long as none of its points falls out of done with short formulas. For rolling closer, then farther away. You the -128 to 127 position range. If this example, if you want the tetrahedron can use this routine with any image in happens, a wraparound effect will oc- to rotate around the Y axis three times memory. cur. Therefore, translation works best for each rotation around the X axis, with small images, having room to you can use this routine: move. :THREE.ROT Objcolor. This determines what the 257 0 DO object's color will be when it is drawn I XROT if color was not specified when the im- 13'YROT age was created. If color was speci- DRAW fied, then objcolor is ignored. The 2 +LOOP; standard GraForth color numbers (1 After entering three.rot into the through 7) are used. Note that obj- editor and compiling (or entering it color also sets the normal color com- directly from the keyboard), it can be -361 mand, so be sure to reset color to the run by simply typing: Figure 1. desired value after using objcolor. THREEBOT Table 1 shows the 3-D parameters The trick is to find the right formula : ROLLOBJECT and the range of values they use. You for the desired motion. Suppose, with 37 0 DO can experiment with the definitions by the above example, you also wanted to 13 'XROT changing some of the parameters from make the tetrahedron grow in size I5"YROT the editor and recompiling. Of course, from 12 scale to 20 scale. The change 16'25+XPOS you can also type the word definitions from 0 to 256 in the loop must be 13'35+YPOS directly into GraForth from the translated to change from 12 to 20. I 18 - ABS CHS 18 + SCALE keyboard. Note that the difference between the DRAW Creating animations with start and end loop values is 256, and LOOP ; GraForth's 3-D graphics is easy and the difference in the scales is 8. If we straightforward. As we mentioned in divide the loop value by 32, we get a None of these formulas were arrived an earlier column, animation is simply range of 0 to 8. If we then add 12, we at by magic. As the routine was a series of still pictures displayed get the desired range of 12 to 20: written, we tweaked each formula b rapidly one after another, providing Loop value 0 132 = 0 ... 0 + 12 = 12 until we got the desired display. Here the effect of movement. One fast way Scale value are the numbers that come out: to generate this movement is with a Loop value 256 132 = 8 ... 8 + 12 = 20 Loop value: 0 to 36 do-loop: Scale value XROT: 0 to 108 The new routine looks like this: YROT: 0 to 180 257 0 DO I YROT DRAW 4 + LOOP : ROT&SCALE XPOS 25 to 241 This example rotates the object a 257 0 DO YPOS 35 to 143 full circle around the Y axis. Since the I YROT SCALE: 0 to 18, then back to 0 loop is in steps of four, it repeats 64 I3"YROT times, producing 64 separate draws, 1321 12 + SCALE The scaling formula deserves more one after another. For each draw, the DRAW comment. The desired effect was to rotation around the Y axis is set to the LOOP ; have the object grow and then shrink.

FORTH Dimensions 12 Volume V, No. 1 We could have used two scaling loops YP 3 + DUP -> YP YPOS (increase Y screen-flipping 3-D graphics can be one after another-the first increasing position by 3) mixed with other kinds of graphics and the next decreasing. But then we DIR IF (if scale is increasing:) without causing lines and characters to would have had to keep all the other sc 1 + DUP -> sc SCALE (increase repeatedly appear and disappear. parameters moving smoothly through scale by 1) The sequence GraForth uses in the transition from one loop to the SC 18 = IF 0 -> DR THEN (change putting a 3-D object on the screen is a next, without a skip in values. For direction?) four-step process: whenever the word simplicity, we decided to use a single ELSE draw is executed, the drawing routines loop. sc 1 - DUP -> sc SCALE (Decrease are first directed to the graphics screen With the loop value moving from 0 scale by 1) that is not currently being displayed. to 36, we wanted the scaling function THEN ; Then the previous 3-D objects are to slide from 0 to 18 and back to 0. : ROLL.TETRA1 individually erased line by line by This can be shown with Figure 1. o - >XR o -> YR (initialize following the parameters that were Figure 2 shows the steps we used to variables) originally used to draw them. Next, achieve the effect. Sometimes a more 25 ->XP 35-> YP the new objects are drawn on the complicated animation cannot be 0 ->sc screen using the current parameters. performed inside a simple do-loop. 1 -> DIR (set scale direction) Lastly, the display is switched to this This is especially true if the user is DRAW (Draw first object) screen, so that the new objects can be interacting with the program through 36 o DO (Start loop) seen. a joystick or keyboard, and the UPDATE.TETRA (Set new To increase speed, the word draw program must make decisions. In this parameters) only works with the objects that have case, it’s often best to use separate DRAW (Draw object) been referenced since the last draw variables to keep track of each LOOP ; (Loop back) command. This reference can be made parameter. The parameters can then by giving the object one or more new be updated at any time from the We used a do-loop to run the animation since no branching parameters, or by simply calling it running program. The following again with object. This means that program duplicates the Roll. Tetra decisions were needed for this program. If they were required, the objects that don’t need to be changed routine using this technique. can be left on the screen as they are VARIABLE XR (x rotation) current value of any 3-D parameter would always be available. and will not slow the drawing of VARIABLE VR (Y rotation) objects still in motion. VARIABLE XB (X position) For smooth animation, the VARIABLE YP (Y position) GraForth 3-D graphics routines Suppose you’re manipulating two VARIABLE SC (Scale) automatically take advantage of both 3-D objects (call them objects 1 and 2) VARIABLE BIR (Scale direction hi-res screen pages in the Apple simultaneously. First, both of them larger or smaller?) memory. During 3-D animations, one are in motion, and the animation screen area is displayed while the other toggles between the two graphics : UPDATE.TETRA is being invisibly updated. This way, screens with each draw command. XR 3 + DUP -> XR XRM (increase X the lines are not shown being erased Then you decide to stop the motion of rotation by 3) and redrawn. This is only true for 3-D object 1, while continuing object 2. To Y R5 + DUP -> YR YRM (increase Y graphics. GraForth text printing, line do this, you simply stop giving object rotation by 5) drawing, and character graphics 1 any new commands. Since object 1 XP6 + DUP-> XP XWS (increase X always draw to both screens position by 6) simultaneously. In this way, the (Continued on bottom next page)

-36 1 -36 1 - 36 1 Start with loop value Subtract 18 Take the absolute value Turn it upside-down Add 18 I 18 - ABS CHS 18 i Figure 2.

Volume V, No. 1 13 FORTH Dimensions The Mullard Space Science enable fast software development the brightness. When a satisfactory image laboratory, part of the Department of interactive, high-level language has been accumulated the data may be Physics and Astronomy of University polyFORTH was selected. saved on floppy disc, and transferred College, London, is currently running For detector development or to a minicomputer for detailed image polyFORTH on a Motorola EXORset ground-based use, each individual processing if required. Since the build 33 to tackle the problem of displaying photon registered by the detector has up of the image can be monitored in and storing data produced by its latest its coordinate recorded in the memory real time, the accumulation of useless generation of imaging detectors. of the EXORset, allowing an image to data can be stopped at an early stage, The detectors will be used on future be built up over a period of minutes. reducing wasted time. space missions to record X-ray images The multi-tasking capabilities of poly- This development would have been of distant astronomical objects, and FORTH allow an image display to be very difficult using the EXORset’s also at ground based observatories generated on the graphics screen and BASIC, not least because the BASIC where their extreme sensitivity will al- updated in real time with an overlay of interpreter uses the graphics display low observations of the faintest and numerical data, which is also fre- memory, making interactive develop- farthest known galaxies in the quently updated, while the data from ment of graphics impossible! poly- universe. the detector is handled on an interrupt FORTH and its graphics package A desktop microcomputer system basis. The operator may also enter however fit in about 12K bytes, leav- was chosen for the task since it could commands via the keyboard function ing plenty of room for graphics dis- meet most of the system requirements keys during the accumulation of an play, data, and the application pro- at a much lower cost than commercial image. gram. systems, and special features could be The image data may be displayed in included by writing the necessary con- a variety of ways, such as a “contour” This article is reprinted from a trol software. The chosen computer 3D projection, or as a “grey-scaled” periodical published by Comsol Ltd., was the Motorola EXORset 33, based image by assigning a different number England. on the MC6809 microprocessor. To of dots to each pixel according to its

(3-0 Continued) was previously in motion, the picture object lies in, and then not to bother An easy way to determine the block of the object on the two graphics doing a line-by-line erase. size and placement to use with undraw screens is different. As the animation The GraForth word undraw is is to fill the screen with characters, continues with object 2, the display designed for doing just this. Undraw then draw the object over them: will switch back and forth between the erases a portion of the screen just as 0 VTAB 1000 0 DO I 10 MOD. LOOP 0 two screens. The two pictures of unblk does, on a character-size basis. OBJECT DRAW object 1 will alternate back and forth, However, undraw also sets a flag By simply counting down and rather than remaining still. telling GraForth not to do a line-by- across, you can see that the cube fills a The solution to this problem is line erase of the 3-D object. After block nine characters wide by eight simple: when you don’t need to move setting the block size and the position characters tall, starting at 8 vtab 14 an object any more, give it one extra appropriately, you can erase the ob- htab. The undraw command can be object command, without any new ject yourself, so that the 3-D routines used to erase this block during a 3-D parameters: don’t have to erase it. This method animation: 1 OBJECT requires that you know what rectangu- ERASE This will cause the same picture of lar area of the screen is used by the ob- 9 8 BLKSIZE the object to be drawn on the second ject and that no other graphics line in Now type this entire line, and then graphics screen. The two pictures of this area, since they would also be press the return key: the object will then be identical, and erased. 8 VTAB 14 HTAB 257 0 DO the object will remain still while other Here is an example of using undraw. I YROT UNDRAW DRAW 4 +LOOP objects are manipulated. Starting from scratch, let’s first get an 18 VTAB Moving Faster. With a little extra object onto the screen: o 40 18 24 This sets the character position for planning, the speed of 3-D graphics WINDOW ERASE (Optional) the block and rotates the object while can often be increased considerably. CR 132 PUTC PRINT “ BLOAD erasing the block with undraw. The line-by-line undrawing of each CUBE,A2816 ” CR Compare it with the same loop 3-D object uses as much time as OBJERASE without undraw: drawing the new object. A faster 0 OBJECT 5 SCALE 257 0 DO I YROT DRAW 4 +LOOP method to remove old images is simply 20 XROT 20 YROT The difference is quite noticeable. to erase the area of the screen the DRAW

FORTH Dimensions 14 Volume V, No. 1 7

I

THE FORTH SOURCE" MVP-FORTH - A Public Domain Product 0 MVP-FORTH Mete Compllw for CPlM Programmer's kit. Use MVP Forth is fig-FORTH updated to the FORTH-79 Standard Requlred for applicatons on CPlM based computer. Includes public Word Set The source is public domain Included are an editor, FORTH domain source $1 50 assembler, tools and utilities making it compatible with the instructional MVP-FORTH Fast Floatlng Pdnt for APPLE Programmer's book SfarffngFORTH Except for hardware dependencies all high level 0 Kit. Includes 951 1 math chip on board with disk and FORTH is transportable between all systems Modifications and exten- documentation. $400 sions can be simplified through the use of MVP-FORTH Programming Aids and Meta and Cross ComDilers 0 MVP-FORTH Programming Aids for CPIM, IBM or APPLE Programmer's Kit. Extremely useful tool for decompiling. callfinding, and translating. $1 50 MVP FORTH Books - A Series 0 MVP-FORTH by ECS Software for IBM-PC or ATARP 400l800. Standalone with screen editor License required. Volume 1, All about FORTH by Haydon MVP-FORTH C Upgradeable $1 00 glossary with cross references to fig-FORTH Sfarbng FORTH and FORTH-79 Standard 2"d Ed $25 0 MVP-FORTH by ECS Software for IBM-PC or ATARI 400/800. Enhanced with color animation, multitasking sound, utilities, Volume 2, MVP-FORTH Assembly Source Code Includes C and unlimited run time license. $1 75 CP/M@ IBM-PC@ and APPLEm listing for kernel $20 0 MVP-FORTH Professional Application Development System (PADS) for CPlM, IBM-PC, or APPLE. A three level integrated MVP-FORTH Software - A Transportable FORTH system with complete documentation. Complete system $400 0 MVP-FORTH Programmer's Kit including disk documen- $1 5C 0 MVP-FORTH PADS enhanced virtual system $1 50 tation, Volumes 1 & 2 of MVP-FORTH Series (All About FORTH. 2"d Ed & Assembly Source Code), and Sfarffng+c4 0 MVP-FORTH PADS Programming Aids $1 50 FORTH Specify 0 CP/M 0 CP/M86 0 MSDOS c1 APPLE 0 MVP-FORTH PADS Meta Compiler $1 50 0 IBM-PC 0 TRS-80/1B or 3 L7 TRS Color Computer * * * MVP-FORTH operates under a variety of CPU's. computers, and 0 MVP-FORTH Cross Compiler for CP/M Programmer's Kit operating systems CP/W disks can be supplied 8". SSISD. 3740 Can also generate headerless code for ROM or target format or 5V4 for @borne@ Northstar" Micro Decisions@ Kaypro@ or CPU $300 H89lZ8P Specify your computer and operating system * * *

FORTH DISKS FORTH MANUALS, GUIDES & DOCUMENTS FORTH with editor, assembler, and manual. 0 ALL ABOUT FORTH by 0 1982 Rochester FORTH 0 APPLE by MM s1Oo 0 IBM-PC@ by LM $100 Haydon See above $25 Proc. $25 0 APPLE by Kuntze $90 c7 NOVA by CCI 8" DS/DD$15O 0 FORTH Encyclopedia by 0 A FORTH Primer $25 0 ATARla valFORTH $60 0 280 by LM $50 Derick & Baker 2°C Ed C Threaded Interpretive 0 CPMB by MM $loo 0 8086188 by LM $1 00 Programmer's manual to fig- Languages $23 FORTH with FORTH-79 0 AIM FORTH User Man $1 2 0 HP-85 by Lange $90 D VIC FORTH byHES, VIC20 references Flow charted $25 0 HP-75 by Cassady+c* $1 50 cartridge $60 U APPLE User's Manual 4 MM $20 Enhanced FORTH with. F-Floating Point, G-Graphics. T-Tutorial. 0 FORTH Encyclopedia +. S-Stand Alone, M-Math Chip Support, MT-Multi-Tasking. X-Other Pocket Guide $7 0 METAFORTH by $30 Extras, 79-FORTH-79. 0 And So FORTH by Huang A 0 APPLE by MM, 0 Extensions for LM Specify college level text $25 0 Systems Guide to fig- F, G, & 79 $1 40 IBM. Z80, or 8086 FORTH $25 0 FORTH Programming by 02EFFloating 0 Caltech FORTH Manual $1 2 0 ATARI by PNS. F,G. & X $90 Scnnlon_. $1 00 0 invitation to FORTH $20 @ CPlM by MM, F & 79 $140 0 8087 Support 0 FORTH on the ATARl by E 0 Apple, GraFORTH by I $75 (IBM-PC or 8086) $I 00 Floegel $8 0 PDP-11 User Man. $20 0 Multi-Tasking FORTH by SL, 0 951 1 Support 0 Starting FORTH by Brodie 0 CPlM User's Manual, CPIM. X & 79 $395 (Z80 or 8086) $1 00 Best instructional manual MM $20 0 TRS-8011 or 111 by MMS 0 Color Graphics available (soft cover) $1 8 0 FORTH-79 Standard $1 5 F, X. & 79 $1 30 (IBM-PC) $1 00 0 Starting FORTH (hard 0 FORTH-79 Standard cover) $22 Conversion $1 0 Timex by FD. tape G.X, & NEW o~~~$~~nt$200 0 79 1980 FORML Roc. $25 Tlny Pascal fig-FORTH $10 $45 Requires LM FORTH disk. 0 0 0 1981 FORML Roc 2 Vol $40 NOVA fig-FORTH by CCI by LH3include$s95 0 Victor 9000 by DE, G,X NEW 0 Starting FORTH 1982 FORML Roc. $25 Source Listing $1 5 $1 50 0 1981 Rochester FORTH 0 NOVA by CCI User's Manual fig-FORTH Programming Aids for decompiling, callfinding, 0 0 Proc. $25 includes editor assembler, @ and translating. CP/M, IBM-PC, 280, or Apple $1 50 and iutilities $25 CROSS COMPILERS Allow extending, modifying and compiling for 0 Installation Manual for fig-fORTH $1 5 speed and memory savings. can also produce ROMable code. *Requires FORTH disk. Source Listings of Iig-FORTH, for specific CPU's and computers The Installation Manual is required for implementation Each $1 5 0 CP/M $300 0 IBM. $300 0 8086- $300 0 Z80. $300 0 1802 0 6502 0 6800 0 AlphaMicro 0 Northstar $300 0 Apple 11/11 + $300 0 8080 0 8086l88 9900 0 APPLE II 0 PACE 0 6809 0 NOVA 0 PDP-1 IILSI-11 0 FORTH Computer - Jupiter Ace $1 50 68000 Eclipse VAX 280 0 16K RAM Pack $50 0 0 0 0 48K RAM Pack +** $1 25 Ordering Intormatlon: Check Money Order (payable to MOUNTAIN VIEW PRESS 0 ParlSec Interface $1 00 INC ) VISA Mastercard COD s $5 extra No billing or unpaid Po s California residents add sales tax Shipping costs in US included in price Foreign orders pay Key to vendors: LM Laboratory Mlcroiyitems in US funds on US bank include for handling and shipping by Air $5 for each item CCI Capstone Computlng Inc. MM MlcroMotlon under $25 $1 0 for each item between $25 and $99 and $20 for each item Over DE Dai-E Systems MMS Miller Microcomputer Senlces $1 00 Minimum order 51 5 All prices and products subject to change or withdrawal FD ForIh Dimension NS Nautilus Systems without notice Single system andlor single user license agreement required on I lnsofl PNS Pink NohStudlo some products LH Laxen and Harris SL Show Labs DEALER I AUTHOR INQUIRIES INVITED MOUNTAIN VIEW PRESS, INC. PO BOX 4656 MOUNTAIN VIEW. CA 94040 (415) 961-4103

Volume V, No. 1 15 FORTH Dimensions Double-Precision Math Words

L .H. Bieman Energy Development Associates (a Gulf+ Western Company) Madison Heights, Michigan 120 TRIAD

Convinced of the beauty of pro- SCR # 120 0 ( DOCIBLE PRECISION MATH WORDS - BIEMAN gramming in FORTH, I started an ap- 1 : 2SWAP ( D2vDl --- Df ,I32 ) plication to interface a lab experiment 2 ROT >R HOT R> : with a microprocessor. (Another fac- 3 : OVER2 ( NBvN2rNl --- N3v N2. N1 v N3 ) tor was that FORTH was the only lan- 4 >R OVER R> SWAP : 5 : D/SIGN ( D2,Dl --- 112. D1. NSIG ) guage available besides Assembler and 6 OVER2 OVER- XOR : I am not fond of programming in 7 : D/ D2vD1 --- NQUOTIENT ) Assembler.) My scientific background 8 D/SIGN >R ( FIND SIGN AND STORE 1 yearned to use floating-point math, 9 DABS DUP 1+ DUP >R LI/ SWAP DROP but I decided to stick with the credo of 10 ( BREAK DIVISOR INTO Nl*N2 ) 11 >R DABS R> U/ SWAP DROP ( DIVIDED BY N1 FORTH programmers: use integer 12 0 R> U/ SWAP DROP ( nIVIDEIi BY N2 ) arithmetic; it's fast and exact. Unfor- 13 R> +- ( PUT SIGNON QUOTIENT) tunately, my application required the 14 ;S use of double precision numbers for 15 which there were very few math opera- tions in my version of FORTH. SCR # 121 0 ( DOUBLE PRECISION MATH WORDS - BIEMCIN ) 1 : T* ( UDVUN --- UT 1 There were four basic operations 2 DUF ROT Uo >R >R ( MULT UPPER PRECISION PART ) available: double precision addition 3 U* ( MULT LOWER PRECISION PART ) subtraction; multiplication of two 4 0 R> R> D+ ( ADD BOTH PARTS ) : singles to form a double; and division 5 : T/ ( UTVUN --- UD 1 of a double by a single, yielding a 6 >R R U/ SWAP ( DIVIDE UFFER PRECISION PART ) 7 ROT 0 R U/ SWAP ( DIVIDE LOWER PRECISION PART 1 single. This was not enough for my 8 ROT R> U/ SWAP DROP ( DIVIDE REMAINDER ) application. I needed to take the ratio 9 0 2SWAP SWAP D+ ( ADD PARTS > : of two double precision numbers, 10 : U*/ ( UD.UNsUN --- UD ) scale double precision numbers, etc. 11 >R T* R> T/ : Thus, I did what a FORTH 12 :S 13 programmer must, create the needed 14 words. Hopefully these words, which 15 are found on the three screens shown, will help others who have a version of FORTH with limited double precision SCR # 122 0 ( DOUBLE PRECISION MATH WORDS - BIEMAN ) math. 1 : SA ( D.N --- DABS. ABS, SIGN 1 2 2DlJP XOR >R ( FIND AND SAVE SIGN ) The math words for signed numbers 3 ABS >R DABS R> R> ( CHFINGE TO AES 1 : include: 4 : D*S ( DrN --- D) 5 5A >R T+ DROP R> D+- ( MULT DOUBLE TIMES SINGLE 6 : D/S ( DvN --- DI D/ Takes the ratio of two double 7 SA >R 0 SWAP T/ R> D+- ( DIVIDE DOUBLE BY SINGLE precision numbers to yield a 8 : D*/ ( DvN2rNl --- D) single precision quotient. 9 >R SA R> DUP ROT XOR >R APS ( FIND SIGN AND ABS I 10 U*/ R> D+- ( CALCULATE AND SET SIGN ) ! 11 ZS D m S Multiplies a double times a single 12 precision number to yield a 13 double precision product. 14 15

DIS Divides a double by single precision number to yield a , ok double precision quotient.

FORTH Dimensions 16 Volume V, No. 1 D~ITakes a double precision and FORTH Dimensions requested our multiplies and divides by single resident math operator authority (and precision numbers, yielding a Standards Team Secretary) Robert L. FORTH double precision (very useful for Smith, to review Mr. Bieman’s scaling). contribution. Mr. Smith writes: for I implemented and tested the The math words for unsigned functions described in this article and numbers include: found that they worked pretty much VICTOR 9000 as advertised, and even better than TX Multiplies a double times a single expected. I expected that the DI routine precision number to yield a triple Microcomputer would fail because the factoring of the precision product. double precision divisor would yield Dai-E FORTH Level I two single precision numbers whose Beginner‘s Package in . TI Divides a triple by a single precision Fig-FORTH Style number to yield a double product would not give the original I precision quotient. double precision value. That turns out Including: to be not as important as I assumed Screen Editor, 8088 US/ Takes a double precision and because of the order in which the Assembler, Graphic Interface, multiplies and divides by a single partial quotients are taken. It is likely, Sound Generation, Math- precision number, yielding a however, that the quotients are just matical extensions, games double precision. slightly more inaccurate than one and many more.. . would obtain from a very precise “And So FORTH” (374 page technique. I was surprised also at his manual) In the comments found on the suggested method of obtaining the screens, U stands for unsigned, N double precision quotient of two US $15Ooo stands for single precision, D stands double precision numbers. However, for double precision and T stands for if the denominator has a high order triple precision. For some versions of part of zero, then the quotient will be Level FORTH the R must be replaced with OK, with proper full precision. If the Dai-E FORTH II R@. Another item to check is that the Professional Level FORTH most significant part of the Package UI works correctly for divisors greater denominator is non-zero, then the than hex 7FFF. quotient will have a zero in its most W/I/conform with the significant part. The greatest error will proposed 1983 standard There are some modifications of the be just one or two least significant Features: words that might suit your application bits. On-Iine Documentation, better. You might want DI to produce a The routines are written in FORTH, Decompiler, Debugger(trace0, doubie precision quotient rather than so some small changes have to be Viewer (help), Line Editor single precision. This can be done by: made to convert to 79-Standard. The and Screen Editor, compiling DI after TI,_changing line 11 function names are somewhat new to 8086/8088 Assembler, Meta on screen 120 from 9.2 UI SWAP DROP me, but there is not sufficient Compiler, Double precision to 0 Ff) TI, changing line 12 from U/ widespread use of these sorts of Math extensions, Native SWAP DROP to TI, and changing line 13 functions to say that any names are Operating System file from +- to D+-. Of course, the traditional. I believe that routines of handler, True LRU disk execution time for D/ will greatly this sort are useful, since FORTH’s buffer mechanism, Separate increase. You might want to save the traditional 16 bit precision is header, Graphics/Sound remainder in TI by changing line 8 on insufficient for a number of Interface, Hashed dictionary screen 121 from SWAP DROP to >R mathematical functions, and even for structure, Multi-tasking. and changing line 9 from D+ to D+ some measured physical quantities. In Available for CP/M, MS-DOS, R > ROT ROT. If you make this change, my opinion FORTH badly needs a or stand-alone versions. don’t forget to change TI to TI ROT good library of useful mathematical DROP in U m I, in DIS, and (if it appears) routines in the public domain. The US $35Ooo in DI. routines here could possibly be a small (available in second quarter 1983) part of that library. I was asked if the routines are optimal. They appear to give DAI-E approximate results in a much shorter time than a more precise method SYST’EMS would. There seems to be only trivial INC. ACKNOWLEDGMENT improvements that could be made to I would like to thank Jim Galloway get the same results. This paper has MULTI- LANGUAGE for introducing me to FORTH and for some rough gems that others might be COMPUTING SYSTEMS being kind enough to review this note. able to polish. -Robert L. Smith 503/682-3201 29783 Town Center Loop West 0 P.O. Box 790

Wilsonville, Oregon 97070 ’ U.S.A. Volume V. No. 1 17 FORTH Dimensions Develop FORTH code for any target No downloading - No trial PROM burning. 8080/280system on your current 8080/280 This port-addressed RAM on your S-lo0 host I or Cromemco CDOS based system is the ROM of your target system

8080/280 METAFORTH WORD/BYTE CROSSCOMPILER WIDE ROM SIMULATOR 0 Produces code that may be downloaded to any 280 or 0 Simulates 16K bytes of memory (8K bytes for 2708 and 2758) 8080 processor 0 Simulates 2708, 2758, 2516, 2716, 2532, 2732, 2564 0 Includes 8080 and 280 assemblers and 2764 PROMS 0 Can produce code without headers and link words for up to 0 The simulated memory may be either byte or 16-bit 30% space savings word organized 0 Can produce ROMable code 0 No S-100 memory is needed to hold ROM data 0 79 Standard FORTH 0 Driver program verifies simulated PROM contents 0 Price $450 - includes our new tools diskette 0 Price $495 each I CONSULTING SERVICES . Inner Access provides you with Custom Software Design. We have supplied many clients with both Systems and Application Software tailored to their specific needs. Contact us for your I special programming requirements.

FORTH Advanced FORTH System Fundamentals & Tools

0 Program Design 0 FORTH Tools 0 FORTH lnternals 0 Program Documentation 0 Engineering Applications 0 Assemblers and Editors 0 FORTH Architecture 0 Floating Point 0 Other Compilers 0 FORTH Arithmetic 0 Communications Cross-Compilation Theory 0 Control Structures 0 Sorting & Searching 0 Romability, Multitasking, 0 Input/Output 0 Project Accounting System Timesharing 0 The Vocabulary Mechanism 0 Process Control 0 Task Scheduling 0 Meta-Defining Words 0 Simulations Algorithms 8 JULY 11-15 SEPT. 12-16 SEPT. 19-23 OCT. 17-21 OCT. 31 -NOV. 4 NOV. 14-18 $395 Incl. Text $495 Incl. Text

Inner Access Corporation P.0 BOX 888 BELMONT, CALIFORNIA 94002 (415) 591-8295

FORTH Dimensions 18 Volume V, No. 1 Add a Break Point Tool

Here’s a scenario familiar to most tion executes BREAK, you enter a spe- of the BREAK interpreter but of the programmers: you have a large section cial interpreter. suspended application as well. of an application running, but some- You may type any normal FORTH At that point, if you don’t happen how right in the middle of things commands and press return. After to notice you’re back in FORTH’s in- something bizarre happens-some- completion of your commands, the terpreter and you type GO, you’ll thing that “couldn’t possibly” be hap- special interpreter will respond “aok” crash. To prevent such an occurrence pening. The application either crashes instead of “ok” to remind you which from blasting you off to never-never mysteriously, or continues past the interpreter it is, then await more com- land, a “check” has been added-the problem, too late for you to figure out mands. You can stay in this special in- value of the return stack pointer is where things went wrong. terpreter as long as you want. saved at BREAK time, and checked at Here’s a very useful, ingenious When you’re ready to have the ap- GO time. If they don’t match, you’ve changed levels, and an error message debug tool that lets you halt your ap- plication resume, enter the word GO will result. plication in mid-operation, then use and press “return”. GO will exit the the full power of FORTH’s interpreter special interpreter and allow the defi- Another pleasant addition has been to examine the stack, contents of vari- nitions that had been executing to the stack dumps-both data stack and ables and so on, and then resume. resume (their addresses had been nest- return stack-on line 6. BREAK will Before I heard about this tool, I was ed and patiently waiting on the return run fine without either of these if you prone to editing a QUIT into a suspec- stack all along). haven’t got them yet. ted spot in my code to terminate the Kim Harris has noted a possible en- application, then poke around for The real work is done by the BEGIN hancement in the margin of the listing. clues. The technique described in this ... AGAIN loop in BREAK, which ob- By saving the contents of the return article still lets you poke around, but viously is the special interpreter, and stack at break-time in an array, then from within the temporarily suspend- the phrase DROP R> DROP in the word restoring the return stack to its former ed application! (Those of you with GO, which unnests two levels: from condition at GO, then you could re- multiprogrammed FORTH systems EXECUTE inside INTERPRET, and from sume even without having to be in the and multiple terminals know how use- INTERPRET inside BREAK. special interpreter. Come to think of ful this can be.) That’s all the code you really need it, you wouldn’t even need a special in- The technique (originally called except for one aspect of “human terpreter ! PAUSE GO) was invented by Frank factors.” If BREAK consisted only of The possibility of suspending one Seuberling, adapted here by Kim Har- this BEGIN AGAIN loop, then if YOU application in mid-stream, performing ris and brought to my attention by were to cause an abort while inside the any number of other tasks, then re- John Clark. The idea is simple: you BREAK interpreter (by misspelling a suming at your leisure is very interest- edit the word BREAK into your aplica- word or underflowing the stack, etc.) ing for a non-multiprogrammed en- tion where you want the breakpoint, ABORT would call QUIT which would vironment. then recompile. When your applica- cause an immediate cessation not only -Leo Brodie

Volume V, No. 1 19 FORTH Dimensions Extending the FORTH Compiler

Luke Seeto RAM memory for variables is at Why use such an unusual system? Christchurch, New Zealand locations $oooO - $1FFF ($ stands for Essentially to extend the memory hexadecimal). This can be extended to space past 64K bytes. This has the The following discussion deals with location $SFFF for the target environ- added advantage that no cross- extensions to the FORTH compiler. A ment only. RAM memory also exists compilation is required to produce > familiarity with the FORTH compiler at locations $4OOO - $SFFF as a num- ROMable code and a huge dictionary and its words is required for space is available. The dictionary is ber of selectable banks of 8K bytes, a implementation. Readers are referred except for the first bank where the fast when accessed and can periodical- to the following manuals. compiler/operating system resides. ly be culled. With ample dictionary -fig-FOR TH installation Manual RAM memory residing in banks is space, names can be meaningful rather -Assembly Language Source List- handled transparently as is RAM at than cryptic and the compiler can be ing of fig-FOR TH locations $oooO - $lFFF; this is the extended to relieve the user’s load. A description of the FORTH system case also for the development environ- Number Base used is first discussed. ment even though the compiler resides Numbers in FORTH can be ex- FORTH can be implemented for in the same address space. pressed in decimal or hexadecimal both a development environment and Locations $2000 - $7FFF for the base. Using the words DECIMAL and a target environment. Such a dual en- first bank contains the HEX establish the base of succeeding vironment has compiler/operating system and numbers in the source program. separate RAM memory for vari- input/output memory space. Into this Hexadecimal numbers can also be ables. area is placed source compiling code entered as characters 0-F preceded by separate compiler/operating system which is not required for ROMing. a $ sign by modifying the compiler as memory. The compiler is extended as required. follows: separate program code memory; this Program code resides at locations define a variable IBASE similar to is RAM in a development environment $8000 - $FFFF for the first bank. BASE. 5 and ROM in a target environment. Program code also resides at locations NUMBER is to first calculate IBASE as separate dictionary memory. $8000 - $9FFF as a number of selec- 16 if the first character of the Word is .k In our FORTH systems 8K byte table banks of 8K bytes. a S sign; otherwise it is as for BASE. blocks of memory at 8K boundaries Dictionary memory space exists at (NUMBER) is to use IBASE rather than can be bank selected by controlling locations $AOW - $BFFF as a number BASE. any of eight bank-select registers to al- of selectable banks of 8K bytes except A listing from the compiler/operat- low any memory address to be for the first bank where program code ing system is shown (see listing 1). Any repeated up to 32 times. Figure 1 resides. The dictionary is transparent user program which calls NUMBER will shows the memory map used which is to the user and is only for the develop- remain correct. Any which calls as follows. ment environment. (NUMBER) will not; in which case change (NUMBER) to (INUMBER) in the listing. Also the Word S is specifically tested for; this is because interpreta- tion first mis-matches against the dic- tionary before doing a number conver- sion and not vice-versa as in some FORTH systems. mically, use of an implicit hex number scheme avoids confusion. Data Structure 1 Normally program code can be structured such that only the contents of a data structure, and not the memory address of the data, need to be referenced. In particular the Words C@ c! CSETO CINCI ... @ 1 SETO +I... can be eliminated from a piece of program code. Thus it is possible in FORTH to say A? 1 + A= to correspond to the BASIC FIGURE 1 - MEMORY statement LET A = A+I. Spically ORGANIZATION citing A? and A= generates less

FORTH Dimensions 20 Volume V, No. 1 program code and runs faster. Also, LISTING 1: NUHBER CONVERSION USED BY COMPILER/OPERATING SYSTEM the source program is easier to follow VS2.0 JAN 83 PAGE- 1 without excessive manipulation of the SCR.. 1 ? NOTE LISTING FOR NUMBER BASE stack. The extra cost is the dictionary $24 IS HEX 24 FOR ASCII I space. Citing A? and A= is IBASE? IS IBASE @ IBASE= IS IBASE ! independent of whether the structure ______-______---- is a byte or a word variable. Hence the 6 7 -> statement A? 1 + A and not A INC1. 8 The data structure described below SCR..3 0 NOTE ENTRY DOES NOT CONFORM TO FORTH SYSTEMS. 1 allows a user to define a named data, 2 3 and automatically generated are its 4 : (NUMBER) 5 0 SWAP ( START VALUE = 0 ) fetch/access structure and its store 6 BEGIN 1+ ( NEXT POSITION 1 structure which are cited by name. All 7 DUPLICATE C@ IEASE? ( CONVERT A DIGIT 1 8 DIGIT ( VALID DIGIT? ) access to the data structure by name 9 IF >R ( - YES. ) 10 SWAP IBASE? * ( ACCUMULATE ) are re-entrant. R> + SUAP ( SUCCESSIVELY 1 1211 tHILE ( REPEAT UNTIL STRING) The following data structures are an 13 ( IS TERHINATED BY A 1 alternative to the conventional 14 ( NON VALID DIGIT 1 15 -> variable data structure in FORTH; SCR. .5 0 namely VARNARIABLE CVAR ARRAY. 1 ...... word data structure 2 NOTE * CONVERTS A CHARACTER STRING TO A * Variable space of 16 bits is allocated NUMBER VALUE. * with the data structure EITHER USING CURRENT BASE OR IMPLICIT (TEHPORARY) HEX BASE MVAR A FORMAT IS * OPTIONAL LEADING - SIGN * FOR CURRENT BASE, * This is equivalent to the statements LEADING S SIGN FOR IMPLICIT HEX BASE * VAR AS *. : A? AS @ ; -> :A= AS!; S( R. .6 * . QUIRKS ARE * ONLY LAST 4 DIGITS OF HEX/IMPLICIT HEX** byte data structure BASE IS RELEVANT, * Variable space of one byte is OVERFLOU NOT CATERED FOR DECIMAL BRSE allocated with the data structure * * M-CVAR A ON ENTRY, * PSUl = START ADDRESS OF STRING * ON RTNr * This is equivalent to the statements PSWl = CONVERTED VALUE * ABORTS IF NOT A VALID NUMBER * CVAR AS ...... I :A?ASC@; -> : A= AS C!: S:.R. .7 I GEB GfBBT?CHARACTER 1 , B8Ft f EWf€ &;4'@ 3 IF DROP ( - YES. ) array data structure 4 DUPLiCATE C@ 1 = ( WORD IS 5 7 ) 5 IF QUESTION ( - YES, EReOR ) Variable space of n bytes is 6 VEN ( ABORT ) allocated with the data structure 7 0 1 16 ( HEX NUMBER f El ELSE OZD = DUPLICATE ( - NO, - SIGN 3 ) n MARRAY A 9 BASE' ( CURRENT BASE ) THEN This is equivalent to the statements !O11 n CONSTANT A[L] 12 NOTE PSWl = BASE/S-BASE, 10116 * 13 PSWZ = LEADING SKIP COUNT, 0/1 FOR 5 AND - * A[L] ARRAY A[$] 14 PSW3 = MINUS SIGN INDICATOR. 011 FOR - * 15 PSU4 = START ADDRESS OF UORD STRING *. -> : A(?] A[$] + C@ ; : A[$] C!; SCR. .B 0 i A[=] + 1 IBASE= SAVE BASE TO USE ) 2 ROTATE + ADDRESS OF 1ST DIGIT) 3 (NUMEER) CONVERT DIGIT STRING) 4 CC $20 - DIGIT STRING ENDED ) Thus to fetch/access the fifth 5 BY A SPACE CHAR. ? ) 6 IF QUESTION - NO, ERROR ) element of the data structure, use 4 7 ( ABORTS ) NOT A NUM5ER ) B THEN A[?]. The limit is also defined by name 9 SWAP SIGN ADJUST FOR ) 10 IF NEGATE A NEGATIVE VALUE ) for use with DO loops. 11 THEN 12 13 implementation details 14 A description of how M-VAR can be 15 implemented is given. M-CVAR and M-ARRAY are similar. Firstly, program code should be generated together to optimize (Listing Continued)

Volume V, No. 1 21 FORTH Dimensions PWSlOlO 8 Bit CPU Card (6801), 8K FORTH Firmware PWS2030 Expansion Memory Board, JEDEC standard 6K €EPROM, 2K RAM, 16 llL110, RS 232C, programma- memory sockets ble timer, 2K monitor, 8K FORTH firmware includes:edi- Maximum of 64K EEPROM, EPROM or RAM. tor, assembler, high-level interrupt linkage and communications protocol. PWS3010 Color Video Graphics Card (719918) 8K FORTH graphics firmware, 256x192 pixels, 15 color PWSlO80 16 Bit CPU Card (68008) 16K FORTH Firmware graphic RS 170 video output, 16K video RAM, ability to 2K or 8K EEPROM. 8K RAM. RS 232C. 4 Dro- GENLOCK to external video. JEDEC Stan- grammable timers Non-multiplexed dard socket for additional firmware memory expansion and waitstate gener- ator 16K FORTH firmware includes moni- PWS9010 STD BUS Card Cage tor, editor, assembler, high-level 6 Slots, mother board, integral interruDt linkase and communica- NEW power supply, 5 volts at 6 amps 2 tions protocol. - 12 volts at 1 amp, on/off and cir- cuit breaker switch. PWS2010 Interface Card, 8K extended FORTH firmware FORTH CUSTOM MADE BOARDS 2 16-bit I/O ports, compatible We will custom make boards to with industry standard optical your exact application if none of isolation boards, battery back- the aforementioned boards up calendarand clock, 2 28-pin meet your needs. JEDEC standard memory sock- etsfor2Kor8KCMOS, NMOSor CONSULTING EPROM memories, software Our FORTH Team people are ex- readable 8-bit switch. Firm- CARDS& perts in FORTH based application ware options: P-FORTH Stan- development and are excited to dard Utilities, P-FORTH PLC be able to share their special with Ladder Diagrams or P- knowledge with you on a person- FORTH Multi-Tasking. STUFF al basis. We’re racing into tomorrow to give you PWS2020 Interface Card a new family of control system prod- watch for new products to come 2 16-bit I/O ports ucts today. Our innovative FORTH team in 1983 Compatible with industry continues to introduce versatile, pow- 5190 West 76th Street standard optical isolation erful and unique firmware with impor- Minneapolis, MN 55435 boards. tant advantages: low cost system development, interactive FORTH Ian- guage to speed software creation, EE- PROM nonvolatile memory and STD BUS interfacing. Look through our new P€OPl€w RR€ FORTH firmware, we know you’ll discov- er an application for your current or /YIT€MI INC. future projects. For samples, docu- (612)831-0827 *TWX 910-576-1735

FORTH Dimensions 22 Volume V, No. 1 memory space. Four words are LISTING 2: DATA STRUCTURE generated as follows VS2.0 JAN 83 PAGE- 1 address of VAR= ( A= ) SCR..l 0 NOTE ______-______--__--LISTING FOR DATA STRUCTURE address of VAR? ( A? ) 1 2 address of Word CONSTANT ( AS ) 3 4 THIS SYSTEM ALREADY SEPARATED DICTIONARY address of data variable 5 FRON GENERATED CODE 6 7 CONSIDER 8 I@ AS y The third and fourth words gener- S l! AS ated are the code for VAR AS. This dis- 10 BUT DEALS UITHTHE DICTIONARY ( AND NOT CODE ) SPACE 11 cussion refers to a ROMable system. 12 FOR DEFINITIONS OF YORDS USED SEE 13 CALTECH FORTH NANUAL - SECOND EDITION JUNE. 1978. That is, the program code space is 14 separated from the variable space. 15 -> Hence the fourth word generated is an SCR..Z 0 1 address, and not the contents as in 2 NOTE PSUl = 1 FOR ITEH 3 = 3 FOR ARRAY most FORTH systems of the data vari- 4 PSUZ = ? OR = OR S OR L 5 able. 6 ADJUSTS A DICTIONARY NAME The code for VAR? need only fetch 7 8 NOT A UORKING EXAHPLE - CONCEPTUAL IDEA ONLY the 16 bit word contents from a data 9 ...... 10 address as given by a pointer which 11 -> lies two words from where the code was called. The code is to end after SCR. .3 f : ADJUST;I[& NT@@4+ ( ADD. OF LENGTH FLD) 2 DUPLICATE l@ ( LENGTH IN ti.S.8. 1 popping the top word off the return 3 DUPLICATE 4 BRING 8 LSHIFT + ( NEU LENGTH IN MS8 ) 4 3 BRING l! ( CHANGE LENGTH FLD ) stack. The code for VAR= is similar. S -8 LSHIFT + 1+ ( NEXT NAME POSITION) 6 suw 1- ( YHICH NAME TYPE? ) Secondly, the dictionary should be 7 IF SUAP $5800 OR OVER l! ( - ARRAYrINSERT CX ) separated from the generated code in 8 2+ S5D SUAP ( AND SUPPLY I ) 9 THEN ( FOR INSERTION ) order to implement the code for VAR 10 !MAP 8 LSHIFT SWAP l! ( INSERT X OR I ) 11 and vAR?. The multiple dictionary 12 entries can be implemented as follows: 13 -> I IN is saved; IN points to the position SCR. .S 0 NOTE CCREATEI IS THE ACTION FOR CREATE 1 BUT CREATE IS INMEDIATE of the source program between M-VAR 2 UHILE CCREATEI IS NON IMMEDIATE and A. 4" THE SAtiE RPPLIES TO CCONSTANTI WORD is used to scan the source 5 C VAR 3 6 CCVARI Word A into a buffer area HERE in ? [ARRAY I. some FORTH systems); this buffer contains a one byte count (e.g. Word size of 3 for XYZ) followed by the characters of the name (e.g. XYZ). Adjust the buffer to the required SCR..G 0 NOTE CODE ADDRESS IS NOT SUPPLIED name, e.g. add one to the count, insert 1 SINCE THIS SYSTEM ALREADY the ASCII character = after the name. 2 SEPARATED DICTIONARY FROM GENERATED CODE. 3 CREATE is used to create the 4 5 dictionary; supply other fields (such as 6 ? code address) as required for a completing the dictionary entry. S : CREATEX 10 IN @ CCREATEI IN ! ( CREATE NAME ) Restore IN and repeat the process 11 CDJUST-NAME 12 two more times to obtain the names 13 A= A? AS. 14 15 -> A listing of an implementation is SCR..7 0 : CREATE-ITEM given (see listing 2). Unfortunately, 1 CREATEX , 2 this will not work as is for a fig- 3 FORTH system. No attempt has been 4 5 : CREATE= made to supply a compatible listing as 6 i3D CREATE-ITEH ( S3D IS HEX 3D FOR ASCII = ) 7 the implementation details of fig- 8 : CREATE? 9 i3F CREATE-ITEH FORTH are not familiar. 10 The listing applies to a system which 11 12 : ADJUST-ADDRESS-ITEH-NAMES scans all Words into a fixed buffer 13 t24 1 ADJUST-NAHE ( GIVES S 1 14 area rather than a changing HERE. 15 -> the dictionary is automatically separated from program code (ROMable version) rather than preceding program code. (Listing Continued)

:ume V, No 1 23 FORTH Dimensions interpretation is by calls to LlSTING 2: DATA STRUCTURE subroutines rather than threaded US2.0 JAN 83 PAGE- 2 code. There is no code address SCR..E 0 : CREATECXI generated for COLON (:) or SEMI (;). 1 CREATEX ; 7 : CREATE-ARRAY variable/RAM memory space is ! 3 CREATECXI automatically separated from : CRERTEC=j 6 13D CREATE-ARRAY program code (ROMable version) 7 rather than intermixed with program 8 : CREATE[?; 9 i3F CREATE-ARRAY code. ."rn 11 : CREATErLi ( PSWl = LIRIT ) 12 IN @ OVER [CONSTANTI IN ! ( CREATE NARE ) Record Structure 13 14C 3 ADJUST-NARE Using the same technique as for 14 data structure, a COBOL-like SCR..9 0 NOTE RAY NEED ONE MORE WORD structure for contiguous memory 1 DEPENDING ON UHETHER 'NEXT' INTREPRETATION IS 2 PRE- OR POST- INCREMENTr space is easily implemented. Data can J then be described as items or arrays of 1! USE NACHINE CODE FOR SPEED word, byte, bit(s), string or decimal. 6 EXAMPLE FOR M6809 PROCESSOR 7 MID JSR/RTS SUBROUTINE CALL IS FORTH systems with program code 8 PULS x 9 LDD C3,Xl SUBROUTINE CALL IS 3 BYTES space separated from the variable 10 PSHU D PUSH INTO P-STACK 11 RTS DOUBLE EXIT space (ROMable system) are 12 FOR DO-VAR? particularly suitable for inclusion of 13 16 such a record structure. 15 -> The record structure implemented SCR..lO 0 NOTE LEAVE OUT THE WORD C ( NOT POINTED TO ) 1 FOR A NON RORABLE SYSTEH consists of about 2K bytes of 2 compiling code and 4K bytes of 3 EG: R> zt e 4 FOR DO-VAR? program code (ROMable code). This 5 does not include dictionary space. Spically citing A? or A= for a SCR..11 0 record structure involves an executive 1 speed of between 4 to 6 times that of J: the Word + . The increase in execution 4 : DO-VAR? 5 R) zt e e 2+ FOR 2 BYTES AWRY 1 speed due to runtime interpretation is 5 ( EQUALS 1 WORD ) found to be negligible for applications 8 : DO-CVAR? on Motorola M6800 and M6809 9 I?>2t e ce ( 4 t INSTEAD OF 2+ I 10 ( FOR PTE-INCRERENT 1 processors at IMHZ. A typical 11 ( 'NEXT ) 12 : DO-ARRAYC?I application program would be 13 p zt e + ce 14 reasonably interrupt intensive, VDU 15 -> display orientated and consist of over 64K bytes ROMable code. of SCR..lZ 0 : DO-VAR= Dictionary space, while heavily used, 1 R>4+@! 2 , is not included in the target 3 4 : DO-CVAR= application. 5 R' 4 t e C! 6 Implementation Details 7 8 : DO-ARRAYC=l A record data structure is described 9 R> 4 + e + C! 10 internally by 11 the address of an executable 12 13 environment pointer. 14 15 -> the relative offset position from the start of the record structure. SCR.. 13 0 NOTE MODIFY R-VAR M-CVAR R-ARRAY AS REQUIRED the internal encoded description of 1 2 SEPARATE DICTIONARY FROM GENERATED CODE, the data structure. 3 SUPPLYING CODE ADDRESS AS REQUIRED An environment pointer is allocated 4 when a record header definition :: CHANGE ORDER OF ACTION 7 LISTING IS FOR SYSTEM appears in the source program. All 8 UHICH ALREADY SEPARATED DICTIONARY FROR CODE data structures within a record refer to 9 10 \ DO-VAR- the same environment pointer which 11 IS ERPLACING YHICH GENERATES THE CODE. 12 may be switched by context or 13 14 executed as required while the 15 -> program is running. The relative offset position is (Listing Continued) determined by the data structures

FORTH Dimensions 24 Volume V, No. 1 following the record header LISTING 2: DATA STRUCTURE definition, their order, and the size of VSZ.0 JAN 83 PAGE- 3 each data item. SCR..lS 0 1 The internal description is an 2 : M-VAR IMHEDI ATE encoded internal representation of the 3 CREATE. \ DO-VAR= 4 CREATE? \ DO-’JAR? data structure, and includes the 5 IVARI ADJUST-ADDRESS-ITEH-NAMES number of elements for array data. ! During program execution, data 8 : M-CVAR IRflEDIATE 9 CREATE= \ DO-CVAR. structures are interpreted for action 10 CREATE? \ DO-CVAR? 11 !CVARl ADJUST-ADDRESS-ITEH-NAHES according to the internal description 12 13 and checked for range. 14 An example of a record structure 15 -> describing the FORTH dictionary is SCR..l6 ? given (see listing 3). This is one of $ : M-ARRAY IRHEDIATE 3 CREATECL 1 several different types of record 4 CREATE[=] \ DO-ARRAY[.] 5 CREATE[?] \ DO-ARRAY[?] structure. This particular record 6 !ARRAY1 $24 3 ADJUST-NAHE structure allows the description of the 7 record to be switched to any entry to E be cited by name. This is useful to describe linked lists, queues, tables, LISTING 3: EXAMPLE OF RECORD STRUCTURE SHOWING FORTH DICTIONARY etc. TWO examples of using this record VSZ.0 JAN 83 PAGE- 1 structure are given. SCR.. 1 0 NOTE EXAHPLE OF RECORD STRUCTURE 1 Example 1 2 RECORD DESCRIBES FORTH DICTIONARY 3 NAXIHUM ENTRY SIZE IS SHOW To read the next dictionary entry use 4 the statement 5 THIS RECORD STRUCTURE DOES NOT ALLOCATE flEMORY SPACE. 6 LINK-ADDRESS? DICTIONARY-ENTRY$ 7 8 READ-PICTURE-RECORD 9 10 11 When LINK-ADDRESS? is cited the 17 13 contents of the link field is placed on 14 top of the stack. When DICWONARY- 15 ENTRYS SCR. .2 0 is cited the address of the 1 record data structure is placed on top 2 3 of the stack. When READPICTURE- 4 5 COBOL EGUIVALENT RECORD is cited the environment ! pointer is switched by context. Since 8 the address of the environment pointer 9 10 is the first word of the internal record 11 12 data structure the code for the switch 13 31 M-X(.) 14 by context is simply 15 :READ-PICTURE-RECORD @ ! ; SCR. .3 0 M-PICTURE-RECORD DICTIONARY-ENTRY ( RECORD HEADER ) 1 2 M-1(16) LINK-ADDRESS ( 16 BIT FIELD Whenever LINK-ADDRESS? is now : R-I (16) CODE-ADDRESS cited the contents of the new link field, 5 H-1(5) LENGTH-OF-NAHE ( 5 BIT FIELD ) and not the previous link field, will be 6 M-FILLER-1(1) ( SPARE BIT 5 ) 7 H-FILLER-l(l) ( SPARE BIT 6 ) accessed. PRECEDENCE-BIT ( BIT 7 ) Example 2 li 31 M-l(E)-ARRAY NAHE-ELEMENT ( 31 BYTE ARRAY) M-REDO NAHE-ELEMENTCJI ( REDEFINE NAHE) To invert the precedence (or !A ( AS 31 ) immediate) bit, use the statement i5 NAME-ELEHENTTLI ( CHARACTER ) 14 H-X(.) NAME ( STRING ) PRECEDENCE-BIT? NOT 15 M-END-RECORD ( RECORD TRAILER ) PRECEDENCE-BIT = SCR. .4 0 1 When PRECEDENCE-BIT? is cited, 2 3 “bit 7” is placed on top of the stack at 4 5 bit 0 with the high order 15 bits all 6 7 zeros. This effect is referred to as 8 transformation; that is, conversion of 9 10 data types occurs automatically when 11 12 data is cited by name. This can be 13 PRECEDENCGBIT 14 simply illustated if 15 End Listing (Continued on page 33)

Volume V, No. 1 25 FORTH Dimensions 80801280 FIG-FORTH for CPIM & CDOS systems FULL=SCREENEDITOR for DISK & MEMORY $50 saves you keying the FIG FORTH model and many published FIG FORTH screens onto diskette and debugging them. You receive TWO diskettes (see below for formats available). The first disk is readable by Digital Research CP/M or Cromemco CDOS and contains 8080 source I keyed from the published listings of the FORTH INTEREST GROUP (FIG) plus a translated, enhanced version in ZILOG 280 mnemonics. This disk also contains executable FORTH.COM files for Z80 & 8080 processors and a special one for Cromemco 3102 terminals. The 2nd disk contains FORTH readable screens including an extensive FULL-SCREEN EDITOR FOR DISK & MEMORY. This editor is a powerful FORTH software development tool featuring detailed terminal profile descriptions with full cursor function, full and partial LINE-HOLD LINE-REPLACE and LINE- OVERLAY functions plus line insert/delete, character insert/delete, HEX character display/update and drive-track-sector display. The EDITOR may also be used to VIEW AND MODIFY MEMORY (a feature not available on any other full screen editor we know of.) This disk also has formatted memoryand I/O port dump words and many items published in FORTH DIMENSIONS, including a FORTH TRACE utility, a model data base handler, an 8080 ASSEMBLER and a recursive decompiler. The disks are packaged in a ring binder along with a complete listing of the FULL-SCREEN EDITOR and a copy of the FIG-FORTH INSTALLATION MANUAL (the language model of FIG-FORTH, a complete glossary, memory map, installation instructions and the FIG line editor listing and instructions). This entire work is placed in the public domain in the manner and spirit of the work upon which it is based. Copies may be distributed when proper notices are included. USA Foreign 0 FIG-FORTH & Full Screen EDITOR package AIR Minimum system requi rements: 80x24 video screen w/ cursor addressability 8080 or Z80 or compatible cpu CP/M or compatible operating system w/ 32K or more user RAM Select disk format below, (soft sectored only)...... $50 $65 0 8" SSSD for CP/M (Single Side, Single Density) Cromemco CDOS formats, Single Side, S/D Density 0 8" SSSD 0 8" SSDD 0 5%"SSSD 0 5'h" SSDD Cromemco CDOS formats, Double Side, S/D Density 0 8" DSSD 0 8" DSDD 0 5%'' DSSD 0 5%" DSDD Other formats are being consldered, tell us your needs. 0 Printed Z80 Assembly listing w/ xref (Zilog mnemonics) ...... $15 $18 0 Printed 8080 Assembly listing ...... $75 $18 TOTAL $- - Price includes postage. No purchase orders without check. Arizona residents add sales tax. Make check or money order in US Funds on US bank, payable to: Dennis Wilson c/o Aristotelian Logicians 2631 East Pinchot Avenue Phoenix, AZ 85016 (602) 956-7678

FORTH Dimensions 26 Volume V, No. 1 others use it, the question of personal potential laser-article-containing interpretation and preferences on magazines and re-index them. More on keywords may arise. In either case, it Watkins describes optical incidence is important that the keywords used be or “peekaboo” cards where there is a taken from a previously constructed card for each record and punch-hole Data Bases list which has been carefully inspected positions on each card corresponding to make sure that it contains no to all keywords, the positions synonyms or unintentional overlaps of corresponding to selected keywords Lindsay Doyle meaning. If, when record number being punched, the others not. The loo0 is being entered, a new keyword system he then implements is not the I learned a lot from Robert Wat- is invented to cover some apparently analog of this, which may have caused kins’ article, “The Indexer” in Vol. novel feature of that record, who is to some readers to be confused. His IV, No. 5. However, I suspect that the say whether that feature exists, system is the analog of an inverted file degree of familiarity he assumed his previously unrecognized, in the first system, where there is a card for each readers would have with information- 999 records? The only valid way to keyword and punch-hole positions for retrieval techniques may have made it add a new keyword to the system is to each record. Such systems find limited difficult for newcomers to the field to review all existing records in the file to use in their manual form because the grasp the concepts he was presenting. see whether it applies to them. This number of punch-hole positions one Also, readers should not assume that can also become a problem when the can put on a reasonably-sized card is the bit-mapped approach he used is user’s interests change. If I suddenly very small, thus limiting the number the only one or even necessarily the be- become interested in lasers, it does of records one can index. The st one for solving his problem. On a only a small amount of good to add computerized version has the rhird point he implies, it seems to me, the word “laser” to my list of advantage that the number of “punch- that keywords can be added indiscrim- keywords for indexing magazine hole positions” (1’s and 0’s stored nately at any time to such a system, articles, for only future articles will with the keyword) can be extended as H hich is not the case. I would like to have that keyword applied unless I go far as one wishes. This system, which I darify these three points and perhaps back and review my entire library of shall refer to as the bit-mapped a few others as well in the hope that the results may be helpful both to other readers and to Watkins in the further development of his system. DESIRED COnBININQ In the type of information retrieval system under discussion, records may consist of data held in computer NOS. storage or (and this is a significant RECORD point not mentioned in the referenced article) they may be physical RAVGW documents such as books, catalogs, magazines, file folders, coins in a MRTIIW collection, etc. On acquisition (i.e., at ...... :he time it is entered into the file) each ...... 1 jl:::::::::::...... 1 2s6 0010oO01010 record is given a sequential record ______. number and is characterized by KEYWORD INDEX FILE OR BIT I” selecting one or more keywords which FILE describe its content or other aspects of SELECTED significance to users. To retrieve such a record, the user selects keywords H hich he thinks will describe the record or type of record he is RECORD F7 nterested in and links these keywords NO. DATA isith the logical operators AND, OR, 1 XXXX 200.125.8 AND NOT, OR NOT. 2 YYYY 134.130,10,6 and The system 3 zzzz 250,220. 100 returns all records which fulfill the WTPUT 4- 250,220,99,6 specifications. Other logical RECORD suuw) 25.20.18.7 6..... XYXV 50.4O.ZS.B...... Jperators, not provided in Watkins’ ...... system, are also possible, such as ...... < , > , EARLIER THAN, LATER THAN, etC. 1024 wwy The ideal situation is one where the DATA FILE Frson who designs the keyword list is also the only user of the system: where Fig. 1: Bit-Mapped Clpproach.

.I .-ne V, No 1 27 FORTH Dimensions approach, is shown in Fig. 1. It Let us examine my statement above instead of 1024 characters, but let us requires three files to be maintained: that “the card area is now being used stay with 1K which is more common. the keyword file, the index file or bit more efficiently” as it applies to the If we allow each keyword’s record list map, and the data file. Watkins chose computer version. Instead of to occupy one whole screen instead of to include the keyword numbers for allocating to each keyword one bit for only 128 bytes as in Table 1, what sort each record number within the record every possible record, we must now of performance can we get? Some data, but as he points out, this is not encode the selected record numbers possibilities are shown in Table 2. required but is done to give a bit of and record them with the keyword. To take this sort of investigation one redundancy in the event of damage to The coding scheme used will define the step further, let us look at the case the bit map. maximum number of records the where the maximum number of system can hold as well as the number There is an improvement one can records is the same for bit mapping of records which can be noted in a make both to the manual inverted card and for two-byte coding. This occurs given-sized coding area against one file system as described and to its when 8192 bytes are allotted, and is keyword. If, for a first example, we computer equivalent. I don’t know shown in Table 3. limit ourselves to the same sized whether this has a name or not. It no The penultimate cognitive jump to coding area that Watkins selected, longer allows the use of “peekaboo” make is to realize that in any of these which was 1024 bits or 128 bytes per detection in the manual case, but is schemes the bit-map approach must keyword, some of the possible coding very easy to implement in the have the total dedicated space assigned schemes are shown in Table 1. computerized case. As before, there is at all times. The coded versions, a card for each keyword. Instead of The idea of being able to index 64K however, and taking case L as an the area of the card being mapped out different records on a micro is very example, may start with e.g. one in bits, one for each possible record, interesting. On the Commodore screen per keyword and add extra the selected record numbers are simply products, with which I do most of my screens by chaining as required, but written on the card in increasing work, there are 256 different symbols only on those keywords which require numerical order. Now the card area is available counting graphics or their it: i.e. it is not necessary to predict being used much more efficiently. To lower-case equivalents and reversed- how many records per keyword one say it another way, when a new record video versions of everything. It is may end up with. One can tentatively is to be added to the file, the desired therefore possible to represent 16-bit conclude that the bit-map approach is keyword cards are removed from the numbers as two characters. A screen suitable for small files which will not card file and the new record number is in the FORTH I use contains lo00 be called upon to expand beyond the added at the end of the list of record numbers on each card. This system, [-zq which I shall refer to as the coded DESIRED COnBINI NO record number approach, is shown in KEYrmRDS Fig. 2. It only requires two files and, as indicated by the broken line, the v keyword file is -ended.

Previously the maximum number of 128,200,300,357,429,666,1562 200.201,201,325,456,1589.1590 records that the entire file could hold lI50O,523,677.2345,24M,2560 was dictated by the number of MARTICIN...... 2,3,4,12e,...... 1566.2000.3489 dedicated punch-hole positions on any ...... one card or the number of bits allowed 333.345.679S.&800,492S,6926 per keyword in the computer version. KEYWORD Now the number of records the file FILE can hold is no longer limited by the [BELECTEDI number which can be put on a card, but will be controlled by other system parameters. Clearly it is no longer possible to have a keyword which references every record, but such a 3NO. DATA keyword is useless in any case. The question now becomes: what percentage of the total records should CHITPUT one keyword be able to reference? My

FORTH Dimensions 28 Volume V, No. 1 originally-allowed-for limits, but that the coded approach has advantages BITS/ RECORDS/ MAXIWM X OF MAX COMMENTS where long files are concerned. I have RECORD KEYWORD RECORDS- /KEYWORD not attempted to compare search A1 1024 1024 100 BIT MAP techniques for the two, but would B8 128 255 50 NOT AS OOOD point out that the new words >AND, c 12 85 4096 2 Hnn >OR, etc. developed by Watkins are D 16 64 65535 0.1 wow! not needed in the coded approach, as TABLE 1: 128 bytes per keyword w 8 keywords per screen. we are simply comparing pairs of 16-bit numbers, which can be done with the primitives >, =, and < . My final contribution is the thought that in systems for indexing physical libraries, where we are dealing only BIT MAP 1024 255 POINTLESS with the record number and do not 682 4096 17 INTERESTINO have to store the record data, the use 0. 8 WOW ! of 16-bit numbers, expressed as two characters means not only that there is Table 2: 1024 bytes per keyword or 1 keyword per screen. no longer a data file in the sense used by Watkins but also that a library containing up to 64K documents can be completely indexed for multiple- BITS/ RECORDS/ RECORDS x1;;/KEYWORD wx COMMENTS RECORD KEYWORD keyword retrieval on a few 5 ” disks. Is _____ -I__-- anybody doing it? 65536 65536MAXIMUM^ BIT MAP -Lindsay Doyle is 255 >lo0 PO I NTLESS a frequent contributor to 12 4096 >lo0 PO I NTLESS 65536 6+ IN SUQESTED RANOE MicroComputer Printout and other L 16 4096 - British microcomputer publications. Table 3: 8192 bytes per keyword or 8 screens.i

1 proFORTH COMPILER 8080/8085,280 VERSIONS SUPPORTS DEVELOPMENT FOR DEDICATED APPLICATIONS INTERACTIVELY TEST HEADERLESS CODE IN-PLACE COMPILATION OF ROMABLE TARGET CODE MULTIPLE, PURGABLE DICTIONARIES FORTH-79 SUPERSET AVAILABLE NOW FOR TEKTRONIX DEVELOPMENT SYSTEMS - $2250

2 MICROPROCESSOR-BASED PRODUCT DESIGN SOFTWARE ENGINEERING DESIGN STUDIES - COST ANALYSIS ELECTRONICS AND PRINTED CIRCUIT DESIGN PROTOTYPE FABRICATION AND TEST REAL-TIME ASSEMBLY LANGUAGE/proFORTH MULTITASKING DIVERSIFIED STAFF

Volume V, No. 1 29 FORTH Dimensions Paying the Piper

llm Problem: Metal pipes cannot be manufactured with- The results indicate 97% through wall flaw in the pipe at out flaws. When exposed to high pressure and temperature, 49 degrees, at location 4280 in the pipe. Obviously this such flaws gradually deteriorate and eventually fail. pipe is not in service. Metal pipes are used in Nuclear Power Plants. Two mixer channels are provided to differentially remove the effects of structural supports for the pipe so that flaws The Solution: Zetec Corporation devised a technique under such supports may be detected. with which flaws in installed piping can be measured and Under Multi-FORTH the strip chart windows, tape control analyzed, allowing for safe operation and life cycle and analog to digital conversion, and analytical functions maintenance of the large piping systems necessary in operate as multiple background tasks, while the operator nuclear power plants. interface operates in the foreground, i.e., the strip charts The technique involves pushing a probe through the pipe. may be scrolling up or down through the database while The probe emits vibrations which produce Eddy currents the operator is selecting channels, viewing data, or between the prohe and the walls of the pipe. Flaws cause initiating computations abnormalities in the frequency of the Eddy currents which are detectable by coils in the probe. This data is recorded onsite on an 8-channel analog data recorder and evaluated offsite by ZETEC personnel. The Analog Data is read from the type, converted to digital, and analized by a Hewlett Packard Model 9836 68000 based computer running Multi-FORTH. The HP 9836 features built-in disc drives, an 80 x 24 alpha1512 x 390 graphics CRT, HPlB interface and up to 2% megabytes of RAM. Multi-FORTH provides a Real Time Multitasking programming environment. On the right is a graphics screen dump of a flaw. Note that the two columns on the left are a strip chart window into the much larger data base (in excess of 1 Mb of data). The current We think that Lloyd Lamb and Howard Houserman of display shows a section of data recorded on Channel 1 at ZETEC deserve a lot of credit. After attempting this 400 kHz. The active channel and display mode are application with HP Basic (an unusually fast Basic at selected on the right side of the screen. Channel that), they stopped after three months due to insufficient frequency, span of sample, and phasing rotation may be display performance. The project was converted and modified through a simple sequence of soft labeled special completed in Multi-FORTH in about 1'/z months. While function keys. both men are acknowledged industry experts in Eddy current technology and data acquisition, neither has had The data in the small window in the far left most column is extensive training in computer science. expanded in the lower center window, and the view size may be increased or decreased by the operator. The Gentlemen, we salute you. (And boy are we proud!) center upper window is an XY plot of the data in the MULTI-FORTH IS AVAILABLE ON ALL HEWLEll expanded strip chart below. All windows are continuously PACKARD SERIES 200 COMPUTERS (9816, 9826, refreshed in real time as the operator scrolls through the 9836) AND MOST68000 SINGLE BOARD COMPUTERS: database. The "fuzzy balls" in both center windows are KDM, VMOl, VM02, OB68K-1, BRI, EXORMACS, the result of a least squares fit on the data and further VMEllO, ENG696, DUAL. FOR MORE INFORMATION indicate the point of maximum deflection. GET IN TOUCH WITH US. Creative Solutions ~nc. ) 11 ( Problem Solving For Business and Computer Applications 4801 Randolph Road Rockville, MD 20852 Phone (301 ) 984-0262

FORTH Dimensions 30 Volume V, No. 1 New Product Announcements simple visual display units (VDUs). It screen I/O. Contact: THE SOFT- also has the compiler for the FORTH WRIGHTS, 840 Van Ness #107, San source code. Debugging is inherent in Francisco, CA 94109 METACRAFTS FORTH the FORTH language and once the code is working, this can be output to FOR APPLE Ill lle FORTH-79 VER. 2 FOR 2-80 a PROM programmer. Metacrafts Limited announces the CPlM 81 APPLE USERS Use of C-MOS throughout has release of Metacrafts FORTH V1.2 MicroMotion has announced an ex- brought the power consumption down for Apple 111 IIe computers with 48K panded line of formats available for to 28mA, making the TDS900 espe- RAM and at least one Disk I1 drive. 2-80 1.4 & 2.x users. These include cially suitable for portable and The system, which runs the Byte APPLE, Micropolis Mod 11, Vector battery-driven applications. The prime number benchmark in 164 Grahics, Micropolis & Tandon, North- seconds, includes: 79 Standard TDS900 price is 5179.95 and in hundreds versions are available at €87 Star, Cromemco, Heath/Zenith, Os- required word set; double number ex- borne I, Kaypro 11, Xerox 820, and - €120. In the U.S. the FORTH tension; CASE; strings; arrays; on- TRS-80 Model 11. Meets all provisions Computer is available from Stynetic stack local variables; vocabulary of the FORTH-79 Standard. Base sys- Systems Inc., Flo werfield, Bldg. I, stacks; dictionary overlays; heap tem includes a screen editor, macro- Saint James, NY 11780 (516) store; block buffer control; hi- and assembler, string-package, 3-bit in- lores graphics (including turtle 862- 7670. teger arithmetic and 200 page tutorial graphics); I/O execution vectors; mac- and reference manual. Floating Point ro assembler; full-screen editor with Extensible Text FormatterlEditor QTF is a powerful documentation available for all versions, HIRES for “undo” and “syntax-check” features; + APPLE & Northstar. $99.95-$139.95. tool, ideal for technical writing and interactive source-level debugger; in- Contact: MicroMotion, 12077 Wil- documentation of FORTH programs. telligent multi-block copy; memory shire Blvd., #506, Los Angeles, CA The formatter features string and for- dumper; threaded code decoder; 90025, 213 1821-4340. paginated printer output; screen IN- matting macro defining capability; DEX; and OUTLINE words. Support justification; centering; tabbing; for 40180 column display; language hanging indent; automatic page and card; and multiple disk drives. l00+ chapter numbering; page headers and screens of source code for upper levels footers; soft hyphenation; automatic SOFTWARE WORKSHOPS IN of system. 170-page User’s Guide page number referencing to tables, MMSFORTH (assumes knowledge of FORTH). figures and topics elsewhere in your Price: 57940 ( + 15% VAT in UK) in- document; and formatting of FORTH Miller Microcomputer Services cludes shipping. Manual only, €8,00. screens, as well as full utilization of introducers a regular series of Boston- Information leaflet available. Dealer the Epson printer fonts, underlining area MMSFORTH Workshops on a inquiries welcome. Contact: and boldface. The cursor-controlled variety of topics and ability levels. Metacrafts Lts., 144 Crewe Rd., wrap-around text editor offers insert, The schedule of offerings for the Shavington, Crewe CW2 5AJ, delete, replace, and string-move. Au- remainder of the 1983 is as follows. England. Phone: (0270) 666274. thored by Leo Brodie. Requires IBM Workshop Level Cost Days PC with 64K running Laboratory Mic- Introduction to Elem $250 2 rosystems’ PC/FORTH. Available for MMSFORTH FORTH COMPUTER $50.00 from: Laboratory Microsys- This C-MOS Eurocard module gives Applications in Int $250 2 terns, 4147 Beethoven St., Los An- MMSFORTH faster software and hardware develop- geles, CA 90066. ment times than assembler level pro- Database Design and Adv $950 5 gramming. Software costs in in- LOOK-SEE Implementation dustrial applications cannot be amor- The SOFT-WRIGHTS ’ new screen MetaForth & Other Adv $950 5 tized over the large quantities as- design package FORTH LOOK-SEE Advanced Topics sociated with personal computers and provides a model for the design of Forthwrite User Elem $150 1 electronic games. This C-MOS screedmenu input for FIG 8080 Techniques embedded computer card aims at FORTH. LOOK-SEE allows the user Datahandler User Elem $150 1 resolving this problem by including to design screedmenu input in a man- Techniques FORTH high level language program- ner that is similar to the way the ming and developmental facilities. Forthcom User Elem $150 1 screen/menu is to look to the user. Techniques Using FORTH rather than machine This provides extreme ease in the assembler gives a fast reaction time to design/maintenance/update of Schedules and further information market opportunities. Production pro- screedmenu driven programs in are available from Miller ducts use the same board as employed FORTH, thus reducing costs and Microcomputer Services, 61 Lake in the prototypes. design change turnaround time. Shore Road, Natick, MA 01760 No microprocessor development Cost: $10.00 postpaid in the U.S. (617/653-6136, 9 a.m. to 6 p.m. system is needed since the card con- Comes as a listing with a clear concise Eastern Time Zone). tains a screen editor working with user manual. LOOK-SEE utilizes user

Volume V. No. 1 31 FORTH Dimensions A PREMIER OFFERING TO THE FORTH COMMUNITY! A limited number of R65FI 1 Microcomputer FORTH Development System .at a special price. ..

k 100 mm

By the time you read this ad we should The "1 00 squared features on board - Expandable to 16K bytes of external receive our first shipment of production rectification and regulation of power from a memory R65F11 Microcomputers, the 6502 based 9 volt AC or DC power source Terminals are - Flexible clock circuitry single chip microcomputers with the run there if you prefer to use your own regulated - 1 us minimum instruction execulion time portions of FORTH in ROM. This chip 5V supply An on board DC to DC convertor time 8 2 MHr features a complete FORTH based can provide negative voltage for the RS232 - NMOS silicon gate, depletion load operating system and is ideal for dedicated interface either way Address decoding is technology microcomputer applications. Our board, the accomplished by a bi-polar PROM that can - Single +5V power supply NMIX-0011, surrounds the R65F1 1 with be replaced by the user if necessary A - 12 mW standby power for 32 bytes of equally innovative circuitry that allows the standard development PROM decoder is the 1 %?-byte RAM chip to be a complete FORTH development provided with the board Three JEDEC 28 - 40-pin DIP (R65F11) system. (We call the board the "1 00 pin sockets are provided which will accept squared' for short, due to its extremely small RAM'S 2016, 2128.5517, 6116 We will be advertising very soon in the size). All that is needed to do program 5564 major trade journals We anticipate demand development in FORTH is a CRT terminal or EPROM s 2716, 2732, 2764 to be so great that this will quickly become a microcomputer that speaks RS232 (seven EEPROMs 2816A limited availability item We wanted to offer it data, one start, two stoD bits). The board can program in circuit first to the people that made the R65F1 1 R28 16A 2764' possible. the people involved with the 'requires additional VPP voltage supply FORTH Interest Group We are offering a All this plus the powerful R65F1 1 which special order price of $220 00 This is $30 features off our list price, but to reserve your board Look for a complete - FORTH kernel in ROM WE MUST HAVE YOU ORDER NOW1 This is - Enhanced 6502 CPU a limited time offering1 ACT NOW - 192-byte static RAM Eu ro card board line ~~ 16 bidirectional, TTL-compatible 1/0 coming soon - lines (twoports. R65F11) Enclose Payment - One &bit port with programmable latched input Wifh Order To: TWO 16-bit programmable counter/ New Micros, Inc. timers, with latches 21 00 N. Hwv. 360

- Ten interrupts Suite 1607 Grand Prairie, Texas 75050 (214) 660-1106 Telex 79-5551

......

FORTH Dimensions 32 Volume V. No. 1 was described as decimal with the structure ~-9(1)which corresponds to 5th Annual PICTURE qi) in COBOL. In this case FORTH NATIONAL CONVENTION the data variable is either ASCII 0 or ASCII 1 in memory while FORTH- Based Systems: PRECEDENCE-BIT? when cited places A Look into the-Future binary 0 or binary 1 on top of the October 14-15, 1983 stack. When NOT (or o=) is cited bit 0 Hyatt Palo Alto, Palo Alto, California of the top word of the stack is Exhibits Equipment Demonstrations inverted; the high order 15 bits are Speakers Discussion Groups irrelevant. Tutorials Worldwide FIG Meeting When PRECEDENCE-BIT= is cited bit Vendor Meetings Banquet Panel Discussions Awards 0 of the top word of the stack is stored in ’bit 7’. The LENGTH-OFNAME field is FORTH is for everyone. The FORTH computer language is used in video not manipulated even though games, operating systems, real-time control, wordprocessing, spread sheet PRECEDENCE-BIT lies in the Same programs, business packages, DBMS, robotics, engineering & scientific cal- memory byte. culations and more. To do the same in conventional Learn about FORTH and make your life easier. The convention will show FORTH the following is required. you how! FETCH-ADDRESSOFLINK-FIELD FORTH-Based Systems: A Look into the Future is the theme and will 4 + DUP C@ $80 XOR SWAP C! cover FORTH applications, FORTH-based instruments and FORTH-based operating systems. Those wishing to participate and be speakers and/or The following irrelevant code exists panelists are urged to contact the Program Coordinator immediately. the offset is required to be known (Telephone the FIG hotline 41 5/962-8653) (4). Convention registration is $5.00. Special convention room rates are available at the the address of the precedence bit is Hyatt Palo Alto. Contact FIG or the hotel and mention the FORTH convention. required to be specifically calculated The FORTH Convention is sponsored by the FORTH Interest Group (FIG). The (+I. FORTH Interest Group is a nonprofit organization of over 3,800 members and 40 the structure of the memory cell is chapters worldwide, devoted to the dissemination of FORTH-related information. required to be known to be a byte (C@ FIG membership of $1 5.00/year ($27.00 overseas) includes a one year subscription to FORTH Dimensions, the bimonthly publication of the group. C!) . the position of the precedence bit is ,11-1-11-111111111111-1-1- 0 Yes! I want to attend the FORTH Convention. Enclosed is my check for required to be known to be in bit 7 for -pre-registered admission/s. ($80). 0 I want to be an exhibitor, please send exhibitor information. the memory address is manipulated 0 Yes! I want to join FIG and receive FORTH Dimensions. Enclosed is my on the stack (DUP SWAP). check for $15.00 ($27.00 foreign). Furthermore, the code is not self- documenting; it is not obvious that the Name precedence bit is inverted. Address Conclusion State - Zip It is desirable to extend the FORTH City compiler. Experience shows it is viable Phone ( to adapt features from another Return to: FORTH Interest Group language to FORTH. This is best done P.O. Box 1105, San Carlos, CA 94070 415/962-8653 in FORTH source to allow portability and could be implemented by runtime interpretation for an increase in execution speed. Many areas of the FORTH compiler FORTH Vendors (Continued from page 43) need addressing to incorporate Metalogic Corp. Schleisiek, Klaus Softweaver language/operating system features. 4325 Miraleste Dr. Eppendorfer Landstr. 16 P.O. Box 7200 With the availability of large Rancho Palos Verdes, CA 90274 D 2000 Hamburg 20 Santa Cruz, CA 95061 development systems for generating 213/519-7013 West Germany 4081425-8700 target applications, falling memory (040)480 8154 Petri, Martin B. Technology Management, Inc. prices, and languages with an Schrenk, Dr. Walter 1520 S. Lyon St. 15508 Lull St. Postfach 904 increasing number of features, the Van Nuys, CA 91406 Santa Ana, CA 92705 7500 Karlstruhe-41 714/835-9512 time may not be too far away when 2 13/908-0160 West Germany very large compilers are readily Redding Co. Software Engineering Timin, Mitchel available. As to memory size for the P.O. Box 498 6308 Troost Ave. El0 3050 Rue d’Orlean #307 FORTH compiler, why not heed the Georgetown, CT 06829 Kansas City, MO 64131 San Diego, CA 921 10 directive to “go forth and multiply”? 203/938-9381 8 16/363- 1024 61 9/222-4185

Volume V, No. 1 33 FORTH Dimensions

1 LEAST EXPENSIVE Technotes FORTH SYSTEM AVAILABLE MULTI-FORTH for the SlNCLAlR ZX/81 (TIMEX/SINCLAIR 1000) BY TREE SYSTEMS ENCLOSE Encounters Compiler Directive (not Interpretive) Compilers (DO LOOP, IF ELSE THEN, Nicholas L. Pappas, Ph.D. etc ) need not be put in a definition to run Perlfel Single user Multi-tasking Here are two tests and a practical Event Scheduling (32 Bit clock, 2-yrs ) solution for the ENCLOSE bug. Eoftwure Systems Schedule with AT, IN, EVERY commands In many applications a natural presents maximum resolution 1/60th second Task Options: decision to take is MARX FORTH V1.4 LOCK, UNLOCK, START, STOP $1 50 Tasks can dynamically reschedule HEX 1 ’ BlSCR ! (blocks/screen = 1) themselves 400 ‘ BlBUF ! (bytedblock buffer = For the Up to 10 tasks scheduled at one time 1024) Tasks can be linked to run in the ATAR I background Each task has its own 32 bit clock One consequence is the enclose bug RADIO SHACK Task execute according to priority may get you.* The ENCLOSE NORTH STAR DOS Wait execution in 31 deep event que primative in many Forth listings uses a CPM Unique Editor: POLYMORPHIC User defined split screens one byte counter to accumulate the Complete visual editor (blank) delimiter and character blarx Forth is not just another warmed Run editor while execution screen is iver Fig Forth. This 79-83 standard running program counts. When B/BUF holds less than Iorth has been completely rewritten to Cursor oriented 100 hex, the counter’s capacity is nclude advanced coding techniques not Delete lines adequate. however, a two byte counter ivailable in most systems. Delete characters Store line in pad is needed when B/BUF holds a illarx Forth package includes: Insert line from pad number greater than the one byte .Complete source code Automatic character insert .Screen editor Compile Lines counter’s FF capacity. Double number word set .Forth style macro assembler Technical Information: If a screen has more than FF Standard Marx Forth extension word set extremely fast, ixtensions include: run 300000 DO LOOP in 1 second. delimiters in a row, call this a bad Case File system (real time 32 bit clock with user . . string; two kinds of wrong events may m Arguments - Results .Disk directories defined periods) occur. A bad string before the end of Printer control .String word set high priority task runs constantly Cursor control . Recursion for detection of stack underflow. the screen will cause the system to lock has separate character stack, user nternal advancements include: stack, and processor stack. up so that OK is not returned. We .Links in front of names have a crash requiring a reset. A bad .Fast math RESlDENTON64K EPROM. HOUSED .No names on internal words INSIDE YOUR ZX/81 SWITCH BE- string elsewhere may confound .Super fast compiler TWEEN BASIC AND FORTH RE- . New 83-standard circular DO-LOOP QUIRES only 2K RAM TO OPERATE loading the screen (see IN in WORD) DO-LOOP executes 0 times if arguments Works with 16K and 64K RAM modules. or crash. Testing for existence of the are equal - LEAVE leaves immediately Turns the SlNCLAlR into: enclose bug is easy to do. Fill screen in - Multiple WHILES excellent real time controller with blanks, set b/scr=l, . Vocabulary trees without vocabulary links home environment controller (tem- .Compiler security perature zones, time zones). b/buf = 1024, and n LOAD. If you get 1 byte relative branches for conditionals real time data acquisition of analog OK, all is okay. A more direct test is to m Smart CMOVE and digital signals. - Machine code where it counts even use it to control your model set up for 1024 byte buffers and All Marx Forthr are compatible and most code railroad. iritten on one system will run on any other with no has DELAY Variables, and CLAMP HEX FIRST 2 + 400 BLANKS iodifications Variables as in most real timecontrol (blanks a block buffer) Also available. the Marx Forth target compiler This languages. llows your program to be compiled into a stand alone Complete instruction booklet describ- If the response prints as 400 401 400 bject file that doesn’t need Forth in the system to run ing the language and applications. addr, there is no bug. If the response The Marx Forth application software development ystem is available to software houses. This package in- EPROM Extension ...... $49.95 prints 0 1 0 addr, you have the bug. ludes Marx Forth for all systems we support including Complete System ie target compilen. This allows software to be devel- ped for many computer systems simultaneously as (including Sinclair)...... $149.95 A simple, practical solution is (ell as having the most powerful compiler available. Prices include shipping. breaking up bad strings with a here applications can be target compiled to run on all Free information available. omputers for which Marx Forth is available and mar harmless ( )**, and a long term eted without the end user ever knowing it was written solution is to rewrite* your ENCLOSE 1 Forth. Call for details. Marx Forth model license isavailable for Forth ven- primitive using a two byte counter. ors who want to improve their product or implement larx Forth for another machine. Call for marketing icentives COMING SOON. Marx Forth for the IBM PC and Write to: *for a gotcha and an 8080 rewrite, see ,pple and Marx Multi-tasking Forth for the larger Tree Systems Forth Dimensions, Vol 111, #2, pages {sterns Suite 233 3645 28th St.. S.E. 35 and 41. PerReZ Software Systems Grand Rapids, Mi. 49508 **2 blanks or more. 1452 NORTH CLAY (616) 949-8506 SPRINGFIELD, MO.65802 (417) 862-9830 or (417) 883-3709 (Continued) Consulting Services available

FORTH Dimensions 34 Volume V. No. 1 Technotes (Continued) One of my past projects was to develop a Pseudo-Random Binary Sequence (PRBS) register. PRBS is C64-FORTH UI Bug Fumigated just another name for a CRC register. As you suggested, an evaluation of the for the K.G. Lander, Crewe, England given algorithm was in order. I simulated the algorithm to In “Technotes” IV-D Vol. IV, pg. Commodore 64 determine if it has a maximal length 2, Jack Haller identified a bug in UI, sequence. A PRBS register will cycle (79 standard UMOD) for which he FORTH SOFTWARE proposed a correction. Unfortunately through states and eventually start his solution is only partially correct, as repeating. The number of states FOR THE the following entries demonstrate: before repeating is the length of the register. A 16 bit register is maximal if COMMODORE 64 1048576. 65535 U/MODok it has a 2*16 state PRBS. I found that U. 31 ok (Quotient should be 16) the register in “ACCUMULATE” is U. 31 ok (Remainder should be 16) 2*15 states long. C64-FORTH (TM) for the Commodore 64 - $99 95 The problem is that the N I+ ROL, The number 4002 H (16386) defines Fig Forth-79 implementation with extensions the feedback used in the given Full feature screen editor and macro instruction on line 7 accumulates ALL assembler the carries that would have been lost algorithm. I found that a feedback Trace feature for easy debugging value of 148C H (5260) produced a 320x200, 2 color bit mapped graphics by the original version, instead of just 16coIor spriteand character graphics the latest. The corrected version (see maximal length PRBS. I also Compatible with VIC peripherals including determined that the byte shift left (256 disks data set, modem printer and cartridges listing) clears N+ 1 after the Extensive 144 page manual with examples and remembered 17th bit has been *) and bit shift left loop (8 0 DO ... application screens ”SAVETURNKEY normally allows processed. LOOP) did not effect the length of the application program distribution without Incidentally, while checking out the sequence. So both operations can be licensing or royalties corrected solution, I discovered that removed without a loss of performance and help improve the the urn carry bug correction in the C64-XTEND (TM) FORTH Extension for c64- Installation Model has not been speed of checksumming. FORTH - $50 95 (Requires original C64-FORTH copy) incorporated into the 6502 Assembly I propose using this new definition: Fully compatible floating pant package iis t ing . including arithmetic, relational, logical and : PRBS (oldcrdchar - newcrc) transcendental functions XOR DUP O< IF 5260 XOR DUP + Floating point range of 1Et38 to 2E-30 String extensions including LEFT$, RIGHT$, A Better CRC (SHL) 1 + ELSE DUP + THEN ; and MID$ BCD functions for IOdigit numbers including I found that “PRBS” executes 9 multiply, divide and percentage BCD Mike Steckmyer times faster than “ACCUMULATE” numbers may by used for DOLLAR CENTS calculations without the round-off error I am writing to comment about your because there is far less computing inherent in BASIC real numbers article entitled: “Checksum for Hand- being done. It should also be noted Special words are provided for inputting and outputting DOLLAR CENTS values Entered Source Screens” which that this optimization produces a Detailed manual with examples and appeared in FORTH IV, 3. I became different PRBS than the original applications screens mterested in the algorithm after algorithm. cornm mod ore 64 isa trademarkofCommodore) reading the part about being patient. Waiting up to 2 seconds per screen was TO ORDER- Specify disk or cassette version noted. This seems to be a little too - Check, money order, bank card, long. COD’Sadd $1 50 - Add $4 00 postage and handling in USA and Canada - Mass orders add 5% sales tar: - Foreign orders add 20% shipping loaded in Decimal Mode and handling - Dealer inquiries welcome PERFORMANCE MICRO PRODUCTS 770 Dedham Street, S-2 Canton, MA 02021 (617)828-1209

Next- Generation Micro-Computer Products

FORTH Dimensions DESIGNED BY EXPERTS IN THE FIELD OF MICRO-COMPUTERS RICHARD ALTWASSER AND STEVEN VtCKERS

Steven Vickers Steven gained his degree in Math at King’s College, Cambridge, England, and his Ph.D in Algebra at Leeds University. His first assignment after school was to create the Sinclair ZX-81 or Timex 1000 8K ROM, and to write the ZX-81 manual. Subse- quently he wrote most of the ROM for the Sinclair Spectrum or Timex 2000.

Richard Altwasser Richard gained his honors degree in Engineering at Trinity College, Cambridge, England. He joined Sinclair in September 1980, and was instrumental in the research that led to the development of the Spectrum or Timex 2000.

Recently these two experts started their own company and developed the Jupiter Ace range of hardware which is based on the exciting new language for micro-computers “FORTH”.

For the FORTH enthusiast The Jupiter Ace closely follows the FORTH 79 standard with extensions for floating point, sound and cassette. It has a unique and remarkable editor that allows you to list and alter words that have been previously compiled into the dictionary. This avoids the need to store screens of source, allowing the dic- tionary itself to be saved on cassette. Comprehensive error checking removes the worry of accidentally crashing your programs.

Order Form: Product Price Qty. Total Send To Computer Distribution Assoc. Jupiter Ace $1 50 56 South 3rd Street 16K Ram Pack $ 50 Oxford, Penna. 19363 48K Ram Pack $1 25 ParlSer Interface $100

Credit Card No. Exp. Date Shipping and Handling $4.95

Sign at u re FD IV/6 Total Order I I

FORTH Dimensions 36 Volume V, No. 1 A Simple Overlay System

Christian Mahr e < overlay system - resident section cm 85.83.83 I 1 FORTH DEFINITION5 HEX 2 9FFF CONSTANT Ell DECIMUL C end of aa~ailiabledic mentor:' ' This article presents a simple 3 0 VARIABLE OV# < current overla? number overlay system. The overlays are 4 8 VARIABLE OVA a. current ouerla;~addr binary images of pre-compiled 5 : X ; -4 ALLOT C the input dumm;y 1 ink detini tion J 6 : Y ; -4 ALLOT I the output durrmj link definition I FORTH code, i.e. programming tools 7 : RELINK C .' L LFA 1 LITERciL ' : 1 link into o"erla. 5 8 : CANCEL ' X NFA RELINk 0 CIt.J# ; 8~ i:.ncel o',erIa,v or other ready-to-run programs. 9 In my FORTH system I like to have 10 : GET.IMAGE '~ addr .,. I t ar t -b 1 I.. ~,dr #\ tf1 k s . . . ' 11 < load contingous blcrcks. from dicl.., ctartinq at ' all the programming tools at hand that 12 i tstart-blk:, driur tdr#;, des-tination addres.5 caddr. ' I need in program generation and 13 8 * ;R I sectors J SWHP 8 t :R 1~ :tart certor 1 testing: the assembler, editor, disk- 14 '>R c dr ive # > 1 b do h read Ri R' R' -DI5k : 15 DECIMAL --; maintenance-programs, disassembler, the FORTH-discompiler and some 8 < averlay srs.tem - res.ident cection C: rr 1 : OVERLAY c hl k . . . ) I create an ouerl,. caller others. Most of them are mutually 2 ' load information I definitions of the main FORTH 5 DOES> DUP 0 t a HERE UC Z ?ERROR ' does not f I? I system but not to definitions of each 6 DLIP ii CiU# ii - IF < not in merrtorv 5 CHIKEL 7 ,R Rdtd R il other. Unfortunately, these tools are 8 R Zt ii R 4 t ii GET. IHAGE 5~ I oad I rl t 0 memor , ' eating up a lot of valuable dictionary Y H 6 t a < addr 3 18 DCIP a R) a - 12 ?ERROR I t~~iranqblock i space, decreasing the amount of free 11 DUP 8tJ b, this is LFH of fir~tdef 1 memory for my application programs. 12 [ ' X NFA 1 LITERAL SI.IAP ' 5. 1 ink. :<. to the f irst 5 On the other hand, a loading 13 DUP 1 8 t RELINk I. this 15. I,IFii of last det 1'4 [)LIP QVH ' '2 Ot.!# ' I set Ci?k and O'J# (compiling) of a tool for each time of 15 ELSE [)HOP THEN ; -_~ use would be very time consuming. 8 1 ouerlay %.,'~tem- resident section C rr, Some tools can't be discarded from 1 : EYG < addr 1 addrZ . . . > (> e:.:change "sr iable rorntent: memory after use because they 2 [)UP 'R a SWAP DLIP a R' ' ' ; 3 generate code themselves, i.e. the 4 : OL-SWITCH 8~ ... ) I itch from main dictionar) to cfz~'er13,' ' assembler. 5 1. ~reaand back 5 These facts in mind, I wrote this 7 overlay system to rapidly load a tool 8 9 as a binary image. All tools use the 10 same memory space, counted 11 13 DEC.IMciL ;S I end of res.ident ~ectic~r~eft ctrierla:' s>.mtem 1 backwards from the end of available 13 dictionary memory. So there is only 14 dcm't forget to place this error nicesage or, .rr# 4 line 12: need for enough memory for the tool I 15 'I no ual id over 1 ax block. found ' 'I actually want to use. The overlay 8 overlav rvrtem - nccn-ree.ident zrction cnt 85.63.83 J system is divided into a resident part 1 These definitions are nececSarr to create the binar.' images 2 and cave them to disk. Pleare see if four z.,s.tem has. i located behind the system definitions, 3 1824 Hrtes:'block and 258 Blocksdrive or not. and a second part that is loaded during 4 .z FQRTH DEFINITIONS DECIllciL the generation of a binary overlay 0 image only. 7 SAVE.IPl64GE < addr 'l start-blk .. dr# ~% bllr ... e CR ." writing averlay i~~ag.~on ccreenz. " The following concept is certainly a 9 iR 25M x t R1 CII.IER t SWAP DO BFBI approach (brute force and 18 DLIP I . I OFFSET a - BL0C.k' WBUF CflO"E UPDATE 11 B.iBUF t LOOP DROP FLUSH : bloody ignorance), but it works well 12 for my needs: An overlay occupies a 13 14 multiple of IK Byte counted 15 backwards from the end of available dictionary memory (determined by my @ ,, overla* system - nan-resident section c m system constant EM). The first eight 1 2 : LINLII.16 '~ ...1 inkl\.I ink2 > 8, unl ink the overlay defini?ionc. 6 words of an overlay block contains the 3 b, from main dic J LeTEST CR ." unl ink: " following loading and linking 5 BEGIN information: 6 DUP ID. Z SPACES f print unlinked J 7 DUP PFH LFA ii UIH a U,. 8= IJHILE r PFA LFci iI block address + 3 REPEkT C.R : 0 contains the start 18 --; block of the overlay (Listing Continued)

Volume V, No. 1 37 FORTH Dimensions 8 8~ o'i e r 1 a Y z y5 t em - n on -r e e I de n t se c t I 6n c m ! 2 is reserved 1 4 contains the number of ri: 3 blocks to be loaded 4 5 4 6 contains the - overlay start address 8 5' 1M 8 contains the 11 output link address 12 13 14 10 contains the 15 - input link address 8 < ouerlar svrtem - nan-re:ident section C m 1 12 contains the 2 : C-LOSE-OOERLAr 1, . . . i b~ c 1 ctse ewer 1 ay area 7 3 LiriL~t%iK PFA LF~ti:>.+ ,ii 8 t ! I ca~venut-link I overlay dictionary pointer 4 O?! - SW I T C H

5 Eri HERE cis. i 3 ?ERROF: 1 ob!er 1 a-. area too zrnal 1 I 4 O'JA a R 14 contains the 7 F: A t a R J F? Z t a RI 4 t 3 Sn~!E.IPI&GE 8 C-ANCEL : overlay VOC-LINK 9 ;S 19 To invoke (load from disk if 11 don t forget to place this error mezsagr or, scr# 4 line 13: necessary) an overlay caller must be I 2 " aver 1 a? area taco smal 1 ' " defined in the main dictionary. The 13 14 PFA of this caller looks similar to the 15 first 4 bytes in the overlay:

@ < ouer 1 ay sy5tem - nun-res I dent src t I on cr, 23.12.81 1 PFA of the overlay-caller + 1 ;s 0 contains the start block of the 2 3 FFA of an overlay caller: overlay 4 BLK DFc# ELKS O'JA 2 contains the drive # to load the 5 +% t2 t4 th 6 overlay from 7 parameter-block of the ouerlar: 4 contains the number of blocks to 8 HLK 4 always loaded to the same address c --- .% .% 232 t, OPEN-O'.~'ERLrir c o'.*er 1 ay beg! ns at scr# 232, reserve J (scr# 80 to 82). ' c, PBfte = c. ecreen~ 7 58 Lori" load the source text of the ASSEMBLER > 2. Your program becoming an overlay s. 8 to be co~{piIedinto the orrerlay area ) should be debugged; calculate the size of it in K byte and determine some 18 1 ~eehoi.,? far the cc'>erIa,w area is. filled: 5 11 CP ." last memor v locat ion =3 " HEPE HE:.: 0 C,. DECIMAL continuous free blocks on the disk 12 where the binary image will reside. If 1 3, reset pointers to main dictionrr+, and save I 14 FOFGET T *, the binarv image tc. dir.C, forget all you proceed as shown on screen #88, 15 :s the image will be created and saved on

8 I 1 oad ccr een for CS~J~~Ia,v ar.sembl er i disk. No dictionary space will be consumed after this procedure, and create the a.,'erlar caller riSSO'J, i -_r (. ouer 1 a? I r on screen LJL i this compilation is only done once. 4 3. To invoke the overlay, you have to 5 k5'5O1.! mj get thie. ob~erla,' for the following defiinitiunr > compile what I have named an overlay

7 n. make the fallor~ingdefinition global by including the I caller into the main dictionary, as 8 I c~uer1 a1 ial Ier and redefine thi G. defini t iccnz : , '7 shown on scr #89, where the assembler 1 8 : kS'5EtIBLEP '-'CiV tC.CiI"IPILE1 +iSSEIlBLER : overlay caller ASSOV is created. Each 1 1 : CODE O?, [ COMPI LEI CCIDE time ASSOV is executed, it checks 12 : 1.1: HSSCIV [C-CIWILEI P.1: I 13 : LliHEL GSSO'! [ COMPI LE 1 LABEL whether this overlay is in memory and 14 : EOLIHTE ASSOU [ C.CiMPI LEI EOClciTE loads it from disk if not. Now you can 15 :'; make some key definitions "global", by redefining them with the overlay (Listing Continued) caller included. In the example, the

FORTH Dimensions 38 Volume V. No 1 word CODE will automatically ask for requires one link into and one out of Glossa ry the right overlay. the overlay. A vocabulary inside the In order to not waste time while overlay has to begin and end within loading a binary image, I highly this overlay. addr = 16-bit address If anything in the FORTH system recommend you use a fast multiple n = signed 16-bit integer block loader like the one which is up to the resident part of the overlay d = signed 32-bit integer accessible in my FORTH. In case you system is changed (recompilation of don't need or want it, use the high the system) the images have to be level version on scr B1. recompiled as well. There is an extra goodie when How to relocate a precompiled resident section keeping the assembler in a separate image. Perhaps by using an additional overlay area: the use of local labels. It link table (?). EM constant gives end address of is possible to compile local LABELS or How to invoke an overlay from available dictionary memory in your EQUATES as constants into the overlay another and return to the old after system. area which is never written back to execution. ov# variable keeps the screen number disk. These labels are valid as long as If the compiler flags an error of the current overlay in memory, zero the assembler overlay is not canceled, during generation of an overlay, keep means no valid overlay in memory. but they consume no memory of the in mind that the DP is now in the OVA variable keeps the address where main dictionary. A proposal for such overlay area while compiling: First the current overlay begins. a LABEL and EQUATE definition is FORGET everything before trying to x and Y are dummy definitions that shown on scr 490. compile the overlay again. are renamed to blank and used to link In conclusion, I want to mention If you have difficulties in adapting the overlay into the main dictionary. some points that I regard as this program to your system: I mainly RELINK nfa ... links this nfa into the drawbacks or as open questions: use a FIG-FORTH version on a 6809 dummy definition Y. How to handle multiple or a 6502 with 1024 Byte/Buffers and CANCEL no stack effect cancels the vocabularies from the inside to the 250 Blocks/Drive. current overlay. outside of an overlay. This system GETIMAGE addr start.blk dr# blks ... loads < blks > continuous blocks from disk, drive , starting at block < start.blk > to the destinatikon _. address . Accesses the disk cm 2-1.12.82 1 driver directly, not via BLOCK. ExG addrl addr2 ... exchanges the contents of addrl and addr2. OVSWITCH no stack effect switches from overlay area to main dictionary and back.

non-resident section

SAVE.IMAGE addr start.blk dr# blks .. . writes < blks > continuous blocks to disk, drive , starting at block cstart.blk> from the source address '< addr > . UNLINK no stack effect unlinks all definitions in overlay area from the main dictionary. OPEN-OVERLAY start.blk blks ... sets pointers for compilation into the overlay area; the overlay shall start at cstart.blk> and be KByte of size. -OVERLAY no stack effect stops compilation into overlay area, unlinks overlay from main dictionary, saves it End Listing to disk and resets pointers back to main dictionary.

Volume V, No. 1 39 FORTH Dimensions FIG Chapter News

~~ Southern Ontario (called Fcode, by analogy with the 6) High-Level FORTH Graphics Pcode of the Pascal system). Currently Pr im it i v es (u n d ergr a d u a t e pro - The fifth quarterly meeting of Fig this implementation strategy is being ject-April 1, 1983 completion). This Southern Ontario was held on March tested via an implementation on project is aimed at the comparison of 5, 1983 with 15 people present. During McMaster’s CYBER/170 with a mic- several line-drawing and other plotting the meeting, Dr. N. Solntseff outlined rocode interpreter written in ETH primitives that could be used to pro- the FORTH-related work being Pascal, A macroprocessor for generat- vide a machine-independent graphics carried out within the Unit for Com- ing host-computer machine code is system. puter Science at McMaster University. being designed. c) Graphics Primitives for the Implementation c) Implementation of figFOR TH78 TRS-80 Colour Computer a) Continuing work on implemen- on a VAX11/780 under VMS (gradu- (undergraduate project-April 1, 1983 completion). This project tation of fig-FORTH 78/79 on Ohio ate project). This project is complete Scientific Instruments C2-8P and C3 and is being written up. complements (b) above and is looking computers. The aim of this work is to at graphics primitives for the TRS-80 investigate floppy-disc, Winchester, Applications Colour Computer. and 0s interfaces, as well as achieving a) Animated-Graphics Thtorial Sys- d) Document Preparation System improvements to the fig model. tem (funded by McMaster’s) Instruc- (graduate project-December 1983 6) Development of a portable tional Development Centre-pilot completion). The aim of this project is FORTH system (undergraduate pro- project completed). A script-based to combine graphics with word pro- ject to be completed by Aprjl 1, 1983). tutorial development system has been cessing to produce a system capable of handling lecture notes for computer The idea behind this is the design of designed cabable of acting as an pseudo-microcode to implement an “animated text-book” to be used in organization and computer architec- ture courses. (An Abstract FORTH Machine (see paper conjunction with computer organiza- IBM PC is being with this title in 1982 Rochester Con- tion and computer architecture class- used as the development system.) ference Proceedings, pp. 157-160). es. The present version is too machine The FORTH-system kernel has been dependent for general distribution as rewritten in the pseudo-microcode it is based on OSI equipment.

Ver. 2 For your APPLE II/II+ Version 2 For 2-80, CP/M ( 1.4 & 2.x), The complete professional software system, that meets & NmthStar DOS Users ALL provisions of the FORTH-79 Standard (adopted Oct. The complete professional software system, that meets 1980). Compare the many advanced features of FORTH- ALL provisions of the FORTH-79 Standard (adopted Oct. 79 with the FORTH you are now using, or plan to buy! 1980). Compare the many advanced features of FORTH- FEATURES OURS OTHERS 79 with the FORTH you are now using, or plan to buy! FEATURES OURS OTHERS 79~Standardsystem gives source portability. YES ~ Professionally written tutorial & user manual 200PG - 79-Standard system gives source portability. YES - Screen editor with userdefinable controls. YES ~ Professionally written tutorial & user manual. 200 PG. - Macro-assembler with local labels YES - Screen editor with userdefinable controls. YES - Virtual memory. YES - Macro-assembler with local labels. YES. ._ - Both 13& 16-sector format. YES - Virtual memory YtS - Multiple disk drives. YES - BDOS, BlOS & console control functions (CP/M) YES - Double~numberStandard & String extensions YES - FORTH screen files use standard resident ~ Upper/lower case keyboard input. YES - file format. YES - LO-Res graphics. YES ~ Double-number Standard & String extensions. YES - 80 column display capability YES - Upper/lower case keyboard input. YES - Z-80 CP/M Ver 2 x & Northstar also available YES - APPLE Il/l I+ version also available YES - A f f orda b I e 1 $9995 - Affordable! $99.95 - Low cost erihancernent option Low cost enhancement options. Hi-Res turtle-graphics. YES - Floating point mathematics YES - Float i ng-point mat hemat ics. YES - Tutorial reference manual Powerful pdckaqe with own manual, 50 functions (AM9511 compatible format) 50 fiinctions in all, Hi Res turtle graphics (NoStar Adv only) YES AM951 1 compatible. - FORTH 79 V 2 (requires CP/M Ver 2 x) $99 95 FORTH--79 V 2 (requrres 48K & 1 disk drive) $ 9995 ENHANCEMENT PACKAGE FOR V 2 ENHANCEMENT PACKAGE FOR V 2 Floating point $ 4995 Floating point & Hi Res turtle graphics $ 4995 COMBINATION PACKAGE (Base & Floating point) $139 95 COMBINATION PACKAGE $1 39 95 (advantage usersadd $49 95 for Hi Res) (CA res add 6% tax COD accepted) (CA res add 6% tax COD & dealer inquiries welcome) MicroMotion MicroMotion 12077 Wilshire Blvd # 506 12077 Wilshire Blvd ?$ 506 L A , CA 90025 (213)821 4340 (213) 821-4340 Specify APPLE, CP/M or Northstar CP/M or Northstar

FORTH Dimensions 40 Volume V, Nc Fig Chapters

U.S. NEVADA Dallas/Ft. Worth Chapter ENGLAND Monthly, 4th Thurs., 7 p.m. ARIZONA Las Vegas Chapter English Chapter Software Automation FORTH Interest Group Suite 900 1005 Business Parkway Phoenix Chapter 101 Convention Center Drive 38 Worsley Road Dennis L. Wilson Richardson, TX Frimley, Camberley Las Vegas, NV 89109 Call Marvin Elder Samaritan Health Services 702/737-5670 Surrey, GU16 5AU, England 2121 E. Magnolia 214/231-9142 or Bill Drissel Phoenix, AZ JAPAN 602/257-6875 NEW JERSEY 214/264-9680 New Jersey Chapter Japanese Chapter Masa Tasaki CALIFORNIA Call George Lyons 201/451-2905 eves. UTAH Baba-Building 8F Los Angeles Chapter 3-23-8 Nishi-Shimbashi Monthly, 4th Sat., 11 a.m. Salt Lake City Chapter Minato-ku, Tokyo Call Bill Haygood Allstate Savings NEW YORK 105 Japan 801/942-8000 8800 So. Sepulveda Boulevard New York Chapter Los Angeles Call Tom Jung NETHERLANDS Phillip Wasson 21 2/746-4602 21 3/649-1428 VERMONT HCC-FORTH Interest Group Chapter Northern California Chapter Vermont Fig Chapter OKLAHOMA F.J. Meijer Monthly, 4th Sat., 1 p.m. Monthly, 3rd Mon., 7:30 p.m. Digicos FORML Workshop at 10 a.m. Tulsa Chapter Vergennes Union High School Aart V.D. Neerweg 31 Palo Alto area. Monthly, 3rd Tbes., 7:30 p.m. Room 210, Monkton Road Ouderkerk A.D. Contact FIG Hotline The Computer Store Vergennes, VT 05491 Amstel, The Netherlands 41 5/962-8653 4343 South Peoria Contact Hal Clark Tulsa, OK RD #1 Box 810 Orange County Chapter Call Bob Giles Starksboro, VT 05487 WEST GERMANY Monthly, 4th Wed., 12 noon. 918/599-9304 or 802/877-2911 days; Fullerton Savings West German Chapter Art Gorski 802/453-4442 eves. 18020 Brookhurst 918/743-0113 Klaus Schleisiek Fountain Valley FIG Deutschland 7 14/523-4202 Postfach 202264 OHIO VIRGINIA D 2000 Hamburg 20 San Diego Chapter West Germany Weekly, Thurs., 12 noon. Dayton Chapter Potomac Chapter Call Guy Kelly Monthly, 2nd Tbes. Monthly, 1st Tues., 7 p.m. Datalink Computer Center 7 14/268-3 100 ext .4784 Lee Center 4920 Airway Road Lee Highway at Lexington St. Dayton, OH 45431 MASSACHUSETTS Arlington, VA Call Gary Granger Call Joel Shprentz Boston Chapter 5 13/849-1483 703/437-9218 eves. SPECIAL GROUPS Monthly, 1st Wed., 7 p.m. Apple Corps FORTH Mitre Corp. Cafeteria Chapter Bedford, MA Users Twice Monthly, 1st & Bob Demrow OREGON 3rd Tbes., 7:30 pm 617/688-5661 after 5 p.m. Portland Chapter 1515 Sloat Boulevard, #2 Call Timothy Huang FOREIGN San Francisco, CA MICHIGAN 9529 Northeast Gertz Circle Call Robert Dudley Ackerman Detroit Chapter 4 151626-6295 Portland, OR 9721 1 AUSTRALIA Call Dean Vieau 503/289-9135 3 13/493-5 105 Detroit Atari FORTH Australia Chapter Monthly, 1st Wed. Contact Lance Collins Call Tom Chrapkiewicz MINNESOTA 65 Martin Road 313/524-2100 or Glen Iris, Victoria 3146 313/772-8291 MNFIG Chapter PENNSYLVANIA (03)292600 Monthly, 1st Mon. Nova Group Chapter MNFIG Philadelphia Chapter Contact Mr. Francis Saint 1156 Lincoln Avenue Continental Data Systems CANADA 2218 Lulu St. Paul, MN 55105 1 Bala Plaza, Suite 212 Southern Ontario Chapter Witchita, KS 6721 1 Call Mark Abbot (days) Bala Cynwid, PA 91004 Contact Dr. N. Solntseff 3 16/261-6280 days 612/854-8776 or Call Barry Greebel Unit for Computer Science Fred Olson MMSFORTH Users Groups McMaster University Monthly, 3rd Wed., 7 p.m. 61 2/588-9532 Hamilton, Ontario L8S 4K1 Cochituate, MA 416/525-9140 ext. 2065 Dick Miller MISSOURI TEXAS Quebec Chapter 617/653-6136 St. Louis Chapter Austin Chapter Call Gilles Paillard (25 groups world-wide) Call David Doudna Call John Hastings 418/871-1960 or 314/867-4482 512/327-5864 418/643-2561

FORTH Dimensions Volume V, No. 1 41 Computers FORTH System Vendors AlphaMicro ...... P3, S3 Apple ...... A4, F4, 12, 14, J1, L4, M2, M6, M8, 02, 03 Atari ...... M6, P2, Q1, V1 (Codes refer to alphabetical listing Compaq ...... M5 e.g., A1 signifies AB Computers, etc.) Cromemco...... A5, M2, M6 DEC PDP/LSI-11 ...... C2, F3, L2, S3 Heath-89 ...... M2, M6, M7 Hewlett-Packard 85 ...... Processors Hewlett-Packard 9826/36 .-. . . C4 IBMPC ...... AS, C2, F3, L1, M5, M6, Q2, S9, w2 1802 . . , , ...... C1, C2, F3, F6, L3 IBMOther ...... L3, W1 6502(AIM, KIM, SYM) . . . . . R1, R2, S1 Kaypro II/Xerox 820 ...... M2 6800 ...... C2, F3, F5, K1, L3, M6, T1 Micropolis ...... A2, M2, S2 6801 ...... P4 NorthStar ...... 15, M2, P1, S7 6809 ...... C2, F3, L3, M6, S11, T1 Nova ...... C5 68000 ...... C2, C4, D1, El, K1 OhioScientific ...... A6, B1, C3, 01, S6, T2 68008 ...... P4 Osborne ...... M2 8080/85 ...... A5, C1, C2, F4, 15, L1, L3, M3, PetSWTPC ...... Al, A6, B1, C3, 01, S6, T2, T5 M6, R1, T3 Poly Morphic Systems . . . . . A7 Z80/89 A3, AS, C2, F4, 13, L1, M2, M3, ...... TRS-80 I, 11, and/or 111 . . . . 15, M2, M5, M6, S4, S5, S10 M5, N1, T3 . . TRS-8OColor ...... A3, A8, F5, M4, S11, T1 Z8oooO ...... I3 Vector Graphics ...... M2 8086/88 ...... C2, F2, F3, L1, L3, M6 9900 ...... E2, L3 Other Products/Services Applications ...... P4 Operating Systems Boards, Machine ...... F3, M3, P4, R2 Consultation ...... C2, C4,N1, P4, T3, W1 CP/M ...... A3, A5, C2, F3, 13, L3, M1, M2, CrossCompilers ...... C2, F3, 13, M6, N1, P4 M6, T3 Products, Various ...... AS, C2, F3, 15, S8, W2 CP/M86 ...... C2 Training ...... C2, F3, 13, P4, W1

FORTH Vendors (Alphabetical)

The following vendors offer FORTH systems, applications, or con- keep us informed on availability of the products and services listed. sultation. FIG makes no judgement on any product, and takes no Vendors may send additions and corrections to the Editor, and must responsibility for the accuracy of this list. We encourage readers to include a copy of sales literature or advertising.

FORTH Systems B E 6. FSS A P.O. Box 8403 1. Blue Sky Products 1. Emperical Research Group Austin, TX 78712 729 E. Willow P.O. Box 1176 512/477-2207 Signal Hill, CA 90806 Milton, WA 98354 1. AB Computers 206/63 14855 252 Bethlehem Pike C 2. Engineering Logic Colmar, PA 18915 1. CMOSOFT 215/822-7727 1252 13th Ave. 1 P.O. Box 44037 Sacramento, CA 95822 2. Acropolis Sylmar, CA 91342 1. IDPC Company F 17453 Via Valencia 2. COMSOL, Ltd. P.O. Box 11594 San Lorenzo, CA 94580 Treway House 1. Fantasia Systems, Inc. Philadelphia, PA 191 16 415/276-6050 Hanworth Lane 1059 The Alameda 21 5/676-3235 4. Applied Analytics Inc. Chertsey, Surrey Belmont, CA 94002 2. IUS (Cap’n Software) 8910 Brookridge Dr., #300 England KT16 9LA 415/593-5700 281 Arlington Ave. Upper Marlboro, MD 20870 3. Consumer Computers 3. FORTH, Inc. Berkeley, CA 94704 5. Aristotelian Logicians 8907 La Blvd. 2309 Pacific Coast Highway 415/525-9452 2631 E. Pinchot Ave. La Mesa, CA 92041 Hermosa Beach, CA 90254 3. Inner Access Phoenix, AZ 85016 7 14/698-8088 213/372-8493 517K Marine View 7. Abstract Systems, etc. 4. Creative Solutions, Inc. 4. FORTHWare Belmont, CA 94002 RFD Lower Prospect Hill 4801 Randolph Rd. 639 Crossridge Terrace 41 5/591-8295 Chester, MA 0101 1 Rockville, MD 20852 Orinda, CA 94563 4. Insoft 8. Armadillo Int’l Software 5. Capstone Computing, Inc. 5. Frank Hogg Laboratory 10175 S.W. Barbur Blvd. P.O. Box 7661 5640 Southwyck Blvd., BE 130 Midtown Plaza Suite #202B Austin, TX 78712 Toledo, OH 43614 Syracuse, NY 13210 Portland, OR 97219 512/459-7325 419/866-5503 3 15/474-7856 503/2444181

FORTH Dimensions 42 Volume V, No. 1 5. Interactive Computer N 6. Software Federation Datricon 44 University Drive 7911 33rd Dr., Systems, Inc. 1. Nautilus Systems NE #200 6403 Di Marco Rd. Arlington Hts., IL 6ooo4 Portland, OR 9721 1 P.O. Box 1098 503/284-8277 Tampa, FL 33614 Santa Cruz, CA 95061 3 12/259-1355 408/475-746 1 7. Software Works, The Golden River Corp. J 1032 Elwell Ct., #210 7315 Reddfield Ct. 0 1. JPS Microsystems, Inc. Palo Alto, CA 94303 Falls Church, CA 22043 361 Steelcase Rd., W. 1. OSI Software & Hardware 415/960-1800 Triangle Digital Services Ltd. 3336 Avondale Court Markham, Ontario 8. Supersoft Associates 23 Campus Road Canada L3R 3V8 Windsor, Ontario London El7 5PG Canada N9E 1x6 P.O. Box 1628 416/475-2383 Champaign, IL 61820 England 5 19/969-2500 217/359-2112 K 2. Offete Enterprises Application Packages Only 1306 S “B” St. 9. Satellite Software Systems 1. Kukulies, Christoph 288 West Center See System Vendor Chart San Mateo, CA 94402 Ing. Buro Datentec Orem, UT 84057 for others Heinrichsallee 35 3. On-Going Ideas 801/224-8554 Curry Associates Aachen, 5100 RD #I, Box 810 West Germany 10. Spectrum Data Systems P.O. Box 11324 Starksboro, VT 05487 Palo Alto, CA 94306 802/453-4442 5667 Phelps Luck Dr. L Columbia, MD 21045 41 5/322-I463 P 301,992-5635 1. Laboratory Microsystems InnoSys 4147 Beethoven St. 1. Perkel Software Systems 11. Steams, Hoyt Electronics 2150 Shattuck Ave. 1636 N. Sherman Berkeley, CA 94704 Los Angeles, CA 90066 4131 E. Cannon Dr. Springfield, 2 13/306-74 12 MO 65803 Phoenix, AZ 85028 415/843-8114 602/W6- 17 17 2. Laboratory Software 2. Pink Noise Studios P.O. Box 785 Systems, Inc. T Consultation & Mining Only Crockett, CA 94525 3634 Mandeville Canyon See System Vendor Chart 415/787-1534 1. Talbot Microsystems Los Angeles, CA 90049 1927 Curtis Ave. for others 21 3/472-6995 3. Professional Mgmt. Services Redondo Beach, CA 90278 Bartholomew, Alan 724 Arastradero Rd., #I09 3. Lynx 2210 Wilshire Blvd. #289 Palo Alto, CA 94306 2. Technical Products Co. 3301 Ocean Park, #301 Santa Monica, CA 90403 408/252-22 18 P.O. Box 12983 Santa Monica, CA 90405 Gainsville, FL 32604 213/394-0796 213/450-2466 4. Peopleware Systems Inc. 904/372-8439 Boulton, Dave 5190 West 76th St. 4. Lyons, George 581 Oakridge Dr. Minneapolis, MN 55435 3. Emin Engineering Co. 280 Henderson St. Redwood City, CA 94062 612/831-0872 C/o Martian Technologies Jersey City, NJ 07302 8348 Center Dr. Suite F Brodie, Leo 201/451-2905 Q La Mesa, CA 92041 9720 Baden Ave. 1. Quality Software 619/464-2924 Chatsworth, CA 91311 M 6660 Reseda Blvd., #lo5 4. Transportable Software 2 13/W8-8302 1. M & B Design Reseda, CA 91335 P.O. Box 1049 Eastgate Systems Inc. 820 Sweetbay Dr. 2. Quest Research, Inc. Hightstown, NJ 08520 P.O. Box 1307 Sunnyvale, CA 94086 P.O. Box 2553 609/448-4 175 Cambridge, MA 02238 2. MicroMotion Huntsville, AL 35804 V Girton, George 12077 Wilshire Blvd., #506 800/558-8088 1753 Franklin Los Angeles, CA 90025 1. Valpar International R 3801 E. 34th St. Santa Monica, CA 90404 213/821-4340 2131829-1074 2. Rockwell International ncson, AZ 85713 3. Microsystems, Inc. 800/528-7070 Go FORTH 2500 E. Foothill Blvd., #I02 Microelectronics Devices P.O. Box 3669 W 504 Lakemead Way Pasadena, CA 91 107 Anaheim, CA 92803 Redwood City, CA 94062 213/577-1477 7 14/632-2862 1. Ward Systems Group 41 5/366-6124 4. Micro Works, The 8013 Meadowview Dr. S Frederick, MD 21701 Harris, Kim R. P.O. Box 1110 Forthright Enterprises Del Mar, CA 92014 1. Saturn Software, Ltd. 2. Worldwide Software P.O. Box 50911 714/942-2400 P.O. Box 397 2555 Buena Vista Ave. Palo Alto, CA 94303 New Westminister, BC 5. Miller Microcomputer Berkeley, CA 94708 415/858-0933 V3L 4Y7 Canada 415/644-2850 61 Lake Shore Rd. Intersystems Management Natick, MA 01760 2. Shaw Labs, Ltd. Z Computer Consultancy 617/653-6136 P.O. Box 3471 Story Hill Rd. RFD3 Hayward, CA 94540 1. Zimmer, Tom 6. Mountain View Press Dunbarton, NH 03045 41 5/276-6050 292 Falcato Dr. P.O. Box 4656 Milpitas, CA 95035 603/774-7762 Mountain View, CA 94040 3. Sierra Computer Co. Laxen, Henry H. 41 5/% 1 -4103 617 Mark NE 1259 Cornell Ave. Albuquerque, NM 87123 7. MCA Berkeley, CA 94706 8 Newfield Ln. 4. Sirius Systems Boards & Machines Only 415/525-8582 Newtown, CT 06470 7528 Oak Ridge Highway See System Vendor Chart McIntosh, Norman Knoxville, TN 37921 for others 8. Metacrafts Ltd. 2908 California Ave., #3 615/693-6583 Beech Trees, 144 Crewe Rd. Controlex Corp. San Francisco, CA 941 15 Shavington, Crewe CWI 5. Software Farm, The 16005 Sherman Way 415/563-1246 5AJ P.O. Box 2304 Van Nuys, CA 91406 England Reston, VA 22090 21 3/780-8877 (Continued on page 33)

Volume V, No. 1 43 FORTH Dimensions 1 FORTH INTEREST GROUP MAIL ORDER

FOREIGN LlsA AIR OMeemberahip in FORTH Interest Group and $15 $27 Volume V of FORTH DIMENSIONS OBack Volumes of FORTH DIMENSIONS. Rka pa d- $15 $18 01 011 OIU 01v Ofig-FORTH Installation Manual, containing the language model $15 $18 of fig-FORTH, a complete glossary, mcmory map and installation instructions OAssembly Language Source Listings of fig-FORTH for specific CPUS and machines. The above manual is required for installation. Check appropriate box(es). Ripa ad^. $15 $18 01802 06502 06800 06809 OVAX 0280 nweo O8086/8088 omo OAPPLE11 OEarPsE UPACE JNOVA OPW-11 068000 OALPHA MICRO n'5tarting FORTH" by Brodie. BEST book on FORTH. (Paperback) $18 $22 O"Starting FORTH' by Brodie. (Hard Cover) $22 $27 OPROCEEDINGS 1980 FORML (FORTH Modification Lab) Conference $25 $35 OPROCEEDINGS 1981 FORML Conference, Both Volumes $40 $55 DVoIume I, Language Structure $25 $35 OVolume 11, Systems and Applications $25 $35 OPROCEEDINGS 1982 FORML Conference $2 5 $35 OPROCEEDINGS 1981 FORTH uliv. of Rochester Conference $25 $55 gPROCEEDINGS 1982 FORTH uliv. of Rochester Conference $25 $35 OFORTH-79 Standard, a publication of the FORTH Standard8 Team $15 $18 OKitt Peak Primer, by Stevens. An in-depth self-study primer. $25 $35 OBYTE Magazine Reprints of FORTH articles, 8/80 to 4/81 $5 $10 OFIG T-shirts: OSmall OMedium OLarge OX-Larqe $10 $12 OPoster, August 1980 BYTE cover, 16" x 22" $3 $5 UFORTH Programmer's Reference Card. If ordered separately, FREE send a stamped, addressed envelope. 001. Dobb's Journal, Tvo FORTE Iacnrcs, 9/81 6 9/82 $7 $10

I

FORTH INTEREST BOX 1108 *SAW 94070 -- .--__I GROUP* PO CARLO8. CA --- 1..-.- ~" I -.-.-- -_..__-_-_- - I ___ c-_ I- ____- I TH INTER ST GROUP ,-' 13. BOX1105 5,-:r.i Carlos, CA 94070

Address Correction Requested