Home
6 - Forth
Contents
1. gt loop index address in patt table offset into char buffer gt bytes to read read charpat into buff loop index gt invert entire buff gt inversion buffer address of char 128 bytes to write read to patt table gt character to write location on acreen re write screen INVERT VARS READSCR READCHAR INVERTBUF PATTTOVDP WRITESC REVERT CARBUF LOC LEN VNBW INVERTS gt R VARS READSCR READCHAR INVERTBUF PATTTOVDP WRITESC R gt O DO REVERT 2000 0 DO LOOP WRITESC 2000 0 DO LOOP LOOP REVERT R gt BASE 32 predetermined set of unused ASCII characters 6 Write an appropriately sized section of redefined characters into the screen image array at the correct location By use of variables to hold the screen location and the segment length and a character buffer to hold the original screen segment reversal of the inver sion is simple rewrite the character buffer to the saved screen location The program outlined above is easily implemented in TI FORTH The version presented here is actually a direct con version from TMS 9900 assembly lan guage The set of system synonyms provided in TI FORTH makes it pos sible to translate many machine lan guage tasks without using the separate and somewhat cumbersome ASSEMBLY and CODE vocabularies All kinds of VDP memory manipulation is possible and since this program is almost entire ly VDP manipulation al
2. Volume 8 Number 6 March April 1987 5 00 Dimensions Bresenham Line Drawing 7776 Limericks l Dos File Disk IO Inverse Video and TI FORTH State of the Standard re wt m More a i Well what I really want is a CMOS computer system for dedicated applications y Guess it s time to get the design team going basa Compl Kof A antak on rest R low Powe WAI T STOP m mede jen c n nhs with 5 i etbi a oe timer Sy Stem ott P eae hard wre A N SJS a pOWe ke d mariny E Seed i et anA ruto P 49 amp p land 2 sei port e syne 4 ab aa Syne ne ha cone i tE NEW MICROS INC 1601 CHALK HILL ROAD DALLAS TEXAS 75212 214 339 2204 Volume VIII No 6 Forth Dimensions Published by the Forth Interest Group Volume VIII Number 6 March April 1987 Editor Marlin Ouverson Advertising Manager Kent Safford Production Cynthia Lawson Berglund Typesetting LARC Computing Forth Dimensions solicits editorial material comments and letters No re sponsibility is assumed for accuracy of submissions Unless noted otherwise material published by the Forth Interest Group is in the public domain Such material may be reproduced with credit given to the author and to the Forth Interest Group Subscription to Forth Dimensions is free with membership in the Forth Inter est Group at 30 per year 43 foreign air For membership change of address and to submit items for publication the ad
3. Continue until counter is zero Go to trailer when nearly done Start comparision at MS word If carry is set don t subtract If result is non zero subtract Otherwise compare LS word If carry is clear subtract Decrement the counter Clear the carry bit Continue till count is zero Final adjustment of quotient Put LS of remainder on stack Push MS of remainder on stack Normal ending Figure One 8086 8088 division routine allowing double length divisors Volume Vili No 6 25 FIG FORTH for the Compaq IBM PC and compatibles 35 Operates under DOS 2 0 or later uses standard DOS files Full screen editor uses 16 x 64 format Editor Help screen can be called up using a single keystroke Source included for the editor and other utilities Save capability allows storing Forth with all currently defined words onto disk as a COM file Definitions are provided to allow beginners to use Starting Forth as an introductory text Source code is available as an option add 20 Async Line Monitor Use Compaq to capture display search print and save async data at 75 19 2k baud Menu driven with extensive Heip Requires two async ports 30 A Metacompiler on a host PC produces a PROM for a target 6303 6803 Includes source for 6303 FIG Forth Application code can be Metacompiled with Forth to produce a target application PROM 280 FIG Forth in a 2764 PROM for the 6303 as produced by the above M
4. REVEAL fix Thanks to Victor Yngve for a fine article Mitch Bradley Mountain View California Forth 83 r8 27 86 vhy make header for new word old word found yes compile its cfa make new word immediate was old word immediate yes set new to execute no set new to check state and compile if compiling or execute if executing old word not found revised 8 27 86 vhy A defining word used in the form SYNONYM lt new name gt lt old name gt Create a dictionary entry for lt new name gt so that when lt new name gt is later used it will have substantially the same action that lt old name gt would have had If lt old name gt was immediate the action will be immediate otherwise not During compilation the action is to compile the same thing that lt old name gt would have compiled The dictionary search order is not changed and lt new name gt must be different from lt old name gt Yngve Screens Wayland Products Step Up to Reverse Polish Array Processing Wayland Products is apply ing Reverse Polish Nota tion RPN to array pro cessing A typical session would be The right arrow assigns the price for three kinds of vegetables to Store A and Store B The last line is the price of Store C The policy of Store C is to meet the price i e minimum of its competi tion No looping code is used In array languages many loops are internal to the la
5. in its use Ideally the facilities needed for programming gen eral versions of such words should be added to the standard In regard to the minor implementa tion quibble the given definition seems to me to be perfectly legal according to the Forth 83 Standard The suggested alternative requires defining and nam ing three words instead of one and it ties up more overhead in dictionary space Forth treats both and IF ELSE THEN as structures subject to error checking when the word contain ing them is compiled But the sequence CREATE DOES gt is no more a structure than CREATE ALLOT for CREATE can be used alone without DOES gt or ALLOT and CREATE can be replaced by a word containing CREATE Any word containing DOES gt however is unstructured in a different sense the first part before DOES gt executes when the word is used to compile a child and the second part after DOES gt executes when the child is run The DOES gt exits from the word after compiling into the child a jump back into the word This is the very essence of DOES gt and the source of its power Thus in 2 DOES gt the nesting code compiled by the colon executes at the child s compile time but the unnesting code compiled by the semicolon executes at the child s run time Just as there is no problem using DOES gt to make a child jump into the middle of a colon definition provided there is a proper return on the
6. Note that fancier direct screen access assembly language programming can SIGNIFICANTLY speed up point plotting at the cost of loss of generality CODE PLOT POINT AX POP DX POP CX POP AH 0C MOV 10 INT NEXT JMP END CODE X Y COLOR gt Plot a single point BX BX XOR page 0 for EGA DECIMAL XMAX YMAX delimit screen boundaries 319 CONSTANT XMAX Change to 639 for EGA or CGA HIRES 199 CONSTANT YMAX Change to 349 for EGA 4 CONSTANT COLORS Change to 16 for EGA 2 for CGA HIRES SCREEN 5 WWAIHUE WHR O VARIABLE DECLARATIONS MOVE CURSOR SPECIAL BRESENHAM POINT DECIMAL VARIABLE XNOW XNOW YNOW is current cursor location VARIABLE YNOW 0 0 is top left corner of CRT VARIABLE COLOR current line draw color 1 COLOR Variables per Foley amp Van Dam Fund of ICAD 1st ed p 435 VARIABLE INCR1 VARIABLE INCR2 VARIABLE DX VARIABLE DY MOVE CURSOR YNOW XNOW POINT XY gt COLOR PLOT POINT B POINT X Y DELTA gt gt R DDUP POINT R gt xX Y gt Move cursor location before a draw Point plot using COLOR variable For Bresenham line drawing use Cg ee ee FORTH Dimensions 12 Volume VIH No 6 Straightforward Line Drawing SCREEN 6 Algorithms 0 BRESENHAM LINE DRAW PRIMITIVES X Y X Y 1 DECIMAL X X1 Y1 DELTA gt X2 Y2 DELTA Now that we can assume the availa ROT 1 ROT ROT bility of a point plotting word how AED x
7. enthusiastic amateur mathematician and logician published the remark able and unique Cent mille milliards de poemes Having care for a slight dif ference in terminology between French and American English the title may be rendered as One hundred thousand billion poems that is 1014 poems which are in fact sonnets While the book does not contain the promised 10 4 sonnets it does contains ten son nets each of fourteen lines and by means of an ingenious system of slits in the pages the reader may progress downward selecting and displaying lines from any of the ten sonnets Thus any one of 10 4 sonnets can be displayed for reading Queneau calcu lated that alloting forty five seconds to reading a sonnet and fifteen seconds more to resetting the pages with eight hours per day of reading for 365 days per year over 190 million years would be required to read all the possible variants Queneau was inspired with the notion of his book while handling a children s book in which leaflets are flipped to depict chimerical animals But Queneau did not write chimeras He composed his sonnets so that lines were inter changeable if two kth lines are inter changed the new sonnets still make sense All 10 4 sonnets are readable on their own One must form this conclu sion inductively No one not even the author could read more than a vanish ingly small fraction of the essentially infinite number of possibili
8. 83 Standard 217 F83 SOURCE 25 26 35 Henry Laxen amp Michael Perry A complete listing of F83 including source and shadow screens Includes introduction on getting started 218 FOOTSTEPS IN AN EMPTY VALLEY NC4000 Single Chip Forth Engine 25 26 35 Dr C H Ting A thorough examination and explanation of the NC4000 Forth chip including the complete source to cmForth from Charles Moore 219 FORTH A TEXT AND REFERENCE 22 23 33 Mahlon G Kelly amp Nicholas Spies A text book approach to Forth with comprehensive referen ces to MMS Forth and the 79 and 83 Forth Standards 220 FORTH ENCYCLOPEDIA 25 26 35 Mitch Derick amp Linda Baker A detailed look at each fig Forth instruction 225 FORTH FUNDAMENTALS V 1 16 17 20 Kevin McCabe A textbook approach to 79 Standard Forth 230 FORTH FUNDAMENTALS V 2 13 14 18 Kevin McCabe A glossary 232 FORTH NOTEBOOK 25 26 35 Dr C H Ting Good examples and applications Great learning aid PolyFORTH is the dialect used Some conversion advice is included Code is well documented 233 FORTH TOOLS 22 23 32 Gary Feierbach amp Paul Thomas The standard tools required to create and debug Forth based applications 235 INSIDE F 83 25 26 35 Dr C H Ting Invaluable for those using F 83 237 LEARNING FORTH 1 7 18 27 Margaret A Armstrong Interactive text introduction to the basic concepts of Forth Incl
9. About the last item Kelly says Giving old names new meanings was considered the most offensive action that was taken I agree that it was a radical step and one which should never be repeated However it was not done in ignorance but only after a great deal of careful consideration Something that seems to be com pletely overlooked in the current dis cussions is that all the attempts to produce a standard prior to Forth 79 were preliminary gropings and that Forth 79 was fatally flawed Now if the major vendors had said no to the obnoxious changes between the 1979 and the 1983 standards the standards team probably would have produced a somewhat different Forth 83 Standard we had received twenty two yes votes and zero no votes from the twenty six voting members when the standard was finally released DASH FIND amp ASSOCIATES Our company DASH FIND amp ASSOCIATES is in the business of placing FORTH Program mers in positions suited to their capabilities We dea only with FORTH Programmers and companies using FORTH If you would like to have your resum included in our data base or if you are looking for a FORTH Programmer contact us or send your resum to DASH FIND amp ASSOCIATES 808 Dalworth Suite B Grand Prairie TX 75050 214 642 5495 Committed to Excellence Volume VIH No 6 Other topics of discussion from the electronic standards debate include
10. Apple only C Module Relocator Oo00 20 25 30 200 60 60 60 Key to Vendors HW Hawg Wild Software LM Laboratory Microsystems MM MicroMotion PNS PS MPE Pink Noise Studio Par Sec MicroProcessor Engrg FORTH MANUALS GUIDES amp DOCUMENTS ALL ABOUT FORTH by Haydon MVP Glossary FORTH Encyclopedia by Derick amp Baker Dr Dobb s Tootbook FORTH A Text amp Ref by Kelly amp Spies FYS FORTH from the Netherlands New User Manual C IBM CI Apple 1 FORTH Tools and Applic by Feierbach The Complete FORTH by Winfield 16 Learning FORTH by Armstrong 17 Understanding FORTH by Reymann 4 FORTH An Applications Approach by Toppen FORTH Applications by Roberts Mastering FORTH by Anderson amp Tracy Beginning FORTH by Chirlian FORTH Encyci Pocket Guide And So FORTH by Huang A college level text 3 STARTING FORTH by Brodie Best instructional manual available st Ed FORML Proceedings 1980 30 1981 45 1982 30 O 1983 30 1984 30 1985 35 981 Rochester Proceedings 1981 0 1982 O 1983 1984 C 1985 Vol 3 2 Bibliography of FORTH The Journal of FORTH Application amp Research Vol 1 1 O Vol 2 3 Vol 1 2 Vol 2 4 Vol 2 1 Vol 3 1 Vol 2 2 Vol 3 2 see above 15 each METAFORTH by Cassady 30 Threaded Interpretive Languages 25 Systems Guide to fig FORTH by Ting
11. If the assertions must be removed from a production version redefine ASSERT as DROP May all your asser tions be true Norman L Hills Des Moines Iowa Out of Ireland Dear Mr Ouverson After reading reference to Henry Laxen s multi tasking tutorial and be ing very interested in giving my fig FORTH implementation multi tasking capability I felt compelled to purchase the relevant back issues of Forth Dimensions V 4 5 The tutorial taught me a great deal but being a novice programmer I was unable to convert Henry s 8080 ex ample to run on my 6502 I think this should be possible using a BRK in struction instead of RST I would be very interested in hearing from any of your readers who might have perform ed the conversion 1 am involved in hardware design and at present I am working on a pro duct using voice processing I find Forth a very convenient language from the hardware point of view in that l can generate test code very quickly and without the tedium of assembly coding I would be interested in reading more about real life commercial ap plications of Forth in the pages of Forth Dimensions in the future I m sure Forth is doing many interesting things out there Sincerely Richard Rooney Kilsallaghan Co Dublin Ireland F1 F5 for F83 Dear Marlin Well I ve finally done it After l mistyped a line five times in a row I decided it was time to make the DOS editing keys F1 F5
12. Inside F83 Manual by Ting F83 Source by Ting NC 4000 FORTH Engine Manual by Ting FORTH Notebook by Ting More on NC400 3 vol Invitation to FORTH PDP 11 User Man 6502 User s Manual by Rockwell intl FORTH PRIMER Old But Good FORTH 83 Standard FORTH 79 Standard 25 22 each 25 15 25 22 Vol 3 3 Vol 3 4 22 10 25 25 18 17 10 25 NEw 22 2nd Ed 22 68000 fig Forth with assembler 25NEw Thinking FORTH by Leo Brodie author O of best selling Starting FORTH 18 O o Installation Manual tor fig FORTH Source Listings of fig FORTH Specify CPU or Computer Ordering Information Payment must accompany order Check Money Order payable to MOUNTAIN VIEW PRESS INC VISA MasterCard American Express COD s 10 extra Minimum order 15 No billing or PO s without checks California residents add sales tax Shipping costs in US included in price Foreign orders pay in US funds on US bank include for handling and shipping by AIR 5 for each item under 25 10 for each item between 25 and 99 and 25 for each item over 100 All prices and products subject to change or withdrawal wit
13. Len Zettel Trenton Michigan Checksums are numbers that result from doing some kind of logical or arithmetic operations on a string of numbers The simplest checksum is exactly that the running total Check sums are very handy gadgets They are usually used as a verification that two sets of numbers are the same same checksums same numbers same order Klaxon Suralis and Leo Brodie show ed us some words that did checksums on Forth screens treating the charac ters as their ASCII valued numbers The idea was if you hand entered a source screen from Forth Dimensions say you could be reasonably sure you had entered it correctly when your system gave you back the same check sum value that had been furnished I find it also comes in handy when I can t remember if my hard copy bac kup is of the latest version If the checksum is still the same it is So since checksums will have their maximum usefulness if everybody in the world uses the same scheme why not just dig out the back issues and use the ones already published Mostly because of one small problem which Leo Brodie himself created Because we are only interested in the letter perfect accuracy of the source code the checksum words treated multiple blanks as one blank and skipped com ments which at the time their article was written only came in the form of text enclosed in parentheses Nowadays we all use the backslash as another comment indicator N
14. This short article describes a simple interface to PC DOS used on the IBM PC or equivalent machines The code is written around MVP FORTH but it could be incorporated in virtually any Forth if desired A short test indicated that it is compatible with files used by F83 The words used by the operator are described below The supporting words are described later OPEN Used in the form OPEN filename to open an exist ing DOS file or to create a new one If a new one is being created then an appropriate message is dis played An error is returned if the file cannot be opened With this simple system only one file can be open at a time CLOSE Used in the form cLose to close the presently open file If the file has been writ ten to this word updates the directory accordingly usually only the time has changed If the file cannot be closed then an error message is displayed DEL Used in the form p t file name to delete the file on the default drive if it can be found If not an error mes sage is displayed MVP DISK This patches the execution variable Ryw to point to the original R w that comes with MVP FORTH basic sector I O DOS DISK This patches the execution variable W W to point to the new word DosRiw With these two words you can toggle back and forth between the two types of disk I O A This switches the default drive to drive A B This switches the defaul
15. Xl Y1 DELTA gt X2 Y2 DELTA can we draw lines Horizontal and ROT 1 ROT ROT vertical lines are relatively straightfor ward For example Y X1 Y1 DELTA gt X2 Y2 DELTA SWAP 1 SWAP HORIZONTAL TEST Y X1 Yl DELTA gt X2 Y2 DELTA 100 0 DO 10 POINT LOOP SWAP 1 SWAP shows that horizontal lines are drawn by merely incrementing an X value for a constant Y value Similarly forty SCREEN 7 0 BRESENHAM LINE FOR 0 lt SLOPE lt 1 five degree lines may be drawn by 1 DECIMAL Assume DX and DY are already set up using a word that simultaneously incre LINEO lt M lt 1 NEWX NEWY gt ments both X and Y values such as DY 2 INCR1 DY DX 2 INCR2 Pick min x OVER XNOW gt IF current cursor at min x DDROP XNOW YNOW THEN DIAGONAL TEST DDUP POINT 100 0 DO Compute D INCR1 DX Stack X Y DELTA DX 0 DO DUP 0 lt II POINT LOOP IF D lt 0 X B POINT INCR1 ELSE D gt 0 EXSEL TGBZROINT INCR2 THEN But what about lines that are in LOOP DROP DDROP between A line which spans twice as many X points as Y points would be drawn by SCREEN 8 X 2 Y 0 BRESENHAM LINE FOR 1 lt SLOPE lt INFINITY 0 1000D0 1 DECIMAL Assume DX and DY are already set up LINE1L lt M lt Z NEWX NEWY gt DUP POINT 1 DX 2 INCRI DX DY 2 INCR2 Pick min y DUP YNOW gt DUP IPOINT1 LOOP IF current cursor at min y DDROP XNOW YNOW
16. add 7 other on a US Bank A 10 charge will be cases will be much sooner era counties add 6 added for returned checks 3 1 87 FORTH Dimensions 24 Volume VIII No 6 Continued from page 20 SCR 72 HEX DOS 1 0 CONTINUED MVP DISK R W CFA R W 5 DOS DISK DOSR W CFA R W 35 a 1 2 3 4 5 6 7 8 9 2OAPRBGCGW CHANGES EXECUTION VARIABLE TO R W CHANGES EXECUTION VARIABLE TO DOSR W Note that the above works for forth 79 standard For forth 83 standard change to D and delete CFA Since this code was written primarily for MVP users this comment is superfluous end of file ok Continued from page 18 UDMOD Divide quad by double HEADER UDMOD UDDIV POP UD1SUB SUB f UD2 CMP Jc UD2CC JNZ UD1SUB CMP BX DX INC UD1SUB WORD PTR BP POP POP POP MOV PUSH MOV CLC RCL WORD PTR BP 4 RCL WORD PTR BP 2 RCL BX 1 RCL AX 1 SNC UD2 BX DX SBB AX CX DEC BYTE PTR BP STC JNZ UD1 JMP UD3 i i i G i 1 1 AX CX UD1 WORD PTR 4 BP 1 WORD PTR BP 2 1 BP BX AX uquad uddiv udquot udrem DenominatorHi DenominatorLo AccumulatorHi AccumulatorLo Set count to 32 Keep the count on the stack Point to stack Not really needed Shift 64 bit Accum left by 1 If no carry do test subtract Carry was set We must subtract AX is the most significant part Decrement the counter
17. and perhaps a serial port or two and a 16 bit timer system that can handle some inputs to latch the count and some outputs that can be set up to toggle at the correct time without further processor attention and maybe a pulse accumulator And a d converter with a couple channels would sure be the ticket It would have to be fairly fast though and maybe be taking readings all the time so the processor can just get fresh data when needed And maybe there s a way I could do my editing on a PC and download the source to the dedicated system Perhaps it could even put the downloaded program into its own EEPROM But really the final system requires a low dollar unit it just can t cost too much It would be nice if it were smaller than a bread basket I wonder how much the first prototype is going to cost this time It sure would help if there were a pretested full up version of the system with a prototyping area built on and maybe even a target version of that same system Yeah I may be dreaming but if one existed I d buy it in a minute Guess it s time to get the design team going 1 800 255 4664 for New Micros Inc Sales NEW MICROS INC 1601 CHALK HILL ROAD DALLAS TEXAS 75212 214 339 2204 FORTH Dimensions 26 Volume VIII No 6 Hey Hey I operate on 10ma typical at 8 Mhz lower in WAIT mode with a STOP mode in the 10ua range I ve got a full featured FORTH and an operat
18. etc available in Forth Laxen and Perry s F83 for IBM PC and compatibles only The basic trick is to redefine EXPECT to make use of the DOS string input function It s simple but it has side effects The original EXPECT did its own key decoding The new one e Emphasis on Programming in the Large Tree Structured Scoping of Dictionary Direct Editing of Dictionary Structure with Dictionary Editor Text Editor allows Screens of any Size Large Memory Model 32 bit Stack Arithmetic Tight Binding of Source and Code Modifed Modules are Compiled upon leaving the Text Editor New Definition Completely Replaces the Old Definition in Dictionary Old Definition is Returned to Free Memory Implements Compile by Demand Avoids Re Loading Source Files Online Help Facility FI Key Provides Context Sensitive Help on Errors in Editors Provides Quick Reference on Primitives Apropos Help from Text Editor on both Primitives and User Defined Modules Turnkey Application Generator Produces a Stand Alone EXE File Strips Unused Primitives Kernel Routines Invoked with a Single Keystroke Vectored Error Handling e Complete Debugging Tools Source Level Tracing Breakpoints Inspect or Modify Variables during Trace Shell to the Interpreter During Trace FORTH Dimensions 6 Volume Viti No 6 shown in Figure One leaves it to DOS to do so EXPECT is defined on screen 49 all numbers in decimal of K
19. organization of the FST suggestions for future standardization efforts and specific work needed such as surpass ing sixteen bits local or stack vari ables data and programming struc tures bit manipulation vectored I O quans and transient headers Exten sions have been requested to provide floating point math operating system interfaces files graphics strings and math statistics packages Kelly observes that most disliked by the electronic conferees are floored division dumb tick smart tick new LEAVE Forth 83 Forth 79 the small wordset and new actions associated with old word names He contrasts those with the things conferees have said they like floored division dumb tick smart tick new LEAVE Forth 83 Forth 79 and the small wordset Regarding FORTH Inc s part in the history of Forth standardization Kelly says FORTH Inc was force fully involved in the standards efforts They hosted the 1977 and 1978 meetings and had three or four participants at every standards meeting FORTH Inc has tended to track the various stan dards and because Forth is still evolving the standards have also tended to track the work at FORTH Inc The following quote from a May 1978 FORTH Inc bulletin entitled FORTH 77 Im plementation on FORTH Inc Systems may be of interest We feel that the adoption of stan dards is an extremely important step in the growing acceptance of Forth so long a
20. APPLE listings for kernel Vol 3 Floating Point and Quad Precision Math with source code by Koopman Vol 4 Expert System with source code by Park Vol 5 File Management System with interrupt security by Moreton Vol 6 Expert Tutorial for Volume 4 by M amp L Derick Vol 7 FORTH GUIDE to MVP FORTH by Haydon Vol 8 MVP FORTH PADS IBM Manual by Wempe Vol 9 Work Kaic Manual by Wempe 25 20 25 15 25 15 20 50 30 MVP FORTH Software A transportable FORTH MVP FORTH Programmer s Kit including disk documentation Volumes 1 2 amp 7 of MVP Series FORTH Applications and Starting FORTH O CP M O CP M86 O 2100 Apple O STM PC O IBM PC XT AT amp compatibles PC MS DOS O Osborne Kaypro Cl MicroDecisions O DEC Rainbow L NEC 8201 O TRS 80 100 O HP 150 Macintosh D Atari 600 800 1200 D ADAM O Amiga New PDP 11 175 MVP FORTH Enhancement Package for IBM PC XT AT Programmer s Kit ncludes full screen editor MS DOS file interface disk display and assembler operators 110 MVP FORTH Floating Point and Quad Precision Math for IBM PC XT AT Apple O Atari 600 800 1200 or O CP M 8 with Vol 3 Includes source code 75 MVP LIBFORTH for IBM PC XT AT Four disks of enhancements i e screen editor file interface math 8088 and 8087 assemblers source code 25 MVP FORTH Screen editor for IBM PC XT AT 15 MVP FORTH Floating Point and Matrix Math for O IBM PC XT
21. DELTA value If DELTA is positive a 14 negative value based on both DX and DY is used to form a new DELTA value Of course slight variations of this algorithm are needed to account for lines with slopes that are not between zero and one Screens 5 through 13 contain a complete Bresenham line drawing vocabulary for all line slopes Horizontal and vertical lines are treat ed as special cases for greater speed and simplicity The vocabulary for using this draw ing package is SET CGA MODE Places the display in graphics mode This word may be redefined or renamed as appropriate for your computer SET TEXT MODE Returns the display to an eighty column text mode This word may be redefined or renamed as appropriate for your computer PLOT POINT X Y color Plots a single point on the graphics screen This word may be redefined as appropriate for your computer Volume VIII No 6 SCREEN 10 0 BRESENHAM LINE FOR INFINITY lt SLOPE lt 1 1 DECIMAL Assume DX and DY are already set up LINE Z lt M lt 1 NEWX NEWY gt DX 2 INCR1 DX DY 2 INCR2 Pick min y DUP YNOW gt IF current cursor at min y DDROP XNOW YNOW THEN DDUP POINT Compute D INCR1 DY Stack X Y DELTA DY 0 DO DUP 0 lt IF D lt 0 Y B POINT INCR1 ELSE D gt 0 X Y B POINT INCR2 THEN LOOP DROP DDROP SCREEN 11 0 LINE FOR SLOPE INFINITY Vertical 1 DECI
22. ENHANCEMENTS eDETAILED MANUAL INEXPENSIVE UPGRADES NGS USER NEWSLETTER A COMPLETE FORTH DEVELOPMENT SYSTEM PRICES START AT 70 NEW HP 150 amp HP 110 VERSIONS AVAILABLE aa aD NEXT GENERATION SYSTEMS P O BOX 2987 SANTA CLARA CA 95055 408 241 5909 Volume VIII No 6 Letters continued from page 10 would It would be interesting to know if one exists I think it would be more likely although also doubtful that some implementation would balk on DOES gt being in a separate word for there is a question as to whether this would be strictly legal in Forth 83 the usage pattern for DOES gt in the stan dard glossary might be taken to imply that DOES gt should itself appear in the compiler word although CREATE can be replaced by a word containing CREATE Sincerely yours Victor H Yngve Chicago Illinois Antecedent Sieve Dear Marlin I was happy to see my improved version of the sieve benchmark in Forth Dimensions VI1II 4 page seven I m confused however by the label Noyes Sieve This implementation grew out of discussions between Dean Sanderson and myself in 1982 Enclosed please find a copy of page nine from Dr Dobb s Journal September 1983 in which this algorithm first appeared in print Learning and Living Don Colburn Rockville Maryland 31 PORTABLE POWER WITH MasterFORTH Whether you program a 3 on the Macintos
23. I am not including any code that will allow you to transfer data from a non DOS file to a DOS file but it is very easy to create by using the words MVP DISK and DOS DISK to switch types and then BLOCK UPDATE and FLUSH You can figure that out for yourself Possible Enhancements By reading through the DOS manual one could figure out how to use the file handle system which is simpler to use once you learn it It is possible using the newer file system indeed it can be done with the old one if more than one file control block is available to have more than one file open at a time Then data from one file could be transferred conveniently to another file But in the interest of simplicity what is presented is adequate for a lot of programming needs Another enhancement would be to display the DOS directory Conclusion This was very simple code to get working taking about two hours to accomplish It allows you to access DOS files for whatever reason you choose DOS files not created by Forth are easily inspected Just remember that block zero of any file contains the first one kbyte of the file When read ing a file less than one kbyte in length you will get a disk read error Don t worry though block zero will still contain the data and the remainder of the block will be filled with zeroes This also answers the question a lot of non Forth programmers raise Why can t Forth talk to DOS files My answer
24. Jesung 714 842 3032 San Diego Chapter Weekly Thurs 12 noon Call Guy Kelly 619 268 3100 ext 4784 Sacramento Chapter Monthly 4th Wed 7 p m 1798 59th St Room A Call Tom Ghormley 916 444 7775 FORTH Dimensions Bay Area Chapter Silicon Valley Chapter Monthly 4th Sat FORML 10 a m Fig 1 p m H P Auditorium Wolfe Rd amp Pruneridge Cupertino Call John Hall 415 532 1115 or call the FIG Hotline 408 277 0668 Stockton Chapter Call Doug Dillon 209 931 2448 e COLORADO Denver Chapter Monthly Ist Mon 7 p m Cliff King 303 693 3413 e CONNECTICUT Central Connecticut Chapter Call Charles Krajewski 203 344 9996 FLORIDA Orlando Chapter Every two weeks Wed 8 p m Call Herman B Gibson 305 855 4790 Southeast Florida Chapter Monthly Thurs p m Coconut Grove area Call John Forsberg 305 252 0108 Tampa Bay Chapter Monthly Ist Wed p m Call Terry McNay 813 725 1245 e GEORGIA Atlanta Chapter Monthly 3rd Tues 6 30 p m Computone Cotilion Road Call Nick Hennenfent 404 393 3010 e ILLINOIS Cache Forth Chapter Call Clyde W Phillips Jr Oak Park 312 386 3147 Central Illinois Chapter Urbana Call Sidney Bowhill 217 333 4150 Fox Valley Chapter Call Samuel J Cook 312 879 3242 Rockwell Chicago Chapter Call Gerard Kusiolek 312 885 8092 e INDIANA Central Indiana Chapter Monthly 3rd Sat 10 a m Call John Oglesby 317 353 3929 Fort Wayne Chapter M
25. MasterFORTH ORDERING INFORMATION 701 A FORTH LIST HANDLER V 1 by Martin J Tracy Forth is extended with list primitives to provide a flexible high speed environment for artificial intelligence ELISA and Winston amp Horn s micro LISP are included as ex amples Documentation is included on the disk 702 A FORTH SPREADSHEET V 2 40 43 45 by Craig A Lindley This model spreadsheet first appeared in Forth Dimensions Volume 7 Issue 1 and 2 These issues contain the documentation for this disk 703 AUTOMATIC STRUCTURE CHARTS V 3 40 43 45 by Kim R Harris These tools for the analysis of large Forth programs were first presented at the 1985 FORML conference Program docu mentation is contained in the 1985 FORML Proceedings 704 A SIMPLE INFERENCE ENGINE V 4 40 43 45 N by Martin J Tracy E Based on the Inference Engine in Winston amp Horns book of W Lisp this volume takes you from pattern variables to a complete unification algorithm Accompanied throughout with a running commentary on Forth philosophy and style 706 THE MATH BOX V 6 40 43 45 N by Nathaniel Grossman E A collection of mathematical routines by the foremost W author on math in Forth Extended double precision arith metic a complete 32 bit fixed point math package and auto ranging text graphics are included There are utilities for rapid polynomial evaluation continued fractions and Monte Carlo factorization 40 43 45 Please specify disk
26. Other systems and dialects ilable LMI PC FORTH 3 0 PR eta ee MasterEORTH 1 0 Available from Bok ee PolyFORTH li ISD 4 San Jose CA 95155 408 277 0668 Forth Model Library Volume 6 TH E MATH BOX by Nathaniel Grossman Forth 83 for the IBM PC DOS 2 0 Not copy protected proceeds go to expand Laxen Perry F83 the library Other systems and dialects ilable LMI PC FORTH 3 0 PPE MasterFORTH 1 0 Available from a Rp PolyFORTH II ISD 4 San Jose CA 95155 408 277 0668 TWO NEW ADDITIONS TO THE FORTH MODEL LIBRARY FORTH FORTH INTEREST INTEREST FROM THE FORTH INTEREST GROUP BULK RATE FORTH INTEREST GROUP US POSTAGE P O Box 8231 ek a San Jose CA 95155 San Jose CA Address Correction Requested
27. THEN DROP DDUP POINT Compute D INCR1 DY Stack X Y DELTA i DY 0 DO DUP 0 lt For a generalized line drawing word IF 0 Y B POINT INCR1 with a slope between zero and one D lt igana bab rE Osh eh BZFOLNI INCRA R e ATHEN meaning that the X distance of the line DROP DDROP is greater than the Y distance and that both distances are drawn from smaller to larger numbers we would have SCREEN 9 GENERAL LINE Xi Y1 X2 Y2 0 BRESENHAM LINE FOR 1 lt SLOPE lt 0 1 DECIMAL Assume DX and DY are already set up SWAP Pe SWAP LINE 1 lt M lt 0 NEWX NEWY gt 3 PICK gt R gt R_ 100 R gt R gt DY 2 INCR1 DY DX 2 INCR2 Pick min x OVER XNOW gt 100 3 PICK SWAP T4 lt 0 IF current cursor at min x DDROP XNOW YNOW THEN DO 3 PICK 3PICK 100 POINT DDUP POINT SWAP OVER Compute D INCR1 DX Stack X Y DELTA p DX 0 DO DUP 0 lt ROT 1 SWAP ROT LOOP IF D lt 0 X B POINT INCRI ELSE D gt 0 X Y B POINT INCR2 THEN DROP 100 POINT LOOP DROP DDROP The above word takes two X Y co ordinate pairs as an input and scales all Y values by 100 to allow for non integer increments of Y While this line drawing algorithm is conceptually straightfor Volume VIII No 6 13 FORTH Dimensions ASK FORTH ENGINEERING ABOUT REAL TIME THAT S ON TIME Find Out How To Implement Real Time Systems In e Digital Signal Processing
28. amp Process Control 25 28 35 Machine independence project management data struc tures mathematics and working group reports 323 ROCHESTER 1983 Forth Applications 25 28 35 Forth in robotics graphics high speed data acquisition real time problems file management Forth like languages new techniques for implementing Forth and working group reports 324 ROCHESTER 1984 Forth Applications 25 28 35 Forth in image analysis operating systems Forth chips functional programming real time applications cross compilation multi tasking new techniques and working group reports 325 ROCHESTER 1985 Software Management amp Engineering 20 21 30 Improving software productivity using Forth in a space shuttle experiment automation of an airport development of MAGIC L and a Forth based business applications language includes working group reports THE JOURNAL OF FORTH APPLICATION amp RESEARCH A refereed technical journal published by the Institute for Applied Forth Research Inc 401 JOURNAL OF FORTH RESEARCH V 1 Robotics Data Structures 30 33 38 403 JOURNAL OF FORTH RESEARCH V 2 1 Forth Machines 0 15 16 18 404 JOURNAL OF FORTH RESEARCH V 2 2 Real Time Systems 15 16 18 405 JOURNAL OF FORTH RESEARCH V 2 3 Enhancing Forth aaa aaa aaa 15 16 18 406 JOURNAL OF FORTH RESEARCH V 2 4 Extended Addressing 15 1 6 18 407 J
29. are 2 x a VAX780 10 x an IBM PC Mr Yngve replies Thanks to Mitch Bradley for raising some interesting points and for notic ing that a can be factored out thus shortening the definition The improv ed version is given on screen 70 We call it a bug when a program does not do what we expect it to We can fix it by changing the program or by changing our expectations We could say that SYNONYM is restricted to not directly redefining a word by the same name using instead the pattern SYNONYM FOO A SYNONYM A FOO Or we could use a colon definition if there are problems with vocabularies This change in expectations is reflected in the new glossary entry on screen 71 It retains the advantage that SYNONYM is still defined completely within the Forth 83 Standard so it will work without change on any standard sys tem It has the disadvantage that SYNONYM is not completely general purpose To make it completely general one would not only have to include the rele vant version of HIDE REVEAL or SMUDGE but also implementation spe cific code such as CURRENT CONTEXT to change the search order and per haps other non standard code as well This would have the disadvantage of making SYNONYM difficult to install on a different standard system or to trans port a program containing it to a dif ferent system Nevertheless this was the option taken in MACRO END MACRO FD VII 3 so as to make it similar to
30. as fast as other full memory Forths with near assembly language performance when optimized Not even because it gives MANY more functions per byte than any other Forth Not be cause you can run all DOS com mands plus COM and EXE programs from within HS FORTH Not be cause you can single step trace de compile amp dissassemble Not for the complete syntax checking 8086 8087 80186 assembler amp optimizer Nor for the fast 9 digit software float ing point or lightning 18 digit 8087 math pack Not for the half mega byte LINEAR address space for quick access arrays Not for com plete music sound effects amp graph ics support Nor the efficient string functions Not for unrivaled disk flex ibility including traditional Forth screens sectored or in files or free format files all with full screen edi tors Not even because I O is as easy but far more powerful than even Basic Just redirect the charac ter input and or output stream any where display keyboard printer or com port file or even a memory buffer You could even transfer con trol of your entire computer to a terminal thousands of miles away with a simple gt COM lt COM pair Even though a few of these reasons might be sufficient the real reason is that we don t avoid the objections to Forth WE ELIMINATE THEM Public domain products may be cheap but your time isn t Don t shortchange yourself Use the best Use it now HS FORTH co
31. encountered and demonstrates the methods used to overcome them Subroutine Threading by Robert _Illyes This paper compares and con trasts subroutine threaded implementa tion strategies for a traditional archi tecture ISYS FORTH on the Apple 11 with implementation strategies for a Forth specific architecture CmFORTH by Charles Moore for the Novix NC4000 Issues discussed include branch termination macro generation and the problem of portability Don Colburn Standards Session David Harralson presented Exten ded Forth Control Structures in which he details a set of operators for generalizing flow of control an inter esting contrast to Wil Baden s papers from the previous session Stephen Pelc suggested changes in number input conversion and vocabulary switching based on his experience as a vendor Joel Petersen gave some thoughts on experience circumventing his the Volume VIII No 6 Forth 79 and Forth 83 Standards to work with the twenty bit Nicolet 1280 Don Colburn stressed that future standards should be independent of stack width and recommended that text files and local variables be considered Guy Kelley reported that the Forth Standards Team was not currently active and had no present plans of becoming active Martin Tracy summarized the progress of an ANSI Forth standardization effort Martin Tracy Working Groups Forth Engines Conversation cen tered ar
32. file 13H set disk transfer address 1AH set default drive OEH read random record 21H write random record 22H The code should be self explanatory and is shown in the accompanying screens One word of caution since the parsing word is quite simple one must use a period after the filename I also use an extension One could en hance this operation if one wanted to spend the time at it If a file has no extension don t worry I fill the FCB with blanks which are okay Anyway I usually type something like OPEN FORTHXX SCR In the newest versions of Forth the block sizes are one kbyte I therefore set the record size to one kbyte when I open the file This is done by storing 400H in the file control block starting at offset OEH Since the word R W in Forth requires address b f for input parameters I use the address for setting the transfer address The block number is then put in the relative record number position in the file control block offset 21H and then either random read or ran dom write is called depending on the flag Any disk I O error is trapped and a message is displayed Use this system as follows OPEN FORTHXX SCR opens a new file FORTHXX SCR 99 BUFFER DROP UPDATE FLUSH write dummy data to disk Now you have created a DOS file of 100 kbytes size Use the familiar words BLOCK BUFFER LIST LOAD INDEX etc and they will work as usual Volume VHI No 6 19 FORTH Dimensions
33. of my toolkit There is a subtle bug in the published implementation Fortunately the bug is easy to fix Suppose you have a word FOO in for example the ASSEMBLER vocabulary You wish to use SYNONYM to make that word also appear in the FORTH vocabulary So you try the code in Figure One and BOOM the sys tem crashes What happened Well the name FOO is now a synonym for itself Screen 70 0 Usage SYNONYM lt new name gt lt old name gt 1 SYNONYM CREATE 32 WORD FIND DUP IF SWAP IMMEDIATE T IF DOES gt EXECUTE ELSE DOES gt STATE IF gt ELSE EXECUTE THEN THEN ELSE 1 ABORT not found THEN Screen 71 O SYNONYM Glossary entry SYNONYM not a synonym for the word named Foo in the ASSEMBLER vocabulary The solution is the same as the solu tion used for preventing recursion when redefining a colon definition HIDE the word just after the CREATE and REVEAL it after FIND systems other than F83 probably need SMUDGE SMUDGE rather than HIDE REVEAL l also have a minor implementation quibble The sequence shown in Figure Two is unstructured in the sense that the child word effectively jumps into the middle of the SYNONYM word at EXECUTE and then depends on the ELSE in the SYNONYM word to keep it from executing the rest of the definition after the EXECUTE This could cause problems in some implementations Figure Three shows a structured version including the HIDE
34. to them is It can and here is the code Then I ask them about trying to convert DOS created files to non DOS format That usually stumps them SCR e eK SVONKOU SWRA ree wh no o as VONMMPaMe sD i ee We S 13 s a ao ow n p WONOUW FHM Ss 39 HEX NEW DOS FUNCTIONS FOR DISK I 2VAPRBECGW VARIABLE FCB 2E ALLOT HOLDS FILE CONTROL BLOCK GFNAME ADDR GETS THE FILE NAME FROM INPUT STREAM DUP gt R 30 ERASE CLEARS THE WHOLE FCB TO ZERO Re i B BLANK SETS THE NAME FIELD TO BLANKS 2E WORD COUNT 8 MIN RE 1 SWAP CMOVE GETS THE FILENAME BL WORD COUNT 3 MIN R 9 SWAP CMOVE EXT MUST USE A PERIOD AFTER FILENAME BUT NO EXT IS REQUIRED DEL t DEL filename PAD GFNAME 13 PAD SYSCALL FF AND ABORT file not found 5 53 HEX NEW DOS 1 0 2BAPREECEW OPEN gt OPEN filename FCB GFNAME F FCB SYSCALL OFF AND TRIES TO OPEN THE FILE IF new file 16 FCB SYSCALL FF AND CREATES NEW FILE IF NEEDED ABORT error apening file THEN 400 FCB BE 3 SETS THE RECORD SIZE TO 1K CLOSE dont need filename here 12 FCB SYSCALL OFF AND ABORT errar closing file 3 54 HEX NEW DOS I O 18APRBECGW AE E SYSCALL DROP SELECT DRIVE A FOR DEFAULT B E 1 SYSCALL DROP SELECT DRIVE B FOR DEFAULT DOSR W ADDR BH f REPLACES R W IN MVP SWAP FCB 21 SETS RAMDOM RECORD NUMBER 1A ROT SYSCALL DROP SETS TRANS
35. 0 BDOS DROP CR DUP SPAN ROT SWAP MOVE Van Duinen Figure One AX AX SUB AX DS MOV 140 BX MOV 256 AX MOV AX 0 BX MOV cS AX MOV Set Brkpt to AK 2 BX MOV restart pgm Van Duinen Figure Two ASSEMBLER DEFINITIONS FOO HERE ALSO FORTH DEFINITIONS SYNONYM FOO FOO FOO A boring example Bradley Figure One IF DOES gt EXECUTE ELSE DOES gt STATE If Bradley Figure Two DO IMMED DOES gt EXECUTE DOES gt STATE DO COMP IFE 3 ELSE EXECUTE THEN SYNONYM CREATE HIDE BL WORD FIND DUP REVEAL IF SWAP Cam IMMEDIATE 1 IF DO EXEC ELSE DO COMP THEN ELSE 1 ABORT not found THEN for an immediate synonym for a non immediate synonym new name old word make header for new word old word found yes compile its cfa make new word immediate was old word immediate yes set new to execute no set new to check state old word not found Bradley Figure Three Volume VIII No 6 Those last four lines only if you are using a full screen editor such as one of these Frans Van Duinen Toronto Ontario An Alias for Synonyms Dear Marlin The synonym technique described by Victor Yngve FD VII 3 is very useful I have been using the same technique albeit under a different name I called it ALIAS for about two years and find it to be an important part
36. AT with 8087 or Apple with Applesoft 100 MVP FORTH Graphics Extension for C IBM PC XT AT or D Apple 80 MVP FORTH Programming Aids for O CP M C IBM or O APPLE Programmer s Kit Extremely useful tool for decompiling callfinding translating and debugging 200 MVP FORTH Cross Compiler for CP M Programmer s Kit Generates headerless code for ROM or target CPU 300 MVP FORTH Meta Compiler for CP M Programmer s kit Use for applications on CP M based computer with public domain source 150 MVP FORTH PADS Professional Application Development System for IBM PC XT AT or Apple Il II or lle An integrated system for customizing your FORTH programs and applications The editor includes a bi directional string search and is a word processor specially designed for fast development PADS has almost triple the compile speed of most FORTH s and provides fast debugging techniques Minimum size target systems are easy with or without heads Virtual overlays can be compiled in object code PADS is a true professional development system Specify Computer I IBM C Apple 500 MVP FORTH MS DOS file interface for IBM PC PADS 80 MVP FORTH Floating Poin
37. ERNEL86 BLK This now allows the use of the DOS editing keys to edit the string last enter ed It also allows the use of the Super key command stack to play back any of a number of recent entries Super key from Borland Int Software is a memory resident keyboard enhan cer program that allows pre defined key sequences etc It also keeps track of the last twenty or so entries keyed in on the command line for DOS and DEBUG Now about those side effects The original EXPECT uses a transla tion table CC FORTH to handle various control characters That will no longer work with this version of EXPECT The definitions of screens 47 48 of KERNEL86 BLK are used only through EXPECT They do not function with this new definition of EXPECT and are no longer required If you do bypass e Provides Complete Programming Tools Primitives for Dynamic Memory Support Produces Native Code Very Fast Complete Access to MS DOS Files 8087 Floating Point Support Provides Range Checking Graphics Includes Fifth Source Files Inline 8086 8087 Assembler them also disable the references in screens 91 line 9 and screen 92 line 3 Primarily affected are control C reset control P toggle printer and control X delete line Also affected is the handling of CR To accept control C add the two lines in Figure Two lifted from Wil Baden s F83X between the existing lines 4 and 5 of the unnamed cold sta
38. FER ADDRESS IF 1 FCB SYSCALL OFF AND RAMDOM READ DISK RECORD ABORT disk read error ELSE 22 FCB SYSCALL OFF AND ABORT disk write error THEN RANDOM WRITE DISK RECORD Screens continue on page 25 FORTH Dimensions 20 Volume VIII No 6 FORTH INTEREST GROUP MAIL ORDER FORM P O Box 8231 San Jose CA 95155 408 277 0668 MEMBERSHIP IN THE FORTH INTEREST GROUP 109 MEMBERSHIP in the FORTH INTEREST GROUP amp Volume 9 of FORTH DIMENSIONS No sales tax or handling fee See the back page of this order form is 30 00 per year for USA Canada amp Mexico all other countries 42 00 per year The annual membership dues are based on the membership The Forth Interest Group is a worldwide non profit member year which runs from May 1 to April 30 supported organization with over 4 000 members and 90 chap ters FIG membership includes a subscription to the bi monthly publication FORTH Dimensions FIG also offers its members group health and life insurance an on line data base a large selection of Forth literature and many other services Cost is When you join you will receive issues that have already been circulated for the current volume of Forth Dimensions and subsequent issues will be mailed to you as they are published You will also receive a membership card and number HOW TO USE THIS FORM 1 Each item you wish to order lists three different Price categories Column 1 USA Canada Me
39. MAL Assume DX and DY are already set up LINEZ NEWX NEWY gt Pick min y DUP YNOW gt IF current cursor at min y DDROP XNOW YNOW THEN DDUP POINT 0 dummy DELTA value DY 0 DO Y B POINT LOOP DROP DDROP SCREEN 12 0 LINE FOR SLOPE 0 Horizontal 1 DECIMAL Assume DX and DY are already set up LINEO NEWX NEWY gt Pick min x OVER XNOW gt IF current cursor at min x DDROP XNOW YNOW THEN DDUP POINT 0 dummy DELTA value DX 0 DO X B POINT LOOP DROP DDROP SCREEN 13 0 BRESENHAM PROLOGUE amp CALLING ROUTINE 1 DECIMAL LINE XNEW YNEW gt DDUP Extra copy used for final MOVE CURSOR OVER XNOW DUP ABS DX OVER YNOW DUP ABS DY XOR 0 lt Determine if signs are different DY IF DX IF Not horizontal or vertical IF Negative slope DX DY gt IF LINE 1 lt M lt 0 ELSE LINE Z lt M lt 1 THEN ELSE Positive slope DX DY gt IF LINEO lt M lt 1 ELSE LINE1 lt M lt Z THEN THEN ELSE Vertical DROP LINEZ THEN ELSE Horizontal DROP LINEO THEN MOVE CURSOR 3 PESIS Ss n annas RAS secre Ea Matata ataa T ae BRYTE FORTH por the INTEL 8031 MICRO CONTROLLER FEATURES FORTH 79 Standard Sub Set Access to 8031 features Supports FORTH and machine code interrupt handlers System timekeeping maintains time and date with leap year correction Supports ROM based self starting applicati
40. NESTORE POEMS STOCK LINES POEM CHARS LINE amp LINESTORE SCRE Find start of any line of any poea in buffer NG 04 03 86 0 Random integer generator NG 04 03 86 0 Make an initialize a buffer for all the lines NB 04 03 86 0 Move line from master list to buffer print it SERE 2 NG 03 22 86 1 following Anderson and Tracy s Mastering Forth 2 3 FLIP 4 5 amp VARIABLE SEED store an integer to initialize RAND 7 The word TIME is contained in MicroMotion Forth 83 IBM ver 8 The next line is an implesentation dependent selt seeding 9 TIME d froe DOS DROP SEED new seed for each booting 10 nl n2 interchanges bytes of ni to fora n2 SPLIT SWAP COMBINE new random integer 12 SEED 5421 1 OUP SEED 13 14 RANDON n random integer between O and n 1 inclusive 15 RAND FLIP SWAP MOD SCRE 4 NB 04 03 86 1 2 sake a byte array long enough to hold all the chars of all the 3 lines of all the poeas 4 5 CREATE LINESTORE LINESTORE ALLOT amp 7 blank it out 8 9 LINESTORE 10 Mt 12 13 14 15 LINESTORE BLANK SCRE b NG 04 03 86 i BYTE OFF ni n2 addr addr addr ni n2 23 tS addr count ni n2 Coapute starting address of nist line in n2nd poes 3 take string addr count from stack and aove its contents given starting address of the buffer of lines 4 to the nist line and n2nd poes positi
41. No 6 33 FORTH Dimensions State of the Standard Marlin Ouverson La Honda California Forth standards have arisen throughout the history of the language from self governing committees com prised of expert users of Forth Par ticipation was open and becoming a voting member was a matter of meeting minimal requirements Coming from different backgrounds these experts often had deeply vested opinions about what should and should not be part of a common Forth kernel about how those functions would operate and what their names would be and about standardization itself The Forth Stan dards Team FST has been the arena in which these elements converge and at times diverge The team has had a benign relationship with the Forth In terest Group but operates indepen dently And while it has been the sub ject of harsh criticism it has also received a great deal of praise What have been the rough spots One easy target is the malleability that permits Forth to become what each programmer or developer needs or wants it to be More generality and less bulk seem to be called for in a Forth standard than in languages frozen at the moment of creation Forth systems grow with their users and those users may resent being told that the programs they develop are non standard And creating new Forth standards brings the added wrath of both vendors and users if it creates incompatibilities with previously stan dard system
42. OURNAL OF FORTH RESEARCH V 3 1 Forth based laboratory systems and data structures FE he a E en den tote ata aoe 15 16 18 409 JOURNAL OF FORTH RESEARCH V 3 3 ee atts tinted ano ie re 15 1 6 18 410 JOURNAL OF FORTH RESEARCH V 3 4 ek 15 16 18 FORTH Dimensions Volume VII No 6 ee _ DR DOBB S JOURNAL This magazine produces an annual special Forth issue which includes source code listing for various Forth applications 422 DR DOBB S 9 82 0 0 5 6 7 423 DR DOBB S 9 83 5 6 7 424 DR DOBB S 9 84 5 6 7 425 DR DOBB S 10 85 5 6 7 426 DR DOBB S 7 86 5 6 7 HISTORICAL DOCUMENTS 501 KITT PEAK PRIMER 25 27 35 One of the first institutional books on Forth Of historical interest 502 Fig FORTH INSTALLATION MANUAL 15 16 18 Glossary model editor We recommend you purchase this manual when purchasing the source code listing 503 USING FORTH 20 21 22 FORTH Inc SS a REFERENCE 305 FORTH 83 STANDARD 1516N8_ The autoritative description of 83 Standard Forth For reference not instruction 300 FORTH 79 STANDARD 15N6N8_ The authoritative description of 79 Standard Forth Of historical interest e MMMM REPRINTS 420 BYTE REPRINTS 5 6 77 Eleven Forth articles and letters to the editor that have appeared in Byte Magazine ASSEMBLY LANGUAGE SOURCE CODE LISTINGS Assemb
43. Si 8726 S Sepulveda BI A171 Los Angeles CA 90045 FORTH Dimensions Inverse Video and TI FORTH Richard Minutillo Roslindale Massachusetts I had always thought of inverse video as something other computers could do but my TI 99 4A could not When I obtained TI s Microsoft Multiplan and saw that program s use of inverse video I realized the obvious while TI s built in video firmware cannot provide an inverse image software can be written to do the trick TI FORTH makes the trick easy One approach to writing an inverse video routine makes use of an internal memory map which leaves all 256 ASCII characters available for definition and display This is the approach taken by Multiplan and there is plenty of room in that configuration to define a whole alternative set of inverted characters between characters 128 and 256 Since the VDP processor thinks of the screen image as a long array of single byte values it is an easy trick to just find the values which define the section of the screen you want to invert and then add the 128 offset to each byte to obtain the inverted characters Unfortunately there are several draw backs to that approach First you have to store the ninety five inverted charac ter definitions in your TI FORTH routine and that s a lot of wasted space Second you have very few characters available for graphics if you want them Finally it is extremely inelegant A relatively compa
44. TILITIES DATABASE WORD PROCESSOR AND COMMUNICATIONS SOFTWARE Nearly all MMSFORTH software includes source code All the sofia your computer may ever need The total software environment m IBM PC XT TRS 80 Modol 1 3 4 and close friends Personal License required MMSFORTH V2 4 System Dick 179 96 TAS 40 Moda 1 requires loweronce DOEN 1 aD eck va Personal License jaca modi FORTHCOM communications module FORTHWRITE word processor Corporate Site License Extensions Bulk Distribution Some recommended Forth books FORTH A TEXT amp REF best text k your dealer to show you the world of MUS ORTH of request our tree brochure MILLER MICROCOMPUTER SERVICES 61 Lake Shore Road Natick MA 01760 1617 653 8138 FORTH Dimensions sriinghending A we No returns on software That is make sure LIT D EXPBUF 1 COUNT C For those who haven t done this before recompile your Forth system using the following steps Make sure the files listed below as well as those included through screen 1 of EXTEND86 BLK are on the disk s you re using After editing the source screens of KERNEL86 BLK type the following lines in turn OPEN META86 BLK 1 LOAD BYE KERNEL EXTEND86 BLK OK BYE F83 PDE BLK or FSED BLK Or VED BLK etc 1 LOAD SAVE SYSTEM F COM VARIABLE EXPBUF 128 allot tot len 130 EXPECT S addr EXPBUF C EXPBUF EXPBUF 1 COUNT len gt 1
45. ct and much more elegant solution can be written in TI FORTH I found it so valuable that I added it to my personalized BSAVEd kernel so it can be available for all my applications as I write them Here s an outline of the task 1 Define the screen segment to be inverted by position and length 2 Read the defined segment of the screen image byte array into a charac ter buffer 3 Read the eight byte character defini tions of each character to be inverted into a pattern buffer 4 Invert the pattern buffer 5 Write the inverted patterns consecu tively into VDP memory to redefine a Volume VIII No 6 FORTH Dimensions WRDNTDUPRWNH SO WRN ADU ARWNHPRO WONAUWAWNPO 68 inverse video FORTH translation from assembly language stack row col len VARIABLE CARBUF 39 ALLOT VARIABLE INVBUF 319 ALLOT VARIABLE LOC O VARIABLE LEN VARS LEN SCRN_WIDTH LOC 3 READSCR LOC CARBUF LEN VMBR 69 invert screen 2 READCHAR LEN O DO CARBUF I C 8 2048 INVBUF I 8 8 VMBR LOOP INVERTBUF INVBUF 319 INVBUF DO I MINUS 1 I 2 LOOP PATTTOVDP INVBUF 3072 320 VNBV 70 invert screen 3 WRITESC LEN O DO I 128 Loc I VSBW LOOP RGM 090584 BASE gt R DECIMAL character buffer pattern buffer gt variables sets variables screen address in vdp buffer address length to read read section to invert
46. d The fact that any ANSI standard could simply define a minimal least common de nominator of current Forth systems seemed cause for some optimism Impromptu Talks Kim Harris reviewed theories and methods for formal code inspections and structured waik throughs These are important tools for any project manager resulting in clearer under standing of a program and in clearly written and more easily maintained code Stephen Pelc spoke about treating vocabularies as objects allowing them to be referenced without affecting CURRENT or CONTEXT An audience remark suggested storing a search method in the object description Geoffrey Inett of British Telecom believes the Forth systems developed for them are truly state of the art Their one caveat is that they would like the system to look more normal They use a file based system but don t like having the file come up in screens Also having developed a product they d like to sell it but finding ap plications already done in Forth was difficult Forth has the reputation of a hacker s language and needs a profes sional image Suggestions included a directory of applications using Forth See FD VIII 5 page 37 Ed a guide to utilities and tools available in Forth independent verification of Forth standard adherence for cus tomers who want that assurance and outreach efforts that go beyond the Forth community Marlin Ouverson Ind
47. d Dr Grenier Field Manchester Call M Peschke 603 774 7762 NEW MEXICO Albuquerque Chapter Monthly Ist Thurs 7 30 p m Physics amp Astronomy Bldg Univ of New Mexico Jon Bryan Call 505 298 3292 NEW YORK FIG New York Monthly 2nd Wed 7 45 p m Manhattan Call Ron Martinez 212 749 9468 Rochester Chapter Bi Monthly 4th Sat 2 p m Hutchinson Hall Univ of Rochester Call Thea Martin 716 235 0168 Syracuse Chapter Monthly 3rd Wed 7 p m Call Henry J Fay 315 446 4600 OHIO Akron Chapter Call Thomas Franks 216 336 3167 Athens Chapter Call Isreal Urieli 614 594 3731 Cleveland Chapter Call Gary Bergstrom 216 247 2492 Cincinatti Chapter Call Douglas Bennett 513 831 0142 Dayton Chapter Twice monthly 2nd Tues amp 4th Wed 6 30 p m CFC 11 W Monument Ave Suite 612 Volume VIII No 6 Dayton OH Call Gary M Granger 513 849 1483 e OKLAHOMA Central Oklahoma Chapter Monthly 3rd Wed 7 30 p m Health Tech Bldg OSU Tech Call Larry Somers 2410 N W 49th Oklahoma City OK 73112 OREGON Greater Oregon Chapter Monthly 2nd Sat 1 p m Tektronix Industrial Park Bldg 50 Beaverton Call Tom Almy 503 692 2811 PENNSYLVANIA Philadelphia Chapter Monthly 4th Sat 10 a m Drexel University Stratton Hall Call Melanie Hoag or Simon Edkins 215 895 2628 TENNESSEE East Tennessee Chapter Monthly 2nd Tue 7 30 p m Sci Appl Int l Cor
48. dress is Forth Interest Group P O Box 8231 San Jose California 95155 Administrative offices and advertising sales 408 277 0668 Symbol Table Simple introductory tu torials and simple appli cations of Forth Intermediate articles and code for more com plex applications and tutorials on generally dif ficult topics Advanced requiring stu dy and a thorough under standing of Forth i i l Code and examples con form to Forth 83 stand ard Code and examples con form to Forth 79 stand ard Code and examples con form to fig FORTH Deals with new propos als and modifications to standard Forth sys tems Volume VIII No 6 Dimensions FEATURES 32 34 38 40 The Bresenham Line Drawing Algorithm by Phil Koopman Jr The ability to draw a straight line graphically is not included in some Forth im plementations nor is it to be found in many ROM support programs This method requires only sixteen bit integers with addition subtraction and multi plication by two This feature will permit you to implement next issue s fractal routines Unsigned Division Code Routines by Robert L Smith Division routines in code may be needed to overcome limits placed on precision by hardware manufacturers or by a Forth implementation The most fundamen tal is unsigned with a numerator of twice the precision of the denominator and the result yields both quotient and remainder I
49. e Bay 02 524 7490 BELGIUM Belgium Chapter Monthly 4th Wed 20 00h Contact Luk Van Loock Lariksdreff 20 2120 Schoten 03 658 6343 Southern Belgium FIG Chapter Contact Jean Marc Bertinchamps Rue N Monnom 2 B 6290 Nalinnes Belgium 071 213858 e CANADA Alberta Chapter Call Tony Van Muyden 403 962 2203 Nova Scotia Chapter Contact Howard Harawitz 227 Ridge Valley Rd Halifax Nova Scotia B3P2E5 902 477 3665 Southern Ontario Chapter Quarterly Ist Sat 2 p m General Sciences Bidg Rm 312 McMaster University Contact Dr N Solntseff Unit for Computer Science McMaster University Hamilton Ontario L8S4K1 416 525 9140 ext 3443 Toronto FIG Chapter Contact John Clark Smith P O Box 230 Station H Toronto ON M4C5J2 e COLOMBIA Colombia Chapter Contact Luis Javier Parra B Aptdo Aereo 100394 Bogota 214 0345 e ENGLAND Forth Interest Group U K Monthly Ist Thurs Tp m Rm 408 Polytechnic of South Bank Borough Rd London D J Neale 58 Woodland Way Morden Surry SM4 4DS FRANCE French Language Chapter Contact Jean Daniel Dodin 77 Rue du Cagire 31100 Toulouse 16 61 44 03 06 e GERMANY Hamburg FIG Chapter Monthly 4th Sat 1500h Contact Horst Gunter Lynsche Common Interface Alpha Schanzenstrasse 27 2000 Hamburg 6 e HOLLAND Holland Chapter Contact Adriaan van Roosmalen Heusden Houtsestraat 134 4817 We Breda 31 76 713104 FIG des Alpes Chapter Con
50. e Manufacturing Process Control Machine Vision e Robotics on time and under budget For The Answers To Your Questions Call Our Engineering AnswerLine Today 213 372 8493 xt 444 FORTH Inc 111 N Sepulveda Blvd Manhattan Beach CA 90266 ON TIME UNDER BUDGET FORTH Inc FORTH Dimensions Sample GODSEYE output ward it does require a lot of arith metic Even if clever scaling factors were chosen to replace most multiplies and divides with shifts and byte moves the initial division of the difference between X1 and X2 sometimes called delta X or just plain DX by the difference between Y1 and Y2 DY is unavoidable Another problem is that sixteen bit scaled integers are not big enough for use on high resolution screens In this example lines that span more than 100 pixels horizontally are improperly drawn The Bresenham Algorithm The Bresenham line drawing algo rithm requires only sixteen bit integers with addition subtraction and multi plication by two shift left to draw lines Instead of a scaled non integer Y value the algorithm shown on screen 7 uses the error accumulation term DELTA and integer X and Y values For lines with a slope between zero and one the algorithm increments the X value for each point and increments the Y value only if the DELTA value is negative If DELTA is negative a posi tive value of DY is added to form the new
51. e folks near and far 2 3 LS The tourist felt dusty and spent i 4 Ls 8 But except for catarrh 2 4 OLS Disturbed to an unknown extent 15 OLS 9 While the son of the Czar 2 5 OLS J begin compiling 1ft 3 begin compiling SCRE Ii SCRE 12 Fourth lines NE 04 06 86 0 Fifth lines NG 04 03 86 1 t begin interpreting 2 C begin interpreting 3 And a worldly wise lar 30 OLS 4 Saw the ships sail into the Solent 40 2S Cause I seoke a cigar 3 OLS 5 Met twenty birds flown in from Kent 414 LS Locking up at a star 32X85 6 Engrossed with amassing argent 428 Reeking of rose attar 33 LS 7 Beneath the entoabing ceaent 43 LS To a aournful guitar 3 41S 8 By sacred devotions repent 44 5 Running out of the jar 35 OLS 9 Held a fight with a bibulous gent 45 OLS 1 begin compiling i 13 finish in the interpreting state 14 15 el FORTH Dimensions 30 Volume VIII No 6 NGS FORTH A FAST FORTH OPTIMIZED FOR THE IBM PERSONAL COMPUTER AND MS DOS COMPATIBLES STANDARD FEATURES INCLUDE e79 STANDARD eDIRECT I O ACCESS FULL ACCESS TO MS DOS FILES AND FUNCTIONS ENVIRONMENT SAVE amp LOAD e MULTI SEGMENTED FOR LARGE APPLICATIONS EXTENDED ADDRESSING MEMORY ALLOCATION CONFIGURABLE ON LINE AUTO LOAD SCREEN BOOT e LINE amp SCREEN EDITORS DECOMPILER AND DEBUGGING AIDS 8088 ASSEMBLER GRAPHICS amp SOUND NGS
52. e part of assert NLH 12 8 86 N ASSERT i flagl from application Jo oul from CASSERTI 3 te Ne ASSERT SWAP i Applicatian flag determines action IF DROP i If flag is true then assertion is true amp C ng action is taken except ta clean up stack ELSE CR 16 MOD Separate pieces of assert literal a ASSERT Scr Line R gt R 2 H gt R CR Show the addr within the ward calling the word containing the CASSERTI calling word may be an applic word ar INTERFRET KEY ASCII C True if entry is not a E IF QUIT If not wish te C ontinue QUIT leaving THEN the stack intact for further debugging THEN i Hills Screens be true ending with a Boolean flag on i Registration Form Name Address Telephone _ ee ee es Registration fee 200 150 UR staff and IEEE Comp Society 100 full time students Vegetarian meal option Conference Services Dormitory housing 5 nights 125 Single 100 Double Non smoking roommate 5K FUN RUN Amount Enclosed Volume VIH No 6 COMPARATIVE COMPUTER ARCHITECTURES June 9 13 1987 University of Rochester The seventh Rochester Forth Conference is held in cooperation with the College of Tene aoe of the University of Rochester the IEEE Computer Society and the Institute for os ae Forth Research Inc Invited speakers will discuss NASA s Massively Parallel Processor MPP John Hopkins Advanced Physics Laboratory s use of VLSI co
53. e sure that the second length byte agrees with the length of the string For IBM PC s with 128K DOS 2 0 or better Professional Version Shareware Version Disk and Manual Shareware Version Disk System Source Code Available CLICK Software P O Box 10162 College Station TX 77840 150 00 40 00 10 00 Forth 83 to Fifth Convertor Infix Expression Compiler e A Shareware Version Fifth 2 0 is Available Lacks Some Features of Fifth 2 5 Runs Most Fifth 2 5 Programs May Be Freely Distributed ee 409 696 5432 MS DOS is a registered trademark of Microsoft Corp IBM is a rogistored trademark of International Business Machines Corp Volume Vitl No 6 FORTH Dimensions FOR TRS 80 MODELS 1 3 4 4P IBM PC XT AT amp T 6300 ETC THREE TOUGH QUESTIONS WITH ONE EASY ANSWER WHEN IS A COMPUTER LANGUAGE NOT A LANGUAGE 3 MMSFORTH includes DOS Assembler and high level commands and extraordinary utilities extends to become any other language or application is an interpreter and a compiler and is remarkably fast and compact WHICH SOFTWARE RUNS THE __ SAME DISKSINIBMPCAND TRS 80 MODEL 4 ack J MMSFORTH disks run on those and Compaq and TRS 80 Model a 3 and Tandy 1200 and TRS 80 Model 1 and AT amp T 6300 etc with your choice of formats up to 200K single sided or 400K double sided _ WHO OFFERS SOURCE CODE WITH ITS LANGUAGE U
54. ecome a common feature in many wa y Rochester Forth Conference CALL FOR PAPERS ON COMPARATIVE COMPUTER ARCHITECTURES Computer Architecture Parallel processors Geometric processors High level language engines Comparisons and benchmarks June 9 13 1987 University of Rochester Forth Technology Forth co processors Threaded Engines State machines Metacompilers Forth Applicati Laboratory Al Real time Business Papers may be presented in either platform or poster sessions Please submit a 200 word abstract by April 15 Papers should be received by May 1 and are limited to a maximum of four single spaced camera ready pages Longer papers may be presented at the Conference but should be submitted to the refereed Journal of Forth Application and Research Abstracts and papers should be sent to the Conference Chairman Lawrence P Forsley Laboratory for Laser Energetics 250 East River Road Rochester New York 14623 1299 For more information please write the Conference Coordinator Ms Lynn Hoffee at LLE or contact the Conference Chairman at 716 275 5101 Volume VIII No 6 programming languages See for ex ample ACM SIGPLAN Notices Au gust 1976 pp 36 37 An example is the assert statement in most ver sions of C I have used this Forth version for some time and have found it invaluable The rationale is as follows in writing a program with a complicated logic structure a poin
55. ent length to con serve memory Visit the MACH 2 Product Support RoundTable on GEnie Multi tasking FORTH 83 Development System MACH 2 FOR THE 99 95 MACH 2 FOR THE 0S 9 495 00 MACH 2 FOR 495 00 MACINTOSH OPERATING SYSTEM INDUSTRIAL BOARDS features full support of the Macintosh provides position independent and is 680X0 compatible provides toolbox support of the Macintalk re entrant execution and full support 68881 floating point support and speech drivers printing and floating of all OS 9 system calls Creates produces position independent point easy I O redirection and stand alone OS 9 applications Link relocatable ROM able code no creates double clickable multi FORTH to C and vice versa Includes target compilation required segment Macintosh applications debugger disassembler Motorola Includes disassembler Motorola Includes RMaker disassembler format infix 68000 assembler and format infix 68000 assembler debugger Motorola format infix 400 page manual and 350 pg manual 68000 assembler and 500 pg manual PALO ALTO SHIPPING COMPANY P O Box 7430 Menlo Park California 94026 415 854 7994 800 44FORTH VISA MC accepted CA residents include 6 5 sales tax Include shipping handling with all orders US 6 Canada 8 Europe 25 Asia 30 RoundTable and GEnie are registered trademarks of the General Electric Information Services Company Volume VIII
56. ent workstation The PC4000 is a PC plug in card with the Novix NC4000P Forth engine on board to add speed 512K memory and concurrent processing power to your PC or 100 compatible The PC4000 runs cmForth SCForth and Delta C PolyFORTH a registered trademark of Forth Inc coming soon DELTA BOARD 495 The Delta Board is a single board stand alone computer using the Novix NC4000P Forth engine to execute high level Forth instructions without compilation It brings minicomputer performance to industrial control and other tasks using embedded processors Operates at least 10 times faster than the 68000 based systems Memory board mother board power supply cable and enclosure available for expansion The Delta Board runs cmForth SCForth and Delta C The PC4000 and Delta Board come fully assembled and tested with 4 MHz operation 90 day warranty PCX or DCX with the Delta Board Communication Software in F83 User Manual cmForth with editor and demo programs and user support with Silicon Composers Bulletin Board SILICON COMPOSERS 210 California Avenue Suite I Palo Alto CA 94306 E 415 322 8763 una n SILICON COMPOSERS Formerly SOFTWARE COMPOSERS Volume VIII No 6 17 FORTH Dimensions Unsigned Division Code Routines Robert L Smith Palo Alto California Occasionally you may find it neces sary to write division routines in code This may occur because you are using a wider precision than is supplied by t
57. ered The last character could be either a blank or a null and they are both less for screens in upper case Various machines take liberties with their codes for lower case letters and this can cause problems For instance while I can get the right CRC value for Suralis and Brodie s origina screen 129 on my Amiga I cannot for their screen 130 which is lower case text VERIFY takes a screen number off the stack and places the checksum for that screen there VER displays the checksum of the last screen listed Note that the checksum is treat ed as an unsigned number as Suralis and Brodie recommend gt ACCUMULATE lt OLDCRC CHAR HEWCRC gt 256 OR 8 amp DO DUF B lt IF 16386 SOR DUP i ELSE DUP THEN LOOP DISPOSE CRC ADIR HEMCRC gt COUNT gt R SWAP R gt DO OVER I C ACCUMULATE LOOP SWAP DROP BL ACCUMULATE gt MORE ADDR 3 SKIP COMMENTS DUP COUNT 2 IF DROF THEM MERIF lt SWAP CE 33 i SCREEN CHECKSUM ELK SR SIM gt R BLK lt AWD 5 DIN BEGIN MORE DUP WHILE DISPOSE REFEAT R gt SIM R2 EBLE l i VER SCR VERIFY UL 3 SCREEN 86 8 N SKIP COMMEHTS i gt CONSTAHT FALSE 1 COHSTAHT TRUE gt SKIF COMMEHTS ADDR BEGIN BL WORD DUF 2 C BL iF BUF i C DUF 4a ELSE 32 Od a A GIRS ELSE FALSE THEH THEM ELSE FALSE THEH WHILE REFERT 40 IF SURUF 41 WORD DROP TRIJE IF COOMPILE N DROP TRUE V
58. etacompiler Includes a 6 screen RAM Disk for stand alone operation 45 An all CMOS processor board utilizing the 6303 Size 3 93 x 6 75 inches Uses 11 25 volts at 12ma plus current required for options 210 280 Up to 24kb memory 2 kb to 16kb RAM 8k PROM contains Forth Battery backup of RAM with off board battery Serial port and up to 40 pins of parailet I O Processor buss available at optional header to allow expanded capability via user provided interface board Micro Computer Applications Ltd 8 Newfield Lane Newtown CT 06470 203 426 6164 Foreign orders add 5 shipping and handling Connecticut residents add sales 1ax FORTH Dimensions Well what I really want ts Well what I really want is a CMOS computer system for dedicated applications that has low enough power requirements to be solar powered if need be with WAIT and STOP modes to really cut down on power consumption when necessary It s got to have some advanced features too like a built in high level language and an operating system that can autostart my user applications without a lot of hassle It should have some built in EEPROM and some scratch pad RAM Boy for those imbedded applications it s got to have a watchdog timer system that checks for the computer operating properly and resets the system if theres a power glitch or something Let s see for I O I usually need several parallel ports
59. ex to Advertisers Bryte 15 Click Software 6 7 Computer Cowboys 39 Creative Solutions 37 Dash Find amp Associates 36 Forth Inc 14 Forth Interest Group 21 24 44 Harvard Softworks 36 Laboratory Microsystems 35 MCA 25 41 MicroMotion 31 Miller Microcomputer Services 8 Mountain View Press 11 New Micros 2 26 27 Next Generation Systems 31 Palo Alto Shipping Company 33 Software Composers 17 Talbot Microsystems 10 University of Rochester 4 5 Wayland Products 9 FORTH Dimensions U S ALABAMA Huntsville FIG Chapter Call Tom Konantz 205 881 6483 ALASKA Kodiak Area Chapter Call Horace Simmons 907 486 5049 ARIZONA Phoenix Chapter Call Dennis L Wilson 602 956 7678 Tucson Chapter Twice Monthly 2nd amp 4th Sun 2 p m Flexible Hybrid Systems 2030 E Broadway 206 Call John C Mead 602 323 9763 ARKANSAS Central Arkansas Chapter Twice Monthly 2nd Sat 2p m amp 4th Wed 7 p m Call Gary Smith 501 227 7817 CALIFORNIA Los Angeles Chapter Monthly 4th Sat 10 a m Hawthorne Public Library 12700 S Grevillea Ave Call Phillip Wasson 213 649 1428 Monterey Salinas Chapter Call Bud Devins 408 633 3253 Orange County Chapter Monthly 4th Wed 7 p m Fullerton Savings Talbert amp Brookhurst Fountain Valley Monthly Ist Wed 7 p m Mercury Savings Beach Bivd amp Eddington Hufitington Beach Call Noshir
60. h Canada and England to provide ser vices in those countries at least GEnie is the largest network in the world but consumer service to date has been re stricted to the United States It is an ticipated that using this service would greatly enhance FIG members ability to interact to discuss Forth with the world have access to files of code etc Forth Standards chaired by David Petty This working group had more agreement than anyone expected con sidering the sometimes volatile topic One issue was the ANSI standard re quest filed recently the second was that of the standard as a communica tions document The group s concen sus was that we do need a standard if for no other reason than to communi cate among ourselves There was also Continued on page 41 FORTHkit 5 Mips computer kit 400 Includes Novix NC4000 micro 160x 100mm Fk3 board Press fit sockets 2 4K PROMs Instructions Easy assembly cmFORTH listing shadows Application Notes Brodie on NC4000 You provide 6 Static RAMs 4 or 5 MHz oscillator Misc parts 250mA 5V Serial line to host Supports 8 Pin socket slots Eurocard connector Floppy printer video I O 272K on board memory Maxim RS 232 chip Inquire Chuck Moore s Computer Cowboys 410 Star Hill Road Woodside CA 94062 415 851 4362 car Volume VIII No 6 39 FORTH Dimensions Checksum More
61. h the IBM PC an Apple Il ser ies a CP M system or the Commodore 64 your s e program will run un changed on all the rest If you write for yourself MasterFORTH will protect your investment If you write forothers it will expand your marketplace Forth is interactive you have immediate feed back as you program every step of the way Forth is fast too and you can CP M use its built in as sembler to make it even faster Master FORTH s relocatable utilities and headerless code let you pack a lot more program into your memory The resident debugger lets you decom _pile breakpoint and trace your way through most programming prob lems A string package file interface and full screen editor are all standard features And the optional target com piler lets you optimize your applica tion for virtually any programming environment The package exactly matches Mas tering Forth Brady 1984 and meets all provisions of the Forth 83 Standard Ste MasterFORTH standard package Commodore 64 with graphics 100 Extensions Floating Point 0 seen 60 Graphics selected systems 60 Module relocator with utility sources 60 TAGS Target Applic Generation System MasterFORTH target compiler and relocator Publications amp Application Models Printed source listings each 35 Forth 83 International Standard
62. he machine hardware or your Forth ven dor or perhaps because you are writ ing your own Forth system Division routines seem to have a number of pitfalls and the difficulties of writing these routines are compounded by poor documentation of carry bit be havior as specified in literature from various manufacturers I consider that the most fundamental divide routine is that of the unsigned variety with the numerator having twice the precision of the denominator and in which the result yields both the quotient and the remainder In the Forth 83 Standard it would be called UM MOD Step by step division is fre quently accomplished by a series of trial subtractions and shifting The new bit shifted in at the least significant bit position may be the carry bit or its complement depending on the particu lar machine Since the carry or bor row bit is frequently poorly docu mented for the case of subtraction but almost all machines handle the carry bit the same way for addition I often find it easier to just complement the divisor before I begin the rest of the routine and just do trial additions instead of subtractions If you use subtract or compare operations but find that the carry bit is the opposite of that desired you may be able to use the carry bit produced by the computer and merely complement the quotient at the end Another pitfall of division routines is the proper handling of the most significant bit of the nume
63. he same answers if a backslash is not involved As a last glitch by the way VERIFY will not work the way it ought to on the screen containing the colon definition of back slash I m too tired to find a way around that one References 1 Suralis Klaxon and Leo Brodie Checksums for Hand Entered Source Screens Forth Dimensions IV 3 pg 15 2 Brodie Leo Thinking Forth Prentice Hall Inc Englewood Cliffs New Jersey 1984 Volume VIIL No 6 Continued from page 39 wide awareness of the fact that many self contained applications of Forth do not require in themselves adher ence to a standard Standards can however make hiring programmers and maintaining programs easier in a great many cases Establishing a good process for col lecting evaluating disseminating and collating standard related proposals before voting for them was a major concern Use of a CBBS or of GEnie was considered a possible solution but the Forth Standards Team could also issue a yearly printed collection of the proposals it has received Then a long period perhaps five years of field testing should ensue to see what gets used and liked before incorporating anything into the standard About two thirds of the entire attendance was in favor of seeing ANSI sanction the next standards effort even though it is bound to be a difficult process It was felt that Forth s survival would be enhanced by such a standar
64. hout notice Single system and or single user license agreement required on some products MOUNTAIN VIEW PRESS INC PO BOX 4656 Volume VIII No 6 MOUNTAIN VIEW CA 94040 415 961 4103 FORTH Dimensions Bresenham Line Drawing Algorithm Phil Koopman Jr North Kingstown Rhode Island The task of drawing a straight line on a graphics screen is a fundamen tal building block for most computer graphics applications Unfortunately this capability is not included in many Forth implementations and for that matter is not included in the ROM support programs for many personal computers This article will show you how to draw lines on almost any graphics display and gives complete listings in MVP FORTH The CRT Display Layout First let s establish some conven tions 1 will assume that the graphics display on your computer is addressed using X Y Cartesian coordinate pairs where X and Y are both non negative integers see Figure One The point 0 0 also called the origin is the upper left corner of the computer screen Each addressable point on the screen is called a pixel short for pic ture element The X coordinates represent columns of pixels horizontal distance from the origin and the Y coordinates represent rows of pixels vertical distance from the origin The exact number of pixels on your computer s display screen is hardware dependent However some representa tive va
65. ility of only two rhyme schemes will even tually halt proliferation Rather than write a program to dis play all 7776 limericks who would want to read all of them I decided to generate limericks at random from the store of lines the better to happen upon amusing combinations Aleatori cal composition is neither novel or disreputable Mozart for one was fond of the technique and experimented with it Naturally I wrote the program in Forth specifically in the standard dialect Forth 83 Two non standard words peculiar to the implementation I use DARK and TIME are glossed on the screens They are inessential in any event There are more robust algo rithms for generating random integers but they are hardly necessary here The program is an exercise in the manipula tion of data strings using CMOVE Reference 1 Queneau Raymond Cent mille milliards de poemes Editions Gallimard Paris 1961 An afterword Several months after writing the above paragraphs I dis covered that the Cent mille milliards de poemes had been reprinted within the last few years although as yet I have not seen a copy of the reprint What I have seen and acquired is a copy of One Hundred Million Million Poems published by Kickshaws in Paris in 1983 which is a translation by John Crombie into English of the Cent mille Crombie rendered Queneau s hexametric alexandrines into the Shake spearian pentametric sonnets fami
66. in Tracy FIG board member FORTH Inc Ms Rather wrote To date we have not heard from ANSI If and when they do form a Technical Committee for Forth it will be publicly announced according to their standard procedures and everyone who is interested and willing to make the required commit ment will be able to participate According to ANSI rules a voting member of a technical committee pays a fee of 175 to ANSI and must attend at least two out of three meetings to retain voting status The first meeting is usually held at ANSI headquarters in Washington D C Subsequent meet ings are held in various parts of the country Meetings typically occur four times a year for four or five days each The C committee has been working for five years First of all this means that ANSI has to accept the proposal And the proposal group does not intend revolu tion for the formal proposal states as the first item in the program of work Identify and evaluate common exist ing practices in the area of the Forth programming language Under the category of implementation impacts the proposal points out current incom 34 patibilities among popular Forth dia lects and says While the Forth 83 Standard has stabilized the language to a great extent it has proven too restric tive and machine dependent Assum ing the ANS Forth standard confines itself to such changes as are necessary to resolve the problems i
67. ing system that can easily autostart an internal or external user program How bout 1 2K EEPROM and 1 4K of RAM My watch dog timer and computer operating properly circuit is built in and programmable Configure me with 5 8 bit parallel ports or 3 with a 64K address and data bus I ve got two serial ports one that s async and one that s sync My 16 bit timer has three input captures and 5 output compares and is cascadable with my 8 bit pulse accumulator You want A D How bout 8 bit 8 channels ratiometric 17uS conversions with continuous conversions possible on four selected channels I ve been known to carry on a conversation with communication packages and I ve got built in EEPROM handlers How about 37 25 in singles under 20 in volume How about smaller than a postage stamp Listen you can buy the NMIX 0023 full development system for 199 Try getting a board wire wrapped for that price Hey I m available for immediate delivery 68HC11 hardware by Motorola Inc F68HC11 Max FORTH TM internal firmware by New Micros Ine NMIX and NMIT series boards by New Micros Inc NMIX 0023 199 RS232 Cable for NMIX 0023 15 i Manuals only 25 items in limited stock Volume production on F68HC11 6 15 87 So i ee ee Volume VIII No 6 27 FORTH Dimensions 7776 Limericks Nathaniel Grossman Los Angeles California In 196 Raymond Queneau writer editor critic linguistic experimenter
68. is sort of thing there is a rather fascinating method of non restoring division in which you either subtract or add depending on the result of the previous step Another point worth noting is that if you are implementing a fairly wide multiple precision using the trial subtraction method the overall speed may be improved by starting your trial subtractions at the most significant byte or word to determine whether or not you really want to do the subtraction The preliminary part of the divide routine consists of setting a counter to the number of bits of precision and negating the denominator usually by popping it off the stack and placing it in a special register or variable which I will call DEN Let us call the next item on the stack HI and below that the lower order part of the numerator which we can call Lo These two items may be popped off the stack if neces sary The remainder will be developed from HI and the quotient will be devel oped from Lo As a side comment we note that the natural result of this process is to put the quotient second on the stack with the remainder on the top The majority of Forth systems require the reverse of this necessitating a final SwaP to complete the process One could use an argument based on factoring to suggest that the proper primitive for division would leave the remainder on the top of the stack Step 1 Shift Hi and Lo left by one bit with both carry in and carr
69. l you need to do is make sure the SYNONYMS screen is loaded before you load the screens listed here The program listing is largely self documenting and straightforward Enter a row number a column number and a segment length on the stack fol lowed by the word INVERT and you get inverse video REVERT restores the original characters INVERTS uses the same primitives to repeatedly flash the inversion and requires additionally the number of flashes on the stack Use of the user variable SCRN__WIDTH to con vert row and column to screen location means the procedure will work in GRAPHICS or TEXT modes It will not work in bit mapped or multi color modes obviously Notice that extremely deep stack manipulations are avoided by the simple expedient of using the Loc and LEN variables and the word VARS to set those variables once from the initial stack The information could be passed on the stack but that would make for a much less elegant solution and for a listing far less easy to read The defini tions as presented provide no error checking and allow for a maximum of forty characters Enter inappropriate values on the stack at your own risk The original machine language version was meant to link with TI s Extended BASIC and could use only characters 128 through 143 The longer segment lengths in TI FORTH are achieved at the cost of increased memory size for the buffers One could easily modify the buffers and maximum segm
70. liar to English readers but he claims to have preserved the essence of the Queneauisms I l leave assessments of the translator s success to those fully bilingual but reading some of the as sembled poems in English with their odd and unexpected jumps in place tense and subject makes me feel a little less apologetic about my limericks and a lot more admiring of Queneau s enormous linguistic talents Returning by water from Ghent My family was drenched as they went While the son of the Czar Reeking of rose attar Held a fight with a bibulous gent Returning by water from Ghent A lover fell into the Trent All the folks near and far Reeking of rose attar Engrossed with amassing argent FORTH Dimensions 28 Volume VIII No 6 SCRE 1 Poea loader screen Randosiy generate 7776 different limericks 1 LOAD brings prograa in FORGET MARKER forgets it MARKER null action 3 FORGET MARKER to shuck 2 12 THRU Opening prospt DARK cls and hone Executing CR POEN lt return gt will coapose and print a CR limerick chosen at randos from 7776 possibilities available 11 RAND CR to you from this prograa CR CR SERE 3 Size and length variables VARIABLE POEMS STOCK 6 POEMS STOCK VARIABLE LINES POEM 3 LINES POER VARIABLE CHARS LINE 40 CHARS LINE Adjust the above three values as required by Scrs 8 VARIABLE LINESTORE af bytes to be alloted to LI
71. lues are 320 x 200 pixels 320 horizontal and 200 vertical pixels for a PC style four color color graphics adapter CGA display 640 x 200 pixels for a PC style two color CGA display and 640 x 350 pixels for a PC style sixteen color enhanced graphics adapter EGA display The mechanics of setting the graphics display mode desired and plotting a single point on the display are hardware dependent and will be left to the user to determine Screens 3 and 4 of the accompanying listing contain all the machine specific primitives for PCs and clones with compatible BIOS ROM chips They are formatted to use the public domain 8088 assembler cited These screens will obviously have to be modified for use on other machines 1 HEX SCREEN 3 PC COMPATIBLE EGA CGA AND TEXT MODES Machine specific change for your machine CODE SET CGA MODE gt Set mode and clear screen AX 0004 MOV 10 INT 320 x 200 in 3 colors NEXT JMP END CODE CODE SET CGA HIRES MODE AX 0006 MOV NEXT JMP END CODE CODE SET EGA MODE gt Set AX 0010 MOV 10 INT NEXT JMP END CODE gt 10 INT Set mode and 640 x 200 in 2 clear screen colors mode and clear screen 640 x 350 in 16 colors CODE SET TEXT MODE AX 0003 MOV NEXT JMP DECIMAL gt 10 INT END CODE 80 column text SCREEN 4 1 HEX PC COMPATIBLE POINT PLOT FOR EGA AND CGA Machine specific change for your machine
72. ly Language Source Listings of fig Forth for Specific CPUs and machines with compiler security and variable length names 514 6502 SEPT 80 15 16 18 515 6800 MAY 79 151 6 18 516 6809 JUNE 80 1SN6N8_ 517 8080 SEPT 79 15 16 18 518 8086 88 MARCH 81 S15N6 N8 519 9900 MARCH 81 15 16 18 521 APPLE II AUG 81 15 16 18 523 iBM PC MARCH 84 1568 526 PDP 11 JAN 80 15 16 18 527 VAX OCT 82 15 16 18 528 280 SEPT 82 15 16 18 a MISCELLANEOUS 601 T SHIRT SIZE Small Medium Large and Extra Large White design on a dark blue shirt 10 11 42 602 POSTER BYTE Cover 5 6 7 616 HANDY REFERENCE CARD FREE 683 FORTH 83 HANDY REFERENCE CARD FREE EE _ FORTH MODEL LIBRARY The model applications disks described below are new additions to the Forth Interest Group s library These disks are the first releases of new professionally developed Forth applications disks Prepared on 5 1 4 disks they are IBM MSDOS 2 0 and up compatible The disks are compatible with Forth 83 systems currently available from several Forth vendors Macintosh 3 1 2 disks are available for MasterFORTH systems only Forth 83 Compatibility IBM MSDOS Laxen Perry F83 LMI PC FORTH 3 0 MasterFORTH 1 0 TaskFORTH 1 0 PolyFORTH It Forth 83 Compatibility Macintosh
73. mmended reading list In the next issue of Forth Dimensions I will show you how to use these line drawing words to draw fractal based landscapes Recommended Reading Fundamentals of Interactive Computer Graphics J D Foley and A Van Dam Addison Wesley Reading MA 1982 Principles of Interactive Computer Graphics W M Newman and R F Sproull McGraw Hill New York 1979 SCREEN 14 0 BRESENHAM LINE DRAWING TEST PICTURE GODSEYE 1 DECIMAL GODSEYE SET CGA MODE Change to SET EGA MODE for the EGA etc 4 0 DO 3 I COLOR Use this line for CGA 1 0 DO 1 COLOR Use this line for CGA HIRES 16 0 DO 15 I COLOR Use this line for EGA 76 0 DO 75 I 150 OVER 2 100 MOVE CURSOR 150 OVER 25 LINE 150 OVER 2 100 LINE 150 I 100 LINE 150 OVER 2 100 LINE DROP 3 LOOP TERMINAL ABORT BREAK IN GODSEYE LOOP SET TEXT MODE 2 3 4 5 6 7 8 9 0 0 _ _ _ __ 60 20 20 60 Figure One Pixel layout on a graphics screen with example points References 1 2 Algorithm for Computer Control MVP FORTH Integer and of a Digital Plotter J E Bresen Floating Point Math P Koopman ham JBM Systems Journal Vol 4 Mountain View Press 1985 No 1 pp 25 30 1965 FORTH Dimensions 16 Volume VIII No 6 SPEED AND POWER is the name of the game HHH PC4000 995 Use the PC4000 to turn your PC into a high speed Forth developm
74. mplementation are provided Zapping the F83 Dictionary by C H Ting Most words in the FORTH vocabulary of F83 systems serve very specific system functions and are un used by most programmers Relinking such words to a hidden vocabulary results in a cleaner and leaner FORTH vocabulary that is more useful to most programmers and friendlier to new users Discussion and implementation source are provided Modular Forth Import Export and Linking by Stephen Pelc and Neil Smith Most other languages real ize benefits from isolating code into separately compiled and linked modules This paper describes a com mercially available product developed by the authors which implements a module system that permits external references and interactive linking Ad vantages found by the authors include greater productivity and tighter source control These benefits were particular ly important in large team projects Portability Sixteen to Thirty Two Bits by Stephen Sjolander and Jon Waterman This paper discusses the process of converting a well defined application from a sixteen bit specific implementation to a more general im plementation that is easily tailored for either sixteen bit or thirty two bit sys tems The source code example provid ed is a simple polyFORTH decompiler A decompiler was chosen as a worst case example in order to highlight machine dependencies The paper ad dresses the difficulties
75. mplete system 395 with FORTH A Text amp Reference by Kelly and Spies Prentice Hall and The HS FORTH Supplement by Kelly and Callahan Visa Mastercard HARVARD SOFTWORKS PO BOX 69 SPRINGBORO OH 45066 513 748 0390 FORTH Dimensions Forth Standards Team The above actions may have been prompted by dissatisfaction with the Forth 83 Standard itself with the process used by the Forth Standards Team or with the continuing unrest in some parts of the Forth community over standardization in general Vocal dissent over the latest standard seems to have found a home on the East Coast Forth Board 703 442 8695 up to 2400 baud Sysop Gerald Shifrin sent me standards discussions archived on diskettes that when printed amount ed to a stack of paper larger than most book manuscripts I sent a copy of the diskettes to Guy Kelly FST chairman to get his reactions According to Kelly s analysis much of the debate over Forth standards on the East Coast Forth Board has been from a vocal few two participants together account for nearly half the 780 messages the overall average is twenty eight messages per participant Most of the messages fall into a few categories the first of which is com plaints about Forth 83 On the techni cal side dissension focuses primarily on floored division DO LOOPS FIND alleged ambiguities and in particular new or modified actions assigned to word names already used
76. n Forth 83 the effect on current practice will be modest It also projects a five year useful life of such an ANS standard It has long been the view of some that an ANS Forth standard would greatly boost the language s accept ance in the corporate and government world Others argue that a Forth sys tem stands on its own merits and that going to ANSI would remove the stan dardization process too far from the Forth community The project pro posal cited above states Preserving machine independence and maintain ing a close liaison with any other Forth standardization efforts should prevent problems related to restraint of trade and public interest It concludes If any Forth standard committees are formed by the ISO or IEEE a close liaison should be formed IEEE Action Requested George Shaw of Shaw Laboratories Ltd points out that there is more than One route to an ANSI standard In one letter he said It took the thirty or so individuals directly involved and prob ably several times as many lobbyist and mail participants in Forth 83 to repre sent the diversity of implementations and usage Some important considera tions may only have been represented by a single individual Considering a standards group with such a small number of participants would end up standardizing a particular group of vendor s implementations at the ex pense of others The CBEMA effort I fear will prod
77. n Forth 83 it would be called UM MOD DOS File Disk I O by Charles G Wilcox Here is a simple interface to PC DOS The code is written around MVP FORTH but can be incorporated into virtually any Forth including the files used by F83 It allows access to DOS files whether or not they were created with Forth Seven Thousand Seven Hundred and Seventy Six Limericks by Nathaniel Grossman Faced with a literary challenge the author did not hesitate to respond with limericks But his six fold family of poems has no pretensions to literary merit the program is an exercise in the manipulation of data strings Inverse Video and TI FORTH by Richard Minutillo While TI s built in video firmware cannot provide an inverse image software can be written to do the trick Two methods are discussed and one is implemented fully TI FORTH makes the trick easy State of the Standard by Marlin Ouverson A summary of current actions in the Forth standardization movement Two unex pected aspects these come from outside the Forth Standards Team and there has been surprisingly little objection to date FORML 86 in Review Extending Forth Towards the 87 Standard drew much attention but session subjects also included Forth internals methods processors applications and artificial intelligence Here is a partial review of last season s gathering of Forth experts Checksum More by Len Zettel Checksums result from logical or arithmetic operati
78. n the other hand I think every one will agree that standard words should not have different meanings in different implementations An important but underemphasized part of the Forth 83 Standard is the Controlled Reference Set words which although not required cannot be present with a non standard defini tion Here is the appropriate place for most of Mr Haydon s common usage words Reserve the Required Word Set for those words that no implementa tion can do without Don t try to expand the Required Word Set to make it self sufficient To do so would re quire too much conformity from ven dors forcing them to leave out innova tive variations which might otherwise never find their way into common usage and thence into some future standard A case can even be made for moving some of the Required Word Set into the Controlled Reference Set especially words which have more to do with the implementation than the language itself such as file words Would a system be any less Forth like if it used named random access files instead of blocks Standards are important but they can also be overdone Now that there is talk of an ANSI standard for Forth it would be good if the Forth community could come to some concensus about what shape they would like it to take or even if such a standard is a good idea at all Sincerely David Nye Eau Claire Wisconsin Test Your Assertions Some method of testing assertions has b
79. nguage The code is reduced isn t it Reduced code results in increased programmer productivity RPN also increases produc tivity A RPN program is an expression i e any sequence of symbols No symbols have to be carried to complete a statement Branching starts and ends anywhere not just from the start of a statement to another Wayland Products offers RPN array software because it improves programmer and computer performance 4 Shore Drive Wayland Mass 01778 USA 617 877 9099 Advancing Reverse Polish Array Processing Volume VIII No 6 FORTH Dimensions MasterFORTH FORTH 83 ST ANDARD ee 6809 Systems available for FLEX disk sustems 059 6809 680x0 Systems available for MACINTOSH CP M 68K o tFORTH 20 for 68020 Single Board Computer Disk based development system under 059 68K 290 EpROM set for complete stand alone SBC 390 Forth Model Library List handler spreadsheet Automatic structure charts each 40 Target compilers 6809 6801 6303 680x0 8088 280 6502 sTaibot Microsystems l 1927 Curtis Ave Redondo Beach CA 90278 213 376 9941 68020 SBC 5 1 4 floppy size board with 2MB RAM 4 x 64K EpROM sockets 4 RS232 ports Centronics parallel port timer battery backed date time interface to 2 5 1 4 floppies and a SASI interface to 2 winchester disks 68881 fit pt option OS9 multitask amp user OS 350 FA ST int benchmarks speeds
80. nventional languages n unconventional processors and a writeable instruction set computer WISC The last day of the Conference will be devoted to tutorials demonstrations and presentations by vendors Registration will be from 3 11 p m on Tuesday June 9 and will continue from 8 a m Wednesday the 10th The registration fee includes all sessions meals and the published Conference papers Lodging is available at local motels or in the UR dormitories There will be an hourly shuttle to the airport during registration and checkout Please make checks payable to the Rochester Forth Conference Mail your registration by May 15 to the Rochester Forth Conference LLE 250 East River Rd Rochester NY 14623 1299 USA 5 FORTH Dimensions the data stack This may be by a DUP of essential processing Then write ASSERT During execution if the flag is true the flag is dropped and execution continues otherwise the screen number and line number from which the ASSERT was compiled are displayed along with the address of the call to the word containing the assertion This address allows you to determine where you came from in case of multiple calls Then entry of a C allows execution to resume while any other key results in a QUIT which preserves the data stack The word definitions are essentially fig FORTH ascu c may be replaced by 67 and H may be replaced by U or defined as H BASE SWAP HEX U BASE
81. olume VIII No 6 than thirty three so we have both of those taken care of so it should do for just about everyone When MORE hits the end it puts a zero on the stack that will act as a false flag for the WHILE in VERIFY This assumes that zero cannot be a valid block buffer address SKIP COMMENTS is designed to do exactly what its name implies It skips down the input stream until it comes to something non blank that is not a com ment Right now it is set up to handle two situations In the first it runs into a left parenthesis ASCII 40 Then it uses WORD to find the corresponding right parenthesis ASCII 41 and sol diers onward In the other case it finds a backslash ASCII 92 and then ex ecutes a backslash and continues Note that a left parenthesis or backslash indicates a comment only when im mediately followed by a blank so we check for that first I suppose if the use of braces gets more popular another change will be in order but we now have comment handling factored out and should be able to deal with any fiendish future schemes right here in the code Note to Commodore users on your machines C64 and VIC 20 at least ASCII 92 is a British pound sign It makes a good substitute for the backslash DISPOSE disposes of a non comment word It does the checksum on it ACCUMULATE does the bit twiddling char acter by character It is exactly the same as the Suralis and Brodie ACCUMULATE sO we can get t
82. on in the LINESTORE OR park addr 5 LINESTORE SWAP 6 BYTE OFF POEMS STOCK aatrix offset 7 SWAP CHARS LINE tines tchars cell in aatrix 8 CMOVE R gt byte offset addr 9 10 LINE addr count il TRAILING TYPE 12 13 RANDOM POEN n random integer lt POEMS STOCK 14 POEMS STOCK RANDOM 15 Volume VIII No 6 29 FORTH Dimensions SCRE 7 SCRE 8 Print a poem composed at randos NG 04 03 86 0 First lines NG 04 03 86 1 POER 2 _ begin interpreting LINES POEN 0 DO for each line of the poea 3 T RANDON_POEM LINESTORE select a suitable line sove 4 Returning by water from Ghent 00 4S BYTE OFF CHARS LINE to its start in LINESTORE 5 Relaxing beneath a blue tent 01 LS LINE CR print it linefeed amp Repairing a furniture dent 025 LOOP 7 Deciding on fasting for Lent 0 3 LS CRCR 8 Forgetting to fasten the vent 04S 9 Adopting an absurd accent 05 begin compiling SCRE 9 Second lines SCRE 10 NG 04 03 85 0 Third lines NG 04 03 86 t begin interpreting 2 begin interpreting 3 I noticed ay clothespin was bent 10 4 Though the little grey car 2 The widow was late with the rent 14 OLS S With the tears of the char 21 OLS A lover fell into the Trent 2 5 amp And the men at the bar 2225 My faaily was drenched as they went 1 3 LS 7 All th
83. ons CcOosT 130 page manual 30 00 8K EPROM with manuai 100 00 Postage paid in North America Inquire for ticense or quantity pricing Bryte Computers Inc P O Box 46 Augusta ME 04330 207 547 3218 ea on ay Volume VIII No 6 15 FORTH Dimensions POINT XY Same as POINT but without a color value for consistency with LINE MOVE CURSOR XY Move the current drawing cursor loca tion to the point X Y This word is not called MOVE because of possible naming conflicts in some Forth dialects LINE XY Draw a line from the last cursor posi tion set by either a MOVE CURSOR or a LINE word to the point X Y The color of the line is determined by the value of the variable COLOR The demonstration program GODSEYE not only draws a pretty picture but is a good test for the line drawing algo rithm since it uses lines from each of the different slope range cases of the line drawing program Conclusion The Bresenham line drawing algo rithm is an efficient way to draw straight lines The lines can be drawn even faster than with the example pro grams by using techniques such as direct screen memory access instead of BIOS ROM function calls and by writing optimized assembly language programs that keep variables in regis ters instead of in memory For more information on computer graphics in cluding mathematical derivations of the Bresenham algorithm please see the reco
84. ons on a string These can be handy especially when hand entering important code or data Suralis and Brodie showed us some checksum words this article provides an update to handle slight changes in our coding practices DEPARTMENTS 4 41 42 Letters Advertisers Index FIG Chapters 3 FORTH Dimensions Words Required amp Controlled Dear FIG Glen Haydon s essay A Forth Standard FD VIII 4 is a good discussion of some of the difficulties of standardizing an extensible evolv ing community designed language such as Forth Too little standardization makes it difficult to port applications between implementations and discour ages newcomers from learning Forth Too much standardization stifles evo lution of the language His solution makes sense don t make a word part of the official standard until it has become accepted into common usage Ideally adherence to a standard al lows any application written on one vendor s system to run on any other standard system but this ideal is sel dom met Programs written in one vendor s C Pascal or BASIC will often not run without modification on a different implementation I agree with Mr Haydon that requiring each Forth application to be written entirely in the Required Word Set and standard ex tensions is unnecessarily restrictive Few programmers will be willing to give up other useful words found in their implementation just for portabil ity O
85. onthly 2nd Tues 7 p m IPFW Campus Rm 138 Neff Hall Call Blair MacDermid 219 749 2042 IOWA lowa City Chapter Monthly 4th Tues Engineering Bldg Rm 2128 University of lowa Call Robert Benedict 319 337 7853 Central Iowa FIG Chapter Call Rodrick A Eldridge 515 294 5659 Fairfield FIG Chapter Monthly 4th day 8 15 p m Call Gurdy Leete 515 472 7077 KANSAS Wichita Chapter FIGPAC Monthly 3rd Wed 7 p m Wilbur E Walker Co 532 Market Wichita KS Call Arne Flones 316 267 8852 e LOUISIANA New Orleans Chapter Call Darryl C Olivier 504 899 8922 e MASSACHUSETTS Boston Chapter Monthly Ist Wed Mitre Corp Cafeteria Bedford MA Call Bob Demrow 617 688 5661 after 7 p m e MICHIGAN Detroit Ann Arbor area Monthly 4th Thurs Call Tom Chrapkiewicz 313 322 7862 or 313 562 8506 e MINNESOTA MNFIG Chapter Even Month 1st Mon 7 30 p m Odd Month 1st Sat 9 30 a m Vincent Hall Univ of MN Minneapolis MN Call Fred Olson 612 588 9532 MISSOURI Kansas City Chapter Monthly 4th Tues 7 p m Midwest Research Institute MAG Conference Center Call Linus Orth 913 236 9189 42 St Louis Chapter Monthly ist Tues 7 p m Thornhill Branch Library Contact Robert Washam 91 Weis Dr Ellisville MO 63011 e NEVADA Southern Nevada Chapter Call Gerald Hasty 702 452 3368 e NEW HAMPSHIRE New Hampshire Chapter Monthly Ist Mon 6 p m Armtec Industries Shepar
86. ot to worry Forthwrights our favorite language can rise to this occa sion The accompanying screens show how Naturally once I got my sticky little fingers into the definitions I couldn t help rearranging things in the name of improvement The functions of the words VERIFY and VER are the same and should produce the same CRC checksum values as the originals If anyone comes across an instance where this is not the case please let me know and we ll see what we can do That is I expect results to be the same ESS SE FORTH Dimensions In VERIFY we start by putting the cur rent values of BLK and gt IN on the return stack for safekeeping users of fig FORTH can get compatibility by typing gt IN IN and WORD WORD HERE Then we BEGIN asking MORE to checksum which we do in DISPOSE until there isn t any more at which point we restore gt IN and BLK and then exit MORE gets us more to checksum We skip any comments and come up with the address of the next blank delimited non comment entry Then we check whether we have come to the end of the screen The differences between various flavors of Forth force a rather elaborate scheme to get the right en ding for everybody We identify the end as a word with a count less than two and ASCII value less than thirty SCREEN 35 three Forth 83 and Forth 79 systems return a count of zero at the end of a block and fig FORTH systems return one so we have both of those cov
87. ound comparisons of the Novix 4000 and the Johns Hopkins chip The two groups had encountered many of the same design decisions but their approaches were often different The future of Forth engines was discussed at length with a considerable amount of interest and expressed optimism It appears a considerable amount of resource consumption is required to provide thirty two bits Johns Hopkins is thirty two Novix NC4000 is sixteen Some discussion mentioned that Forth in general is lacking a good set of benchmarks a lack deserving consider able community effort to remedy Prolog in Forth chaired by Louis Odette Data base pattern matching and search utilities are the basis of Prolog The manner of Prolog s com putation was discussed and was con trasted to Lisp After a general survey of the language s features the group dissected its strengths and weaknesses Next discussion centered on the ways in which hardware can be brought to aid Prolog s performance The chair man observed that even with its limita tions Prolog s inertia in the user base is likely to help it retain dominance in the field of artificial intelligence Financial Planning chaired by William Ragsdale reported by Jack Park What do you do after you ve spent your professional career hacking code for others Exposing a small body of earned cash to the world and hoping to come back with more was the topic for this group Thei
88. p 8th Fl 800 Oak Ridge Turnpike Oak Ridge Call Richard Secrist 615 483 7242 TEXAS Austin Chapter Contact Matt Lawrence P O Box 180409 Austin TX 78718 Houston Chapter Call Dr Joseph Baldwin 713 749 2120 Periman Basin Chapter Call Carl Bryson Odessa 915 337 8994 UTAH North Orem FIG Chapter Contact Ron Tanner 748 N 1340 W Orem UT 84057 VERMONT Vermont Chapter Monthly 3rd Mon 7 30 p m Vergennes Union High School Rm 210 Monkton Rd Vergennes VT Call Don VanSyckel 802 388 6698 VIRGINIA First Forth of Hampton Roads Call William Edmonds 804 898 4099 Potomac Chapter Monthly 2nd Tues 7 p m Lee Center Lee Highway at Lexington St Arlington VA Call Joel Shprentz 703 860 9260 Richmond Forth Group Monthly 2nd Wed 7 p m 154 Business School Univ of Richmond Call Donald A Full 804 739 3623 e WISCONSIN Lake Superior FIG Chapter Monthly 2nd Fri 7 30 p m University of Wisconsin Superior Call Allen Anway 715 394 8360 Milwaukee Area Chapter Call Donald H Kimes 414 377 0708 MAD Apple Chapter Contact Bill Horzon 129 S Yellowstone Madison WI 53705 FOREIGN e AUSTRALIA Melbourne Chapter Monthly Ist Fri 8 p m Contact Lance Collins 65 Martin Road Glen Iris Victoria 3146 03 29 2600 Sydney Chapter Monthly 2nd Fri 7 p m John Goodsell Bldg Rm LG19 Univ of New South Wales Sydney Contact Peter Tregeagle 10 Binda Rd Yowi
89. r views first estab lish a reasonable target rate of return Then evaluate your risk tolerance level of personal effort and involvement inventiveness cleverness and degree of self direction The next stage is decid ing what will you deal in real estate commodities stock etc Timing and leverage how much cash is exposed are determining factors and the degree of risk depends on the range of vari ance in the particular market s rates There are optimizing formulas for all this and that is what the group focused on A few tools written in Forth aid in financial analysis While one prays they bring an edge they are providing another set of tools to feed one s personal insight Evaluating dif ferent methods was an area of concern and detailed discussion ensued CBBS FIG On Line chaired by Robert Berkey FIG has been talking for two or three years about getting on a large network This year GEnie approached FIG and specifics have been discussed Invitations lo prospec live sysops were issued by FIG their resumes received and evaluated GEnie sent a contract recently details of which are being negotiated These an nouncements excited the group though some details still remain unresolved The working group addressed the con tract in detail the difficulty of access to GEnie by non U S residents posing an area of major concern The com pany evidently is showing good inten tions in this regard by working wit
90. rator Most division routines begin by shifting the double precision numerator left by one bit before doing the first subtraction That technique is all right provided that the most significant bit is not lost in the process To see the problem consider a very simple numerator with the most significant bit set to one and all the remaining bits cleared to zero Take a denominator which is just slightly larger than the high order part of the denominator Assume for ex ample that we are using the base HEX and that we have a single precision of sixteen bits The test case would be 0 8000 8001 UM MOD The result of this test should be a remainder of two and a quotient of FFFE on the top of the stack If the initial divisor 80000000 were to be shifted left without consideration of the high order bit the result would be zero Most division routines need a counter to determine when to stop the process The count down test may be perform ed at the end of the shifting process or in the middle of the shifting process The latter case is preferable if the count down and testing can be done without disturbing the carry bit In the former case it is necessary to stop the main loop one count short and then do a final trial subtraction or addition followed by a shift of the carry bit into the quotient only Before giving a detailed method for division it should be noted that there are a wide variety of techniques If you like th
91. return stack there is even less of a problem using DOES gt to make a child jump into the middle of an IF ELSE THEN construction It s OK to jump in be tween ELSE and THEN because no code is compiled by THEN It s OK to jump in between IF and ELSE because ELSE sim ply compiles an unconditional branch around the code between ELSE and THEN and this unconditional branch at run time is in no way dependent on the preceding conditional branch compiled by IF I cannot think of any possible im plementation of the standard where the given definition of SYNONYM would not work and the suggested alternative Continued on page 31 FORTH Dimensions 10 Volume VIII No 6 THE FORTH SOURCE MVP FORTH Stable Transportable Public Domain Tools You need two primary features in a software development package a stable operating system and the ability to move programs easily and quickly to a variety of computers MVP FORTH gives you both these features and many extras This public domain product includes an editor FORTH assembler tools utilities and the vocabulary for the best selling book Starting FORTH The Programmer s Kit provides a complete FORTH for a variety of computers Other MVP FORTH products will simplify the development of your applications MVP Books A Series E Vol 1 Alf about FORTH by Haydon Glossary of FORTH 2nd Ed Vol 2 MVP FORTH Assembly Source Code Includes iBM PC CP M and
92. rt Unique table driven multi pass Forth compiler Compiles compact RQMable or disk based applications Excellent error handling Produces headerless code compiles from intermediate states and performs conditional compilation Cross compiles to 8080 Z 80 8086 68000 6502 8051 8096 1802 and 6303 No license fee or royalty for compiled applications Translates high level Forth into in line optimized machine code Can generate ROMable code Technical Assistance Hotline i Laboratory Microsystems Incorporated Post Oftice Box 10430 Marina del Rey CA 90295 Phone credit card orders to 213 306 7412 Rather et al and IEEE The actual procedure for creating a standard document is dictated by the particular channel Shaw feels that IEEE can provide for participation and meaning ful input from a broader cross section of the Forth community Under its own rules participation by mail must be allowed and individuals participat ing by mail are allowed to vote Tele conferencing and other options are available in consideration of the dif ficulties of individual participation CBEMA requires four to six meetings per year of four or five days each and the voting membership is virtually restricted to organizations and busi nesses not individuals Shaw s letter continues Meeting CBEMA require ments to maintain voting privileges would cost approximately 3000 a year in dues and travel expenses not to men
93. rt routine on screen 85 of KERNEL86 BLK This changes the BIOS break vector so that on control C or control break Forth is restarted To toggle the printer use the Forth words PRINT ON and PRINT OFF To delete the line being entered use the escape key rather than control X A more insidious problem is that this DOS function echoes all characters to the screen including the CR character that terminated the input In normal Forth mode that CR displays as a single blank Now any subsequent output would overwrite the displayed input The Forth word CR is included in this EXPECT to clean up the display It does cause unnecessary blank lines It also makes the opening CR in words such as WORDS and DIA superfluous You ll note that I m using a separate internal buffer for this EXPECT The DOS convention dictates that the first two bytes of the buffer are for maxi mum length and length actually used Since this differs from the way Forth uses its buffers it could possibly affect some other words using EXPECT An internal buffer of adequate size avoids that problem A last side effect may or may not be a problem The original EXPECT will exit on a buffer full condition This EXPECT will exit only on a CR This may affect certain applications If so keep both versions around Note that the second count length byte controls what the DOS editing keys remember You can actually change the buffer content string and mak
94. s Most of the history of Forth stan dards has been recorded in these pages and elsewhere in articles and letters to the editor We will not attempt a his torical summation but present a sam pling of the ideas in active circulation at this time The amount of material precludes reproduction in toto what follows is a general survey quoting liberally from documents in our files To get a reading on the opinions of one cross section of the Forth community see FORML 86 in Review elsewhere in this issue We must also acknowledge that for many people working indepen FORTH Dimensions dently or on some in house systems the issue of standards may be only of secon dary importance If however this topic is of concern to you the best way to be fully informed and to participate is to make contact with the people and or ganizations directly involved ANSI Standard Requested Elizabeth Rather President of FORTH Inc wrote in December to say that a project proposal for an ANS Forth had been filed with ANSI The group that filed the proposal consisted of Ms Rather also an FST member Don Colburn FST member Creative Solutions Inc W B Dress Oak Ridge National Laboratory Ray Duncan Lab oratory Microsystems Inc Burt Feliss IBM Corporation Charles Moore in ventor of Forth Computer Cowboys Dean Sanderson FST Referee FORTH Inc Gerald Shifrin MCI Telecommuni cations Corp and Mart
95. s these represent a minimum vocabulary with options rather than being interpreted in a restrictive sense Kelly continues The fact that Mr Moore does not personally feel bound by a standard and is continually evolv ing his own version of the language he invented is I believe all to the good Finally the FST chairman calls our attention to these words from the for ward to the Forth 83 Standard Forth s extensibility allows the lan guage to be expanded and adapted to special needs and different hardware systems A programmer or vendor may choose to strictly adhere with the stan dard but the choice to deviate is acknowledged as beneficial and some times necessary If the standard does not explicitly specify a requirement or restriction a system or application may utilize any choice without sacrific ing compliance to the standard provid ed that the system or application remains transportable and obeys the other requirements of the standard MacForth Plus Multi Forth Amiga 4701 Randolph Rd Suite 12 Rockville MD 20852 Volume VIH No 6 Lower prices for the best Forth Systems Byte Magazine February 1987 MacForth Plus is Product of the Month by Bruce Webster MacForth Plus has come a long way since the original product and represents one of the finest Forth develop ment environments on any system Interactive multi tasking environments with buil
96. sions 1983 84 1 5 16 18 106 Volume 6 FORTH Dimensions 1984 85 1 5 16 18 107 Volume 7 FORTH Dimensions 1985 86 20 21 24 108 Volume 8 FORTH Dimensions 1 986 87 20 21 24 FORML CONFERENCE PROCEEDINGS FORML PROCEEDINGS FORML the Forth Modification Laboratory is an informal forum for sharing and discussing new or unproven proposals intended to benefit Forth Proceedings are a compilation of papers and abstracts presented at the annual conference FORML is part of the Forth interest Group 310 FORML PROCEEDINGS 1980 30 33 40 Technical papers on the Forth language and extensions niques adding local variables to Forth 315 FORML PROCEEDINGS 1985 35 38 45_ Also includes papers from the 1985 euroFORML Con ference Applications expert systems data collection networks Languages LISP LOGO Prolog BNF Style coding conventions phrasing Software Tools decom pilers structure charts Forth internals Forth computers floating point interrupts mulitasking error handling Volume VIII No 6 21 FORTH Dimensions BOOKS ABOUT FORTH 200 ALL ABOUT FORTH 25 26 35 Glen B Haydon An annotated glossary for MVP Forth a 79 Standard Forth 216 DESIGNING amp PROGRAMMING PERSONAL EXPERT SYSTEMS 19 20 29 Carl Townsend amp Dennis Feucht Introductory explanation of Al Expert System Concepts Create your own expert system in Forth Written in
97. size when ordering Volume VIII No 6 23 FORTH Dimensions FORTH INTEREST GROUP P O BOX 8231 SAN JOSE CALIFORNIA 95155 408 277 0668 Name Member Number Company Address City State Prov ZIP Country Phone oe TITLE AUTHOR ee ee wn A 109 MEMBERSHIP A UNIT QTY PRICE TOTAL SEE BELOW SUBTOTAL ORDERS OF 50 00 OR MORE O Check enclosed payable to FORTH INTEREST GROUP RECEIVE A 10 DISCOUNT O VISA O MASTERCARD SUBTOTAL Card CA RESIDENTS SALES TAX Expiration Date HANDLING FEE 2 00 Signature MEMBERSHIP FEE 15 00 minimum on charge orders ONEW ORENEWAL 30 42 PAYMENT MUST ACCOMPANY ALL ORDERS MAIL ORDERS PHONE ORDERS PRICES POSTAGE amp HANDLING SHIPPING TIME SALES TAX Send to Call 408 277 0668 to place All orders must be prepaid Prices are Prices include shipping A Books in stock are shipped Deliveries to Alameda Forth Interest Group Credit card orders or for subject to change without notice Credit 2 00 handling fee is within five days of receipt Contra Costa San naeg P O Box 8231 Customer service Hours card orders will be sent and billed at required with all orders of the order Please allow PP ee Sa San Jose CA 95155 Monday Friday 8am 5pm current prices 15 minimum on charge 4 6 weeks for out of stock 9 st ante Clad i PST orders Checks must be in US drawn books delivery in most County
98. t amp Matrix Math see above 100 MVP FORTH Graphics Extension see above 80 MVP FORTH EXPERT 2 System for learning and developing knowledge based programs Both IF THEN procedures and analytical subroutines are available Source code is provided Specify J Apple C IBM or C CP M 8 Includes MVP Books Vol 4 amp 6 100 Word Kalc A Word Processor and calculator system for the IBM PC XT AT with 256K MVP FORTH compatible kernel with Files Edit and Print systems Includes Disk and Calculator systems and ability to compile additional FORTH words 150 New STARTING FORTH by Brodie FORTH DISKS APPLE by MM Apple by LM ProDos Atari ST by Corley ATARI by PNS C64 by HES cartridge C64 with EXPERT 2 by PS CP M by MM 8 HP 75 by Cassady HP 85 by Lange 1BM PC by LM IBM PC by MM Macintosh by MM Timex by HW cassette T S 1000 ZX 81 2068 6809 FLEX by MPE Dr Dobb s Toolhook w disk Specify IBM Apple II or CP M 8 40 125 New 150 75 90 40 100 TRS 80 Mod 4 by Wetmore 280 by LM 8 8086 88 by LM 8 68000 by LM 8 VIC FORTH by HES VIC20 Cartridge 125 Extensions for LM Specify IBM 150 280 or 8086 90 O Software Floating Point 100 150 C 8087 Support IBM PC or 8086 100 125 9511 Support 280 or 8086 100 125 Color Graphics 280 or 8086 100 Extensions for MM Specify IBM Apple CP M or Macintosh C Floating Point Graphics
99. t drive to drive B Supporting Words GFNAME This word parses a filename out of the input stream and moves it to any address you like Normally I use FCB but in the case of the word DEL use PAD This prevents the file control block from being messed up when I am merely deleting another file FCB This is a variable with 2EH more bytes allotted The file information including the filename is stored here DOSR W The code field of this word is put into the execution variable R wW to replace the usual word R W used in MVP FORTH This word uses the same input as any other R W word namely address block number and either a true flag indicating a read is desired or a false flag indicating a write func tion is needed How It Works With PC DOS there are two ways of interfacing to disk files One the older method uses a file control block FCB The newer method uses device handles The newer method allows one to direct I O easily I chose the older method since it was conceptually simpler for me In this method one creates a file control block and uses the address of this block as the entry ad dress to a series of interrupt 21H calls The register AH is set to the code for the command and then interrupt 21H is performed The error code is usually returned in AL MVP FORTH uses the word SYSCALL to accomplish this I use eight such interrupt calls as follows open file OFH create file 16H close file 10H delete
100. t and thirty two bit environments was dis cussed and comparisons were made between subroutine threading on tradi tional architectures and on the Novix NC4000 Turtles Explore Floored Division by Zafar Essak This paper addresses the implications of rounding in integer division Four methods were tested in the production of circles within a two dimensional turtle drawing pack age division floored to zero dropping decimals was found to be the only method which consistently drew com plete and well formed circles Detailed implementation source code and dem onstration examples were provided in the paper Datastructure Interpolar by Nathaniel Grossman Tabulated func tions or even very complicated elemen tary functions are sometimes conve niently approximated by polynomials Faster and more stable evaluation is made possible by rearranging the poly nomials into Barycentric form This paper presents theory implementation and examples of numerical analysis using this method Hashed Cached Buffers by Loring Craymer Typical Forth buffer manage ment implementations are linear in both search and replacement order They may therefore be impractical for implementations in which a large number of buffers are allocated This paper presents a uniformly fast non linear access and replacement method for a large number of block buffers Comprehensive discussion and source i
101. t in assembler editors turnkey compiler royalty free extensive hard ware interfaces large installed base of users and applications Now at prices that can t be beat Call our 800 number be low for a technical data sheet or check CompuServe at GO FORTH to see the hundreds of public domain shareware programs written in MacForth and Multi Forth 199 was 299 89 was 179 301 984 0262 in MD or 1 800 FORTH OK 367 8465 37 Macintosh Buyer s Guide Anniversary Issue Awards MacForth Plus as one of the Top 100 of companies products and people One of the best 33 products chosen by users Multi Forth Atari ST Multi Forth HP 200 300 89 was 149 695 was 995 FORTH Dimensions FORML 86 in Review Last November FORML conference guests were accompanied to California s Monterey peninsula by a rare migration of whales Brief shoreline walks be tween sessions yielded few sightings but the salt air tide pools and crystal blue skies were balm enough for already stimulated minds The theme publicized in the call for papers was Extending Forth Towards the 87 Standard While the topic drew much reaction only four of the published papers come under that cate gory Most of the standards related material was aired during a special working group Other session subjects included Forth internals methods processors applications and artificial intelligence This meant more than thirt
102. t is often reached where we think If the program gets to this point and there are no bugs in my logic then this and this must be true ASSERT is intended to assure ourselves that this and this really are true This anti bugging should be done as the code is written and the condi tions occur to you This simple and natural mechanism has many advant ages over temporary ad hoc debugging tools particularly in documentation and the fact that the assertions are transparent as maintenance changes are made unless an error occurs To use the ASSERT execute what ever sequence of words you assume to Screen 33 i Compile time part of assert NLH 1 27 87 CASSERTI ssert tf on stack toms if nat shaw scr line amp call 3 ing addr else clean up stack i acre CASSERTI PLOADING COMP i Only valid if compiling fram BLK Block number being LOADed disk B SCR Number of blocks per Ik screen MOD i Quotient will become screen number amp remainder will become line number in screen after 2 x 16 SWAP 2 Shift quatient to left 3 half bytes E therefore m screen number is OFFFh IN Dd 64 7 Count into t H fer divided by len of i lines on a ers after becomes line na Combine screen no amp line naw into one number CCOMPILEJ LITERAL Compile number for run time use COMPILE ASSERT Compile CFA of run time assert IMMEDIATE Screen 34 Run tim
103. tact Georges Seibel 19 Rue des Hirondelles 74000Annely 50 57 0280 e IRELAND Irish Chapter Contact Hugh Doggs Newton School Waterford 051 75757 or 051 74124 e ITALY FIG Italia Contact Marco Tausel Via Gerolamo Forni 48 20161 Milano 02 645 8688 e JAPAN Japan Chapter Contact Toshi Inoue Dept of Mineral Dev Eng University of Tokyo 7 3 1 Hongo Bunkyo 113 812 2111 ext 7073 e NORWAY Bergen Chapter Kjell Birger Faeraas Hallskaret 28 Ulset 47 5 187784 e REPUBLIC OF CHINA R O C Contact Ching Tang Tzeng P O Box 28 Lung Tan Taiwan 325 SWEDEN Swedish Chapter Hans Lindstrom Gothenburg 46 31 166794 SWITZERLAND Swiss Chapter Contact Max Hugelshofer ERNI amp Co Elektro Industrie Stationsstrasse 8306 Bruttisellen 01 833 3333 SPECIAL GROUPS Apple Corps Forth Users Chapter Twice Monthly Ist amp 3rd Tues 7 30 p m 1515 Sloat Boulevard 2 San Francisco CA Call Robert Dudley Ackerman 415 626 6295 Baton Rouge Atari Chapter Call Chris Zielewski 504 292 1910 FIGGRAPH Cali Howard Pearlmutter 408 425 8700 MMS Forth User Groups More than 30 locations For further information call 617 653 6136 pe peer Volume VIII No 6 43 FORTH Dimensions NOW AVAILABLE Forth Model Library Volume 4 A SIMPLE INFERENCE ENGINE by Martin J Tracy Forth 83 for the IBM PC DOS 2 0 Not copy protected proceeds go to expand Laxen Perry F83 the library
104. ties I was lucky to find a copy of this uncommon book in the library of the University of Durham England while living for a while in that city It is worth looking for in your locale just to see a splendid piece of bookmaking and paper engineering I was struck with the thought that Queneau s out of print work could be made available to all by means of a simple computer program that would print out as many of the sonnets as the reader wished Unfortunately my command of liter ary French is not great and I would prefer to savor the sonnets in English Translation of the 140 lines into English would be a formidable task given that the meter and rhyme would be severely constrained Copyright considerations would also intrude And only a writer of Queneau s power could compose fourteen new blendable sonnets in English to his plan Nevertheless I found a way to realize the project in miniature While shy away from sonnets I do not hesitate at creating limericks doggerel as they may be Therefore I wrote lines suffi cient for creating a six fold family of limericks 65 7776 in all I had no pretensions toward creating poems of literary merit that must be left to the likes of Queneau I was satisfied if every limerick made reasonable sense To ensure that it was necessary to choose a vague theme for each line in turn The restriction to six samples for each line is of course arbitrary but the possib
105. tion lost wages or use of vacation time Shaw feels that a CBEMA effort to developing an ANS Forth standard is unnecessarily restrictive considering how widely expertise is distributed throughout the Forth community He said that to CBEMA in a letter asking them not to approve the proposal they received He points out that the group who wrote the proposal is made up mostly if not entirely of current or former employees customers or sub contractors of FORTH Inc He wrote They may be well intentioned but I do not believe this group represents the interests of the Forth community and vendors at large This matter was presented at a Janu ary meeting of the Microcomputer Standards Committee of the IEEE Shaw says while the members of that committee wished to avoid the pos sibility of and the political problems involved in having a joint EEE CBEMA committee the group voted with no dissension nineteen yea four abstentions to untable and re place a motion made in 1981 fora PAR program action request and to addi tionally request that the members who are also voting members in CBEMA vote against approval of the ANS Forth project In the IEEE a PAR is the first step in getting a standard project going Volume VIII No 6 35 FORTH Dimensions COMBINE THE RAW POWER OF FORTH WITH THE CONVENIENCE OF CONVENTIONAL LANGUAGES HS FORTH Why HS FORTH Not for speed alone although itis twice
106. uce such a small group Shaw explained that ANSI itself doesn t create standards but endorses them It is primarily concerned with whether a standards document was obtained from one of their usual chan nels ike CBEMA the route chosen by Volume VIII No 6 r TOTALCONTROL with LMI FORTH e e For Programming Professionals an expanding family of compatible high performance Forth 83 Standard compilers for microcomputers For Development Interactive Forth 83 Interpreter Compilers For Applications Forth 83 Metacompiler For Speed CForth Application Compiler Support Services for registered users Periodic newsletters and low cost updates e Bulletin Board System Call or write for detailed product information and prices Consulting and Educational Services available by special arrangement Overseas Distributors Germany Forth Systeme Angelika Flesch Titisee Neustadt 7651 1665 UK System Science Ltd London 01 248 0962 France Micro Sigma S A R L Paris 1 42 65 95 16 Japan Southern Pacific Ltd Yokohama 045 314 9514 Australia Wave onic Associates Wilson W A 09 451 2946 16 bit and 32 bit implementations Full screen editor and assembler Uses standard operating system files 400 page manual written in plain English Options include software floating point arithmetic coprocessor support symbolic debugger native code compilers and graphics suppo
107. udes section on how to teach children Forth 240 MASTERING FORTH 1 8 19 22 Anita Anderson amp Martin Tracy A step by step tutorial including each of the commands of the Forth 83 international Standard with utilities exten sions and numerous examples 245 STARTING FORTH soft cover 22 23 32 Leo Brodie A lively and highly readable introduction with exercises 246 STARTING FORTH hard cover 20 21 30 Leo Brodie 255 THINKING FORTH soft cover 16 17 20 Leo Brodie The sequel to Starting Forth An intermediate text on style and form 265 THREADED INTERPRETIVE LANGUAGES 25 26 35 R G Loelinger Step by step development of a non standard Z 80 Forth 267 TOOLBOOK OF FORTH Dr Dobb s 00 23 25 35 ge Edited by Marlin Ouverson Expanded and revised versions of the best Forth articles collected in the pages of Dr Dobb s Journal 270 UNDERSTANDING FORTH 3 50 5 6 Joseph Reymann A brief introduction to Forth and overview of its structure E ROCHESTER PROCEEDINGS The Institute for Applied Forth Research Inc is a non profit organization which supports and promotes the application of Forth It sponsors the annual Rochester Forth Conference 321 ROCHESTER 1981 Standards Conference 25 28 35 79 Standard implementing Forth data structures vocabu laries applications and working group reports 322 ROCHESTER 1982 Data bases
108. xico Column 2 Foreign Surface Mail Column 3 Foreign Air Mail 2 Select the item and note your price in the space provided 3 After completing your selections enter your order on the fourth page of this form 4 Detach the form and return it with your payment to the Forth Interest Group 311 FORML PROCEEDINGS 1981 45 48 55 Nucleus layer interactive layer extensible layer metacom pilation system development file systems other languag es other operating systems applications and abstracts without papers 312 FORML PROCEEDINGS 1982 30 33 40 Forth machine topics implementation topics vectored execution system development file systems and lan guages applications 313 FORML PROCEEDINGS 1983 30 33 40 Forth in hardware Forth implementations future strategy programming techniques arithmetic amp floating point file systems coding conventions functional programming applications 314 FORML PROCEEDINGS 1984 30 33 40 Expert systems in Forth using Forth philosophy im plementing Forth systems new directions for Forth inter facing Forth to operating systems Forth systems tech FORTH DIMENSIONS BACK VOLUMES The six issues of the volume year May April 101 Volume 1 FORTH Dimensions 1979 80 1 5 1 6 18 102 Volume 2 FORTH Dimensions 1980 81 1 5 16 18 103 Volume 3 FORTH Dimensions 1981 82 1 5 16 18 104 Volume 4 FORTH Dimensions 1982 83 1 5 16 18 105 Volume 5 FORTH Dimen
109. y individual presentations a half dozen working groups impromptu lec tures and numerous demonstrations throughout the weekend Attendees this year voted to grant special recognition to the following presentors David Harralson for his paper Extended Forth Control Struc tures for the Language Requirements of the 1990s Martin Fraeman John Hayes Robert Williams and Thomas Zaremba for their papers pertaining to the Johns Hopkins Forth chip and Wil Baden for papers about charting escaping hacking and leaping Forth These papers will be published along with the complete proceedings of the conference available soon from the Forth Interest Group What follows is an informal survey of conference events Two of the ses sions are synopsized by their respective session chairmen Then working groups are described along with the names of their chairmen and some impromptu talks are highlighted Forth Internals Session The first session consisting of seven papers on Forth internals covered a wide range of topics Alternatives were explored for implementation of integer division improved methods for numerical analysis better performance for virtual buffer management in sys tems with many buffers ahd extrac tion of system specific words in F83 to FORTH Dimensions a separate vocabulary Results were presented on use of modular program ming techniques in Forth portability of programs between sixteen bi
110. y out If carry out is zero go to Step 2 Other wise add DEN to HI and place the sum in Ht Decrement the counter If the result is non zero set the carry bit to one and repeat this step Otherwise clear the carry bit and go to Step 3 Step 2 Make a trial addition of DEN to HI If the carry out is one put the sum back into HI In either case remember the carry bit Decrement the counter If the result is non zero then go to Step 1 Otherwise go to Step 3 Step 3 Shift Lo only left with carry If all operands were popped from the stack first push HI on the stack and then LO Otherwise do a SWAP operation That is all there is to it for this routine Of course the optimal method will vary from machine to machine You may be able to obtain a very slight improvement by doing true subtraction on your machine and not doing the initial negation of the denominator In my opinion the arithmetic rou tines in Forth need to be augmented by division functions which allow double length divisors In a version of Forth that I am currently working on I have added such a routine It is written in normal 8086 8088 assembly language and is presented in Figure One as a real example of a division routine The details of the macro name HEADER are unimportant for the purposes of this example See code on page 25 FORTH Dimensions 18 Volume VIII No 6 DOS File Disk I O Charles G Wilcox Palo Alto California
Download Pdf Manuals
Related Search
Related Contents
HTP702-SW , HTP202/302-SW 34397.1 EFL UMX SBach 3D.indb GH-PM 56 S HW Artikel-Nr.: 3400765 Komponenten JVC 0404SKMCREORI Portable CD Player User Manual POLARON PRO 6. Destillieren, Trennen, Filtrieren UMTS/GSM/GPRS Mobile Phone User Manual Bedienungsanleitung Benutzerhandbuch S Class 2 Copyright © All rights reserved.
Failed to retrieve file