Home
V5N3 - Forth
Contents
1. DIR zname 4DIR MIN LIST SUE scr Zname n or d DUF SUBJECT PROCEDAMUS WWE 7 14 85 End Listing FORTH Dimensions 12 Volume V No 3 A primitive phone list can be set up PH DN it ASCI HOLD S gt TYPE SPACE REACH NAME PHONES LITERAL DUP SUBJECT PH Since the value of a name or subject is interpreted SUBJECT could be used for menus Assuming that MENU is a screen with one or two character codes alternating with associated words to process them something like the following could be done MENU MENU LIST PROMPT QUERY 0 gt IN MENU DUP SUBJECT RUN something is equivalent to NEED something something FOLLOW name has a somewhat similar relation to NEED name that has to LOAD It is used at the beginning of a screen to get to an ear lier screen that will lead to the current screen This allows an entire applica tion spanning several screens to be loaded from a request for any one of the constituent words In the original conception we thought that directories would be sparse with only major entries like traditional directory screens We soon found that all definitions could be put in the directory and a utility to do this was developed This makes VIEW act like its homonym which vectors CREATE An important difference is that our VIEW can list the source of
2. SCR 72 MR mr discs A Sys Um wwb wwb 830714 bl word dup c9 or BEGIN BL WORD DUP i Cd BL DR BL IF TRUE EXIT THEN BLE i B SCR MOD WHILE DROP 1 BLK IN REPEAT FALSE INTERPRET A WORD lt word gt interprets a word DEFINED IF EXECUTE ELSE NUMBER dpl O if drop then CONTINUED n b scr X BLE O SIN 3 Z3 LOAD 74 LOAD directory system 78 82 DIRECTORY MAIN MAIN SCRS 73 Pas caris Tag pan ee 830714 INTRIGUE pe Pa search the screen meris MORE dr FAD DUP C3 tu COMPARE O for equal E d EL WORD O ELSE TRUE EXIT THEN UNTIL FALSE CONNIVE scri ES lt name gt is in PAD BLE 3 dom 2 R SR TRUE ROT ROT 1 SWAF DO I b ELK C L skip top line IN INTRIGUE IF NOT LEAVE THEN LOOP ABORT not in directory INTERPRET A WORD R gt R gt TON t e 3 SUBJECT gscri scr2 lt name gt find and execute EL WORD EBONI PAD 2DUP C i SWAP CMOVE CONNIVE rad 74 res apes system wwb wwb 830714 SVART BLE DIRX 1 ADIR gcri scr2 DIR 29 1 ESTABLISH scri amp cr2 DIRX 2 1 me ce ESTABLISH DIRECTORY scri ecr ams ZCONSTANT DOES NAME lt name gt n or d ADIR SUBJECT 1 VIEW Ed NAME LIST 3 NEED 45na eot oe HAVE iF DROP EBE SIN NAME LOAD THEN SIN 9 HAVE If DROP ELSE IN ME CONTINUED THEN t RUN 4 amp name IN 3 NEED IN
3. 83 Standard does not have state smart required words This seems to have grown from the problems using FORTH 79 Ver OR For your APPLE II II The complete professional software system that meets ALL provisions of the FORTH 79 Standard adopted Oct 1980 Compare the many advanced features of FORTH 79 with the FORTH you are now using or plan to buy FEATURES 79 Standard system gives source portability Professionally written tutorial amp user manual screen editor with user definable controls Macro assembier with local labels Virtual memory Both 13 amp 16 sector format Multiple disk drives Double number Standard amp String extensions Upper lower case keyboard input LO Res graphics 80 column display capability Z 80 CP M Ver 2 x amp Northstar also available Affordable Low cost enhancement option Hi Res turtie graphics Floating point mathematics Powerful package with own manual 50 functions in all AM9511 compatible FORTH 79 V 2 requires 48K amp 1 disk drive ENHANCEMENT PACKAGE FOR V 2 Floating point amp Hi Res turtle graphics COMBINATION PACKAGE CA res add 696 tax COD accepted MicroMotion 12077 Wilshire Blvd 506 L A CA 90025 213 821 4340 Specify APPLE CP M or Northstar Dealer inquiries invited Volume V No 3 OURS YES 200 PG YES YES YES YES YES YES YES YES YES YES 99 95 YES YES OTHERS 99 95 49 95 139 95 Version 2 For Z 8
4. Editor Marlin Ouverson Publisher Roy C Martens Typesetting Production LARC Computing Inc Cover Art Al McCahon FORTH Dimensions solicits editorial material comments and letters No re sponsibility is assumed for accuracy of material submitted Unless noted other wise material published by the FORTH Interest Group is in the public domain Such material may be reproduced with credit given to the author and the FORTH Interest Group Subscription to FORTH Dimensions is free with membership in the FORTH Interest Group at 15 00 per year 27 00 foreign air For membership change of address and or to submit material the address is FORTH Inter est Group P O Box 1105 San Carlos CA 94070 Letters to the Editor Unfinished Business Dear Editor I am a novice to Forth but a pro grammer and analyst for small com panies especially in engineering and scientific work I would like to see more and better information and pro grams for new Forth programmers Since Forth textbooks are scarce I learn mostly from Forth Dimensions Many programs are not easy because often they are not fully compatible with my software or contain words that are not defined In one program from A Techniques Tutorial on Defining Words Vol IV No 1 there is only one word WITHIN that I am not able to define at all I have checked three different textbooks but the program is still left unfinished I would like Fo
5. LJ IBM PC O MS DOS Q Osborne O Kaypro O H89 Z289 n w 0 2100 O TEPC O MicroDecisions C Northstar X MVP FORTH operates under a variety of CPU s computers and L Compupro LJ Cromemco 150 operating systems CP M disks can be supplied 8 SS SD 3740 O MVP FORTH Cross Compiler for CP M Programmer s Kit format or 5 4 for Osborne Northstar Micro Decisions Kaypro or ERU also generate headerless code for ROM or target H89 Z89 Specify your computer and operating system amp 300 FORTH DISKS FORTH MANUALS GUIDES amp DOCUMENTS FORTH with editor assembler and manual C ALL ABOUT FORTH by O 1980 FORML Proc 25 C APPLE by MM 100 IBM PC by LM 100 Haydon See above 25 O 1981 FORML Proc 2 Vol 40 J APPLE by Kuntze 90 C NOVA by CCI 8 DS DD 150 O FORTH Encyclopedia by C 1982 FORML Proc 25 D CPIM by MM 100 8086 88 by LM 100 4 Programmer s manual to fig Proc 25 1 HP 85 by Lange 90 NY FORTH with FORTH 79 El HP 75 i H 9 do cd eren Cartridges by HES references Flow charted 27 L1 1982 Rochester FORTH eae y Cassady Proc lian LE 620 50 i Comm 64 60 Ed 25 a xi Enhanced FORTH with F Floating Point G Graphics T Tutorial O Understanding FORTH by C 1983 Rochester FOR S Stand Alone M Math Chip Support MT Multi Tasking X Other Reymann 3 Proc 25 Extras 79 FORTH 79 O A FORTH Primer 25 O APPLE by MM El Extensions for ty Specify HO dur dci SIG C Threaded
6. MEM have obvious functions 15 FORTH Dimensions 14 Volume V No 3 SCR 771 RamDisk Program HEX 1 2 RDerr CR RamDist ERROR improper function call QUIT 4 RDread btr blk copy relative block 2 RDseg set buffer segment OQ Ea see if data present 7 IF read actual buffer 8 102 2 DO copy RamDisk to buffer 9 I E2 OVER 2 10 2 LOOF DROF 11 ELSE RamDisk buffer not valid 12 100 BL FILL fill buffer with blanks gt 13 ENDIF 14 DECIMAL a Lo SCR 772 RamDisk Frogram if 2 RDR W addr blk f augments FORTH R W X OVER DUP see if in RamDisk 4 RAMBLE i SWAF RAM RAMBLE lt AND 3 IF then memory read or write amp i GODO y RDerr RDwrite RDread RDerr a THEN 9 R DROF drop return link to R W 10 ELSE else real read or write 11 R SWAF cR gt R replace R gt from R W 12 ENDIF and return to R W is 14 imd 15 SCR 773 Q RamDisk Program i 2 RDinit initialize a phantom diskette in RAM 3 RDmemsize RDclear RDR W CFA R W 3 4 3 RDparms display RamDisk parameters 6 DECIMAL CR CR RamDisk CR CR 7 Capacity RAM 4 a kK bytes CR 8 Blocks RAMBLE 9 uu es D RAM RAMBLE l CR 10 Screens RAMBLE 4 DUP 11 Do femen RAM 4 CR i 12 gt 13 14 15 SCR 774 O RamDisk Program 1 2 EXTERNAL 3 4 RD O initialize RD 5 i return in
7. Volume 5 Number 3 September October 1983 2 50 LJimensions RAMdisk FEATURES FIG Forth Vocabulary Structure Evan Rosen 5 An Easy Directory System Wil Baden 11 A RAMdisk for 8086 8088 FIG Forth John Irwin 14 In word Parameter Passing Timothy Huang 19 Stack Oriented Co Processors ANG FON m MR Dana Redington 20 Code and Colon Compatibility David Held 23 CORDIC Algorithm Revisited Dave Freese 24 Forth 83 A Minority View Glenn Tenney 27 DEPARTMENTS N EONO Sanana 3 Editorial Standard Fare iei b hire RE REI MU PRe e pEpcbud ee 3 Standards Corner eese Robert L Smith 26 Techniques Tutorial 7 Meta Compiling lll Henry Laxen 31 FIG Chapter News eet John D Hall 34 New Product ANNOUNCEMENS ccccccsessssssssesescseseseseseeeseeneetes 36 What Do All Have In Common Hewlett Packard AT amp T Long Lines General Electric Hughes Aircraft Motorola Over the past three years each has bought professional Rockwell International U S Army ET amp D Labs 68000 FORTH U S Navy NOSC University Of California and over 200 others Why MATURE RELIABLE PRODUCT CORE IMAGE SNAPSHOT FE
8. and Greek let ters and other symbols are available by typing a command followed by the name of the desired letter or symbol The price in single quantity is 200 from Innovatia Laboratories The TDS900 is a single board Forth computer with on board screen editor compiler and debug facilities It uses FIG Forth and provides simple inter face to serial and parallel devices All the user needs is a power supply CRT and 395 If more than 12K RAM and 8K ROM is needed up to 160K is avail able in increments of 20K per extra board The computer and RAM boards use CMOS throughout in single Eurocard format Information is avail able from Stynetic Systems Inc in the U S and from Triangle Digital Ser vices Ltd in the U K Forth classes will demonstrate how Forth can be used as an algorithm development tool and as a total pro gramming environment Problem solv ing will be emphasized by instructor Leo Brodie author of Starting Forth Call Steven Sarns 303 477 5955 Orange County Chapter Monthly 4th Wed 7 p m Fullerton Savings ILLINOIS Talbert amp Brookhurst Students wil apply design and problem solving techniques in the design and coding of actual problems East coast classes are planned for November and the Los Angeles area will be covered in January Any desired data file format can benefit from INDEX By using its B Tree ISAM utilities Forth program mers can create and maintain keyed indexes
9. ning at 8 Mhz John Bumgarner and myself are of existing stacks two examples help il lustrate the simple extensibility of stack oriented co processing The first example involves a variant of integer computation Usually one integer is placed on the stack then a second integer is placed on the stack and in reverse polish fashion a com mand is given to multiply the two num bers for example 1234 5 x would produce 6170 0 OK My 8 Mhz 8086 Forth environment performs 3230 integer multiply oper ations per second or 3 23 KOPS pro nounced K OPS In the co processing case a similar sequence is repeated Again two num bers are placed on the stack But in stead of issuing a x command which would result in the 8086 multiplying the numbers four additional steps must take place 1 the first number must be moved to the co processor s stack the stack that physically resides within the 8087 chip for this the word W gt F defined in the 8087 assembler moves an integer or word from the data stack to the floating point stack 2 the second number must be moved to the 8087 stack again using W gt F 3 the numbers must be multiplied using Fx the floating point analog of x and then 4 the resulting number must be returned to the Forth data stack using F gt W which converts a floating point number to a 16 bit integer and transfers it to the top of the data stack The typed sequence 1234 5 W gt F
10. word as CODE x W gt F W 5F Fx F gt W NEXT The words in parentheses are the primitives of their colon level coun terparts CODE x operates on the stacks in an identical fashion as WF WF Fx FOW but at 45 45 KOPS Additionally after this word has been defined any subsequent applica tions of x uses the newer and faster definition The definition for integer multiply has been literally redefined This Forth feature is rarely found in other languages For example attempt ing to redefine the integer multiply in UCSD Pascal is next to impossible The Future of Stack Oriented Co processors and Forth Stack oriented co processors pro vide a means of extending a Forth sys tem For now numeric co processors are easily applied Their addition not only extends computations to include Volume V No 3 21 FORTH Dimensions floatingpoint calculations but also en ables microprocessor systems to rival larger mini and mainframe computers in number crunching ability In the near future other types of stack oriented co processors may become available including string and graphics co processors Until a Forth processor is available and maybe even after a Forth co processor chip also provides a means of extending a Forth system In the co processor approach very pow erful microprocessor systems can be built of various combinations of guest processors and host processors Ul tim
11. 3 EXECUTES FRINT 3 9 ENIICASE n B 1 TEST ONE OK C 2 TEST TUO OK n 3 TEST THREE OK E 4 TEST OK D E CASE Statement 20 FORTH Dimensions pEA E ls i SS SS O SS Forth Family Foiled Dear Editor First I heartily endorse your screen CRC words Forth Dimensions Vol IV No 3 Second I am looking for a nice Forth for Apple III CP M I am aware of several systems for Apple II but these require emulation mode and this hampers operations significantly The hard disk cannot be accessed with them and time is wasted loading the emulator Yesterday I told my two brothers in law who already own Apple Ms with CP M cards No problem there are lots of good Forths out there Today I spent an hour on the phone calling Forth vendors and struck out Is anyone out there catering to deluxe Apple III owners They want a com plete Forth system with full source code some meta compiler a screen editor maybe strings and floating 1 gett 1 sen MEAS point and perhaps some brief cus tomizing documentation Love Forth Gary Nemeth 2727 Hampton Rd Rocky River OH 44116 ENCLOSE Encounters of the Second Kind Dear Editor Reference ENCLOSE Encounters in the Technotes section of Vol V No 1 A line of code near the bottom of page thirty four was omitted It should have read HEX FIRST 2 400 BLANKS blanks a block buffer FIRST 2 BL ENCLOSE Thank you again for publishi
12. 94040 415 961 4103 MCA 8 Newfield Ln Newtown CT 06470 Metacrafts Ltd Beech Trees 144 Crewe Rd Shavington Crewe England CW1 5AJ Nautilus Systems P O Box 1098 Santa Cruz CA 95061 408 475 7461 OSI Software amp Hardware 3336 Avondale Court Windsor Ontario Canada N9E 1X6 519 969 2500 Offete Enterprises 1306 S B St San Mateo CA 94402 On Going Ideas RD 1 Box 810 Starksboro VT 05487 802 453 4442 Perkel Software Systems 1636 N Sherman Springfield MO 65803 Pink Noise Studios P O Box 785 Crockett CA 94525 415 787 1534 3 Professional Mgmt Services 724 Arastradero Rd 109 Palo Alto CA 94306 408 252 2218 4 Peopleware Systems Inc 5190 West 76th St Minneapolis MN 55435 612 831 0827 1 Quality Software 6660 Reseda Blvd 105 Reseda CA 91335 2 Quest Research Inc P O Box 2553 Huntsville AL 35804 800 558 8088 m 2 Rockwell International Microelectronics Devices P O Box 3669 Anaheim CA 92803 714 632 2862 1 Satellite Software Systems 288 West Center Orem UT 84057 801 224 8554 2 Saturn Software Ltd P O Box 397 New Westminister BC Canada V3L 4Y7 3 Shaw Labs Ltd P O Box 3471 Hayward CA 94540 415 276 6050 4 Sierra Computer Co 617 Mark NE Albuquerque NM 87123 5 Sirius Systems 7528 Oak Ridge Highway Knoxville TN 37921 615 693 6583 6 Software Federation 44 University Drive Arlington Hts IL 6000
13. EDITOR FOR DISK amp MEMORY This editor is a powerful FORTH software development tool featuring detailed terminal profile descriptions with full cursor function full and partial LINE HOLD LINE REPLACE and LINE OVERLAY functions plus line insert delete character insert delete HEX character display update and drive track sector display The EDITOR may also be used to VIEW AND MODIFY MEMORY a feature not available on any other full screen editor we know of This disk also has formatted memory and I O port dump words and many items published in FORTH DIMENSIONS including a FORTH TRACE utility a model data base handler an 8080 ASSEMBLER and a recursive decompiler The disks are packaged in a ring binder along with a complete listing of the FULL SCREEN EDITOR anda copy of the FIG FORTH INSTALLATION MANUAL the language model of FIG FORTH a complete glossary memory map installation instructions and the FIG line editor listing and instructions This entire work is placed in the public domain in the manner and spirit of the work upon which it is based Copies may be distributed when proper notices are included USA Foreign 3 FIG FORTH amp Full Screen EDITOR package AIR Minimum system requirements 80x24 video screen w cursor addressability 8080 or Z80 or compatible cpu CP M or compatible operating system w 32K or more user RAM Select disk format below soft sectored only 0 cc cece eee eee nee nnn 50 65 8 SSSD for CP M
14. I5 S8 S12 W2 Training vc b EE Y C3 F3 I3 P4 WI keep us informed on availability of the products and services listed Vendors may send additions and corrections to the Editor and must include a copy of sales literature or advertising 2 Elcomp Hofacker Tegernseerstr 18 D 8150 Holzkirchen West Germany Treway House Hanworth Lane Chertsey Surrey England KT16 9LA 08024 7331 Consumer Computers Telex 52 69 73 8907 La Mesa Blvd 3 Emperical Research Group La Mesa CA 92041 P O Box 1176 714 698 8088 Milton WA 98354 Creative Solutions Inc 206 631 4855 4801 Randolph Rd 4 Engineering Logic Rockville MD 20852 1252 13th Ave 301 984 0262 Sacramento CA 95822 Curry Associates P O Box 60324 F Palo Alto CA 94306 i 1 Fantasia Systems Inc 1059 The Alameda Belmont CA 94002 415 593 5700 53 Redrock Lane 3 FORTH Inc Pomona CA 91766 2309 Pacific Coast Highway 714 623 8314 Hermosa Beach CA 90254 Telex 29 81 91 213 372 8493 eat tl gg ge x 9 iia ate ee LE i FORTH Dimensions Volume V No 3 ann RE ERR RR REP iP ERG n U n H P A H 4 FORTHWare 639 Crossridge Terrace Orinda CA 94563 5 Frank Hogg Laboratory 130 Midtown Plaza Syracuse NY 13210 315 474 7856 6 FSS P O Box 8403 Austin TX 78712 512 477 2207 1 HAWG WILD S
15. RIGHTS and MID e BCD functions for 10 digit numbers including multiply divide and percentage BCD numbers may by used for DOLLAR CENTS calculations without the round off error inherent in BASIC real numbers Special words are provided for inputting and outputting DOLLAR CENTS values e Detailed manual with examples and applications screens Commodore 64 is a trademark of Commodore TO ORDER Specify disk or cassette version Check money order bank card COD s add 1 50 Add 4 00 postage and handling in USA and Canada Mass orders add 5 sales tax Foreign orders add 2096 shipping and handling Dealer inquiries welcome PERFORMANCE MICRO PRODUCTS 770 Dedham Street S 2 Canton MA 02021 617 828 1209 a7 wa Next Generation Micro Computer Products FORTH Dimensions THE FORTH SOURCE MVP FORTH C MVP FORTH Meta Compiler for CP M Programmer s kit Use Stable Transportable Public Domain Tools for applicatons on CP M based computer Includes public You need two primary features in a software development package a domain source 150 stable operating system and the ability to move programs easily and quickly to a variety of computers MVP FORTH gives you both these E MIT TURIN rasi rng Point for APPLE ogrammer features and many extras This public domain product includes an editor Ls Includes 9511 math chip on board with disk and FORTH assembler tools utilities and the vocabulary for
16. SXX put Hex constant of XX on stack EASE HERE 1 NUMBER ROT BASE COMPILE LITERAL IMMEDIATE SXXXX put 16 bit Hex constant of XXXX on stack COMPILE SXX IMMEDIATE 5 WIDTH CTRL X put Control character of X on stack HERE 6 C8 C L COMPILE LITFRAL IMMEDIATE 3l WIDTH 6 313 X DUPX DROPX TDH13DEC82 DECIMAL 3 WIDTH 3 DUPX dup x th item on stack HERE WIDTH LITERAL NUMBER DROP COMPILF LITERAL PICK IMMEDIATE 4 WIDTH DROPX drop x th item on stack HERE WIDTH LITERAL NUMBER DROP COMPILE LITERAL ROLL DROP IMMEDIATE 3 WIDTH 3S amp 314 NX SWAPXY TDH13DEC82 DECIMAL X addr stack addr get x th cell address C ASCII O 2 Sp 2 Y addr stack addr N get y th cell address l X 4 WIDTH SWAPXY swap the x th amp y th entries HERE WIDTH 1 LITERAL DUP X SWAP Y VSWAP 3l WIDTH LS IMMEDIATE End Listing Timothy Huang Portland Oregon This article and short program was stimulated by one of the L A FIG s handouts Screen 312 is basically a copy from that The word amp X functions similar to ASCII except that the parameter resides within the word i e the X The concepts from these words are so intriguing that I decided to explore them further Screen 313 As normal Forth will not allow the parameter to be passed within the word s name itself by adjusting the user variable WIDTH one can play the game of pa
17. Single Side Single Density Cromemco CDOS formats Single Side S D Density 0 8 SSSD O 8 SSDD D 5 SSSD O 5 SSDD Cromemco CDOS formats Double Side S D Density L 8 DSSD O 8 DSDD D 5 DSSD O 5 DSDD Other formats are being considered tell us your needs O Printed Z80 Assembly listing w xref Zilog mnemonics sees sieksvs 15 18 D Printed 8080 Assembly listing 0 ccc cece cece cere rece teen nent hh hn 15 18 TOTAL Price includes postage No purchase orders without check Arizona residents add sales tax Make check or money order in US Funds on US bank payable to Dennis Wilson c o Aristotelian Logicians 2631 East Pinchot Avenue Phoenix AZ 85016 602 956 7678 FORTH Dimensions 10 Volume V No 3 H E kati Su is t y Er wi ET Will Baden Costa Mesa California A problem many have with Forth is remembering where things are located The usual solution is to prepare a direc tory ie a screen with the names of things and the number of the screen which contains the thing named or if you are lucky enough to have a printer you can list a hard copy of an index which contains the first line of every screen Then you eyeball it for what you want A better way is to let Forth do the lookup for you Define a word which will search the directory find the screen number for you and then push it on the stack With this value you can list it
18. System Vendor Chart for others Curry Associates P O Box 11324 Palo Alto CA 94306 415 322 1463 Continued on page 32 Volume V No 3 FORTH Dimensions FORTH INTEREST GROUP Af Girardi ete d Farc te eee eee Al s Anto nire parnm zl MAIL ORDER USA CI Membership in FORTH Interest Group and 15 Volume V of FORTH OIMENSIONS f Back Volumes of FORTH DIMENSIONS Price per each 15 Ci ga ju LIV _ fig F ORTH Installation Manual containing the language model 15 of fig F ORTH a complete glossary memory map and installation instructions Assembly Language Source Listings of fig FORTH for specific CPU s and machines The above manual is required for installation Check appropriate box es Price per each 15 11802 6502 6800 _ 6809 vax zso 8080 8086 8088 9900 CJAPPLE 1 ECLIPSE PACE L NOVA POP 11 68000 L ALPHA MICRO L1 Starting FORTH by Brodie BEST book on FORTH Paperback 18 fc Starting FORTH by Brodie Hard Cover 23 PROCEEDINGS FORML FORTH Modification Conference C 1980 25USA 35Foreign 77 1981 Two Vol 40USA 55Foreign 7 1982 25USA 35Foreign ROCHESTER FORTH Conference 1981 25USA 35Foreign 7 1982 25USA 35Foreign 1 1 1983 25USA 35Foreign Total 1 STANDARD 7 FORTH 79 j FORTH 83 15USA 18Foreign EACH Total jc Kitt Peak Primer by Stevens An in depth self study book 25 7 MAGAZINES ABOUT FORTH BYTE Reprints 8 80 4 81 77 Dr Dob
19. Volume V No 3 i Dummy Name Field What it finds in stead is the Graft Field of VOC2 FIND then looks in this field gets the pointer to the Name Field of the last defined work in VOC2 and continues its search This same tricking of FIND occurs at each intersection in the tree until FIND finally ends up at the base of the tree in the FORTH vocabulary at the Link Field of LIT where it finds a zero and exits The term vocabulary has been carried over from pre FIG Forths where it had a meaning closer to what one would expect A more descriptive name for the FIG Forth version might well be VOCABULARY BRANCH To review in the current setup in FIG Forth 1 Dictionary searches may repeatedly search various voca bularies within one search For instance the FORTH vocabulary is generally searched twice 2 Dictionary searches search all of each vocabulary branch through which they pass not just the part below the intersec tion Chronology of defini tions does not per se determine the search path Where does this lead us The struc ture can be customized to an extent once it is understood for instance storing a zero into a word s link field can stop a search or redirecting a link can alter the search pattern Remem ber though that some definition for the word whose name is the null char acter must remain in the search chain or the system won t know how to deal wit
20. W gt F Fx FOW would produce again 6170 OK completing a draft of an article on An Exten sible Assembler for the 8087 The 8087 was placed in a copper girdle only recommended for Forth artisans to enhance heat dissipation at the increased clock frequency thank you TZ I have also been beta testing a newer non girdled 8 Mhz 8087 thank you LM JT DC In this case more is less Even though four steps are required the 8086 8087 actually performs floating point multiplication at 29 41 KOPS The addition of a numeric co processor increases the computational speed for integer multiplication by about nine times As a side point the NDP is capable of performing in excess of 88 8000 floating point multiplies per second But the observed computational speed is slower due to the overhead needed to run Forth What if a Forth co pro cessor chip existed for DOCOL SEMIS and NEXT The second example of stack orient ed co processing involves extending the Forth environment This example is an extension of the first one A significant difference between Forth and other languages and or environments is the Divide Test Conquer approach first divide the application into easily test able parts test each part and then con quer the application Having already tested the fast variant of an integer multiply we can now define a new word and extend the vocabulary For added clarity let us define the new
21. concepts causes a problem It is difficult to judge the impact of some of these technical or philosophi cal concerns Time and experience will tell whether the decisions made for Forth 83 were correct Although it is difficult we must temper our frenzy for having a new standard with a striv ing for reasonable perfection of the standard Volume V No 3 Ee a OC c Letters Continued from page 4 8080 Conditions Dear FIG John Cassaday left conditional calls out of his 8080 assembler which he published in Forth Dimensions Vol III No 6 I have written a single word that adds all the 8080 conditional calls to his assembler IFCALL SP OD TOGGLE C The stack for proper use is lt call addr gt conditional Where conditional is any one of John s words 0z CS PE or 0 lt and an optional NOT John s conditional words leave an 8080 conditional jump op code on the stack My word toggles bits in it to make it into the appropriate conditional call op code The call ad dress must be next down on the stack A LABEL word can be used to define the entry point to the subroutine Using similar techniques I have also written words for conditional return from subroutine and conditional jump IFRET SP 0A TOGGLE C IFJMP SP 08 TOGGLE C IFJMP needs a jump address on the stack under the conditional but IFRET of course needs only a conditional on the stack I think these words are
22. dictionaries for SCR 769 multi tasking full screen color and M C EL dar HEX provision for DOS compatible named 2 RDclear mark all buffers empty disk files The RAMDisk program gosse DUF RAM 11 k SWAP presented here is a subset of my pro 5 DEB o accesu x Bubter 3 gram the omitted material pertains b o0 E mark buffer unused mainly to presenting the RAMDisk to s POSUERE 8 THESIS S the user as a DOS file 9 RDseg blk blk sets EB to buffer start 10 DUP RAMBLK get offset 1i 11 x RAMSEG ER calculate buffer address This program makes use of several EEA veut words from past issues of Forth Di 14 mensions the Kitt Peak GODO and the 15 modular programming words INTER NAL EXTERNAL and MODULE These SER T ae s X definitions are presented for reference Au E ge et The extended segment load and store 2 RDwrite bfr blk copy relative block z z i words EC EC E and E in my sys gt pees wae PERSE DIBBBNE Y tem address the segment defined by a 5 61 IOC39 FC AND quit beep user variable EB Extended Base My s E a input output words are 10 IO IOCQG 8 o E write block number and JOC The meaning is obvious and 7 102 2 DO ivalent d ist i th 10 DUF 3 I E 2 t copy block to RamDisk equivalent words may exist in other il 2 LOOP DROP 8086 88 Forths or may be coded by the 12 een A A user The assembler words used in a SEO
23. grating problem is that the FST itself is always trying to allow a wide variety of actual or possible im plementations This has caused some problems and ambiguities within the standard This is more an underlying political problem than a technical one but the results affect the standard tech nically e The right bracket definition is ambiguous Different systems are im 28 plemented such that the same sup posedly transportable standard program produces different results on the different systems e Vocabularies have always been a problem The standard attempts to resolve this issue but actually leaves some gaping holes Because search or ders are not definitively stated a stan dard program will have some difficulty using vocabularies and search orders Consumers will have great difficulty determining if a system is actually Forth 83 Although this has always been a problem it will be worse this time because 79 Standard systems have been marketed Implementors will have difficulty determining or choosing to make some of the subtle changes from 79 Standard The standard should codify existing practice Instead new concepts have been accepted without a complete test bed existing with which to gain experience In most cases these new concepts are going to be proven correct but what about the ones that aren t Where will we be in four or five years if next month we find that one of these insufficiently tested
24. meet current needs Since Forth is in tentionally extensible this means molding the environment to fit the situation by enhancing the dictionary Occasionally increasing the vocabu lary is not sufficient and more direct enhancements are needed in the form of hardware as in floating point com putation This paper focuses on hardware en hancements to the Forth environment It briefly reviews the structure of Forth introduces co processing out lines the 8087 numeric processor with example words and suggests the future of stacks in Forth The Structure of Forth Forth is a unique interactive lan guage environment It is an example of what Loeliger 1981 calls a thread ed interpretive language Additional ly Forth utilizes stacks as do other languages like UCSD Pascal But it is more than just an interactive stack oriented threaded interpreter The sum in this case is greater than the in dividual parts Hofstadter s 1979 description of strange loops form ing emergent phenomena is appropri ate for describing what happens in Forth an interaction between levels in which the top level reaches back down towards the bottom level and in fluences it while at the same time be ing itself determined by the bottom level p 709 Using this analogy the stack resides near the bottom level of Forth The stack is a temporary place to store and transpose elements Usually stack ele men
25. non technical incompatibilities to the prior standard or existing systems specific technical points and general philosophical points This is an overview of some of those concerns The new standard is almost com pletely reworded This was done to make it more readable yet this generated some fairly minor concerns the most obvious being the process of locating underlying technical aspects that were actually changed In fact the new wording actually changed the published version of the standard so that BASE and D reflect a technical change from the 79 Standard The new standard is incompatible with prior systems partly because the function of many words changed yet the word names remained the same These functional changes range from Obscure to obvious This shows itself in the following ways e PICK and ROLL were changed with no strong technical reason from 1 origin to O origin totally invalidating prior source code e Many changes were made albeit for valid technical reasons which are not always incompatible These are the most dangerous since when the incom patibility crops up it is often buried in side a previously functional definition The following changes affect many standard words The true flag 1 returned from standard words provides some extra power but can be incompatible if the flag is used in calculations Division is now floored towards negative infinity rather than towards zero
26. or do anything else you want with it NAME word LIST This will list the screen where word is located A directory consists of alternating names or subjects and associated values in free format beginning on the second line of each screen The first line is reserved for heading and date To begin with line O instead of line 1 change C L to 0 in CONNIVE A fragment of a directory is shown in Figure One and will be used in our examples SCR 78 DIRECTORY WWE WWB 830714 INITIAL 30 STARTING FORTH 32 KERNELS 96 SOLO 98 TRACE 89 FORMATTER SO PRINT 66 DISCARD 100 RECREATE 100 RELOAD 190 FHONES 49 DOC DIR 45 DOC DIR END 47 SORT 120 SORTED 130 ID 131 NAMES 1322 ALLNAMES 132 NAMES 132 SWORDS 133 Figure One Of course the values in a directory do not have to be screen numbers They could be anything that you want e g phone numbers part numbers or operating system constants Directories do not have to be in a neat order and the user is responsible for maintaining them Obviously it is helpful if there is some semblance of order For best performance the most frequently used words should be at the beginning If you want to list the screen where the word SWORDS is located then all you have to do is type NAME SWORDS LIST or you can say VIEW SWORDS and the result will be the same VIEW is defined VIEW name NAME LIST This will list screen 133 where SWORDS is defined The word SWOR
27. save angle 3 gt R save n x KN convert n y 4 R gt KN convert n x R gt retrieve angle gt double 5 2UP D lt IF 16384 D 2ROT 2ROT DMINUS 2SWAP 2ROT 6 ELSE 16384 D 2ROT 2ROT 2SWAP DMINUS 2ROT THEN 7 14 DO 8 2DUP D lt IF 9 I RVSUBl D I RVSUB2 D I RVSUB3 D ELSE 18 I RVSUBl D I RVSUB2 D I RVSUB3 D THEN 11 LOOP 2DROP drop d angle 12 D gt S gt R D S P gt 13 14 15 Screen 32 crc 49282 9 CORDIC ALGORITHM 1 single precision angular conversions 2 PIRADIANS MINUS 32768 ROT ROT 3 DEGREES 1890 PIRADIANS 4 s POLAR gt rad ang y x ROT ROT ROTVECTOR 5 6 7 8 9 18 ll 12 13 14 15 S End Listing FOR 8080 Z80 8086 68000 MULTIUSER MULTITASKING A professional quality full feature FORTH system at a micro price TaskFORTH Single double triple quadruple and floating point math trigonometric functions Case statements Interactive debugger Novice Programmer Protection Package Multiple thread dictionary System date calender clock Hierarchical file system Screen and serial editor Inter task communications Unlimited number of tasks Starting FORTH FORTH 79 and FORTH 83t compatible Graphics support TaskFORTH is the FORTH system you would write if you had the time ALL included for just 395 plus applicable taxes Available for
28. the best selling ocumentation 400 book Starting FORTH The Programmer s Kit provides a complete C MVP FORTH Programming Aids for CP M IBM or APPLE FORTH for a number of computers Other MVP FORTH products will Programmer s Kit Extremely useful too for decompiling simplify the development of your applications callfinding and translating 150 MVP Books A Series CJ MVP FORTH by ECS Software for IBM PC or ATARI 2 Volume 1 A about FORTH by Haydon MVP FORTH 400 800 Standalone with screen editor License required glossary with cross references to fig FORTH Starting FORTH Upgradeable 100 and FORTH 79 Standard 2 4 Ed 25 O MVP FORTH by ECS Software for IBM PC or ATARI 400 800 D Volume 2 MVP FORTH Assembly Source Code Includes Enhanced with color animation multitasking sound utilities CP M IBM PC and APPLE listing for kernel 20 and unlimited run time license 175 O MVP FORTH Professional Application Development System PADS for CP M IBM PC or APPLE A three level integrated system with complete documentation Complete system 400 MVP FORTH Software A Transportable FORTH L MVP FORTH Programmer s Kit including disk documen tation Volumes 1 amp 2 of MVP FORTH Series All About MVP FORTH PADS enhanced virtua system 150 FORTH 278 Ed amp Assembly Source Code and Starting O MVP FORTH PADS Programming Aids 150 FORTH Specify O CP M O CP M 86 O CP M O APPLE O MVP FORTH PADS Meta Compiler 150
29. the new word s name High bit of last character will be set with very occasional machine depend ent variations e g on 6502 systems Link back to name field address of the previous word defined in the cur rent vocabulary i e the vocabulary in which the word NEWVOC is defined All normal so far The lt BUILDS DOES gt code field address es This field is generally four bytes long though the shorter faster two byte renderings are gaining pro minence This need not concern us now You can tell how long this field is by looking for 81 AO which will follow it 81 AO This is how A081H will show up in the dictionary It is a Dummy Name Field with name of length one the 1 in 81 and actual ASCII name 20 with high bit set to become AO ASCII 20H is a blank which was chosen be cause it was rather unlikely to occur as an actual name in a working system Back to this in a moment It s not clear if this field has another name but calling it the Graft Field is useful for the moment as this field helps in grafting the new vocabulary onto the vocabulary tree The Graft Field in a vocabulary name word like NEWVOC or FORTH is the actual field that is pointed to when we say some thing like CONTEXT points to NEW voc Right after NEWVOC is defined the Graft Field of NEWVOC points to the Dummy Header Field of the vocabu lary in which it was defined In the tree Volume V No 3 in Figure On
30. think could pro vide an improvement in readability of Forth programs do the control struc tures have to be in reversed polish no tation or wouldn t it fit in the Forth concept otherwise How about control structures as below FIG Forth 79 DO LOOP cond IF true THEN cond IF true ELSE false THEN BEGIN cond UNTIL BEGIN cond WHILE true REPEAT Other version kept as it is IF cond THEN true ENDIF IF is only documentary THEN checks condition ELSE is as before BEGIN UNTIL cond FULFILLED BEGIN is where to jump UNTIL is documentary FULFILLED is formerly UNTIL WHILE cond REPEAT true ENDWHILE WHILE marks where to jump REPEAT checks if cond is true ENDWHILE jumps to WHILE What do you think about it Horst G Kroker HCH V Meissen Str 37 Mainz LL2 6500 W Germany Model Behavior Dear FIG While working with a FIG Forth sys tem I found a couple of things which may be of interest for inclusion in other compilers First there is a bug in the model s implementation of the logic associated with PAIRS which al lows the construct IF ELSE ELSE ELSE THEN to be compiled without error The ex ecution of the resulting code is enter taining but not particularly useful I would suggest fixing it via the follow ing changes to the model Screen 40 PAIRS AND O 13 ERROR Screen 73 ENDIF COMP 6 PAIRS HERE OVER SWAP IMMED
31. used to implement im mediate words is through a new defin ing word called T which behaves just like Forth s except that the definition it creates is placed in the target vocabulary or symbol table As you recall from last time the main compil ing loop looks up words in the symbol table and executes them Words that are defined by CODE and are placed in this symbol table and when executed compile themselves By using T we can place words into this symbol table that do things other than compile themsel ves For example would have to first compile the run time for namely and then get the string and compile it into the target image This is totally different behaviour from say the meta version of DUP which simply compiles a pointer to the code field of DUP when it is executed Thus for each immediate word that passes through the meta compiling process we must define a special case compiling word that does the right thing in the meta context Now I must apologize for not providing any code this time around The problem is that all of the issues I discussed above are implemented in a very system dependent manner hence I would have to make a lot of assump tions about exactly how vocabularies work and how different system details operate Rather than do that and pro vide code that would not run on any existing systems I decided not to pro vide any code but simply to discuss some of the remaining c
32. vocabulary concepts of Wil liam F Ragsdale Many were already using the concept and were pleased with its performance Wil added some FORTH Dimensions x B ex H x 73 es A e a RT ieee aa ae mem _e eee mam See ee aa at C muse ane bd ona aa et Gey GG Eo Pe ee ee a me eas eS EER OED TERNS aS n i 2 A 6s EE SEE qa TEE EE c oe nl es 3 UR ACE UR UA BARAK A FORTH BF 4 d RAFA AMBRE RAAT REE RR E TRR IEEE E i CRIT Hd amp 6 LtABiRXEO xGbER4DE MSA AD HE Neue dE PREZA m FRPHRA REA HANTE HM Ae H2 A AG RK EF O 00 12 00 HARA FF 1 30 3 30 Hg we 398 Poate RAK 121 ROS et R a5 3311316 3814907 08 adea c KALEKE AHS amp 3b 5 RRBAR LOM EAH 12 i t3 Poly FORTH amp 1983 F4 FORTH 43 amp 3E Ar 2 Multitasking amp multiprogramming 0 Target compilation Case study Control Case study Database KA RAM TET COLIT ERE x3 WORFORTH E 4 FIG GARDE CP 3EREFORTH32E Z EH WA FH HAAR 9 RA ETH PS it i BR 150 121 KI W O RH ob iit 8 D News from the FIG Chapter of Taiwan 34 Volume V No 3 words that increased its performance Zane Thomas is implementing a modem system for the Orange County Chapter to transfer screens Bob Snook presented a short discussion on alternatives to CASE statements William Vock who was visiting Greg Stevenson and collaborating with him on the develop
33. words that are not yet defined Since June 1982 this system has been installed on Apple Atari CP M and Heath Figforth Micromotion Forth79 MVP Forth and the Starting Forth dialect The following utility words or their equivalent are required MORE returns address true if there are more words in the input stream address false if the input stream is ex hausted Our definition should work for any system even when B SCR is not 1 On a standard system the definition may be replaced with MORE a f BL WORD DUP C See Suralis and Brodie Checksum for Hand Entered Source Screens Forth Dimensions Vol IV No 3 p 15 INTERPRET A WORD interprets the next word in the input stream NUMBER is like the Starting Forth word and returns a number or double number In FIG Forth you will have to remove the parenthesis marks from DPL 0 lt IF DROP THEN DEFINED returns a compilation ad dress which can be executed and a true flag if the next word is defined or a string address which can be further massaged and a false flag if the next word is unknown It can be replaced with NOT in some systems HAVE returns TRUE or FALSE depending on whether you already have the next word or not In Forth79 you may replace it with FIND All that is required of COMPARE is that strings at HERE and PAD can be compared for equality INTRIGUE can be adapted to use the Starting Forth TEXT or the FIG Forth TEX
34. yet more ex amples of an amazing property of Forth the solution to a problem is usually less complicated than you think it will be Sincerely Paul E Condon 6219 Rockwell St Oakland CA 94618 Yet Another Case Statement The main feature of this CASE is the technique used It is presented as an educational example of the power of Forth In this example CASE is a defin ing word which creates TEST If you ll notice in the definition of EXECUTES it looks like Pm jumping into the PFA instead of the CFA This is because I am I was going to explain this but after giving it some thought I decided that it would be more beneficial to our fellow Figgers to present it as a puzzle By the time you figure it out you will under stand DOES the return stack and the Forth compiler inside out As far as how this CASE compares to other CASEs it compiles much smaller than most it branches to ENDCASE up on finding a match and executes about as fast It will only execute one word after EXECUTES and that must be a word created in a colon definition I don t use this CASE myself nor do I think it best It s just an example of the unusual If you figure it out it will help you understand Charles Moore s BASIC compiler Vol III No 6 which is even trickier Good luck Marc Perkel Perkel Software Systems 1636 N Sherman Springfield MO 65803 Searching for Graves Dear FIG I read with interest the letter from Nick Fran
35. 0 CP M 1 4 amp 2 x amp NorthStar DOS Users The complete professional software system that meets ALL provisions of the FORTH 79 Standard adopted Oct 1980 Compare the many advanced features of FORTH 79 with the FORTH you are now using or plan to buy FEATURES OURS OTHERS 79 Standard system gives source portability YES Professionally written tutorial amp user manual 200 PG Screen editor with user definable controls YES Macro assembler with local labels YES Virtual memory YES BDOS BIOS amp cunsole control functions CP M YES FORTH screen files use standard resident file format YES Double number Standard amp String extensions YES Upper lower case keyboard input YES APPLE 1I II version also available YES Affordable 99 95 Low cost enhancement options Floating point mathematics YES Tutorial reference manual 50 functions AM9511 compatible format Hi Res turtle graphics NoStar Adv only YES FORTH 79 V 2 requires CP M Ver 2 x ENHANCEMENT PACKAGE FOR V 2 Floating point COMBINATION PACKAGE Base amp Floating point advantage users add 49 95 for Hi Res CA res add 6 tax COD amp dealer inquiries welcome 99 95 49 95 139 95 MicroMotion 12077 Wilshire Bivd 506 L A CA 90025 213 821 4340 Specify APPLE CP M or Northstar Dealer inquiries invited polyFORTH Il The Operating System and Programming Language designed especially for REAL TIME APPLICATIONS e Ro
36. 0 STA RET Now we can invoke Forth as follows TEST1 SUB1 Or from a machine language word as follows SUB1 from CODE TEST2 SUBI CALL NEXT JMP END CODE The advantage we gained by all this manipulation is that the definition of SUB1 is unchanged whether it is used by a colon or code word then jumps to NEXT a constant containing the address of the zero in the above definition a word which calls the subroutine at addr write the desired subroutine address over the zero in definition of CALL and execute CALL Figure One CODE CALL a word which calis a CD C 0 equivalent NEXT JMP equivalent FND CODE CALL 14 CONSTANT CALL ADDR CALL addr CALL ADDR CALL SUBROUT INE create a code subroutine useable either from colon or code definitions LCOMPILE ASSEMBLER CREATE DOES CALL invoke assembler vocabulary create a header for the subroutine this happens when subroutines so defined are invoked from FORTH Figure Two inner Access holds the key to your software solutions When in house staff can t solve the problem make us a part of your team As specialists in custom designed software we have the know how to handle your application from start to finish Call us for some straight talk about Process Control Bi Automated Design E Database Management m System Software amp Utili
37. 0796 1 Capstone Computing Inc 5640 Southwyck Blvd 2E Toledo OH 43614 419 866 5503 2 Chrapkiewicz Thomas 16175 Stricker East Detroit MI 48021 3 CMOSOFT P O Box 44037 Sylmar CA 91342 COMSOL Ltd Elcomp Publishing Inc Computers Alpha Micro P3 S4 ADDIE iis ebore SAY bb AA El E2 F4 12 I5 Ji LA M2 M6 M8 02 O3 Alar ooi oot end px REOR RN El E2 M6 P2 QI V1 Compad Jede epis ERE M5 CYOMEMCO 6 4 ice eee ser ER ER AS M2 M6 DECPDP LSI 11 C3 F3 L2 S4 Heath 89 es M2 M6 M7 Hewlett Packard 85 Hewlett Packard 9826 36 CS IBM PG s kun T o eg A8 C3 F3 L1 M5 M6 Q2 S8 W2 IBM Other s L3 Wi Kaypro II Xerox 820 M2 Micropolis sess A2 M2 S3 North Star I5 M2 Pi S11 NOVA s bo d ux CO s C6 Ohio Scientific A6 B1 C4 O1 S7 T2 OSBORNE vd eSCRI D eda M2 Pet SWTPC Al A6 Bl C3 OI S7 12 TS Poly Morphic Systems A7 TRS 801I H and or HI 15 M2 M5 M6 S5 S6 S9 TRS 80Color A3 A8 F5 M4 TI Vector Graphics M2 Other Products Services Applications P4 Boards Machine F3 M3 P4 R2 S10 Consultation C3 C5 NI P4 T3 W1 Cross Compilers C3 F3 13 M6 N1 P4 Products Various AS B2 C3 C7 F3 14
38. 4 312 259 1355 7 Software Works The 1032 Elwell Ct 210 Palo Alto CA 94303 415 960 1800 8 Spectrum Data Systems 5667 Phelps Luck Dr Columbia MD 21045 301 992 5635 9 Stearns Hoyt Electronics 4131 E Cannon Dr Phoenix AZ 85028 602 996 1717 10 Stynetic Systems Inc Flowerfield Bldg 1 St James NY 11780 516 862 7670 11 Supersoft Associates P O Box 1628 Champaign IL 61820 217 359 2112 12 Sylmar Software P O Box 44037 Sylmar CA 91342 1 Talbot Microsystems 1927 Curtis Ave Redondo Beach CA 90278 2 Technical Products Co P O Box 12983 Gainsville FL 32604 904 372 8439 3 Timin Engineering Co C o Martian Technologies 8348 Center Dr Suite F La Mesa CA 92041 619 464 2924 4 Transportable Software P O Box 1049 Hightstown NJ 08520 609 448 4175 1 Valpar International 3801 E 34th St Tucson AZ 85713 800 528 7070 1 Ward Systems Group 8013 Meadowview Dr Frederick MD 21701 2 Worldwide Software 2555 Buena Vista Ave Berkeley CA 94708 415 644 2850 1 Zimmer Tom 292 Falcato Dr Milpitas CA 95035 Boards amp Machines Only See System Vendor Chart for others Controlex Corp 16005 Sherman Way Van Nuys CA 91406 213 780 8877 Datricon 7911 NE 33rd Dr 200 Portland OR 97211 503 284 8277 Golden River Corp 7315 Reddfield Ct Falls Church CA 22043 Triangle Digital Services Ltd 23 Campus Road London E17 5PG England Application Packages Only See
39. 8S 4K1 416 525 9140 ext 2065 Quebec Chapter Call Gilles Paillard 418 871 1960 or 418 643 2561 e COLOMBIA Colombia Chapter Contact Luis Javier Parra B Aptdo Aereo 100394 Bogota 214 0345 e ENGLAND Forth Interest Group U K Monthly 1st Thurs 7 p m Rm 408 Polytechnic of South Bank Borough Rd London Contact Keith Goldie Morrison 15 St Albans Mansion Kensington Court Place London W8 SQH e ITALY FIG Italia Contact Marco Tausel Via Gerolamo Forni 48 20161 Milano 02 645 8688 NETHERLANDS HCC FORTH Interest Group Chapter F J Meijer Digicos Aart V D Neerweg 31 Ouderkerk A D Amstel The Netherlands SOUTH AFRICA Contact Edward Murray Forthwith Computers P O Box 27175 Sunnyside Pretoria 0132 SWITZERLAND Contact Max Hugelshofer ERNI amp Co Elektro Industrie Stationsstrasse 8306 Bruttisellen 01 833 3333 TAIWAN Taiwan Chapter Contact J N Tsou Forth Information Technology P O Box 53 200 Taipei 02 331 1316 e WEST GERMANY West German Chapter Klaus Schleisiek FIG Deutschland Postfach 202264 D 2000 Hamburg 20 West Germany SPECIAL GROUPS Apple Corps FORTH Users Chapter Twice Monthl Ist amp 3rd Tues 7 30 pm 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 Call Howard Pearlmutter 408 425 8700 MMSFORTH Users Group
40. ATURES First Multi FORTH installation in De Saves and restores current system image cember 1979 installed base of over 200 without recompiling for turnkey appli sites cations systems from Creative Solutions tnc MULTITASKING EXTENSIVE DOCUMENTATION Since the beginning Multi FORTH M has Current user manual is over 350 pages supported multiple background tasks and optional multiple users ONLINE CAI COURSE HELP FEATURES 16 OR 32 BIT IMPLEMENTATIONS GRAPHICS AND FLOATING POINT 16 bit 79 Standard or 32 bit unlimited SCREEN EDITORS ON HP SERIES 200 program size implementations available OR MOTOROLA VME 10 FAST LJ LJ i MOST SINGLE BOARD COMPUTERS ARE E h ratosthenes Sieve Benchmark in under 18 SUPPORTED ds f in hi seconds for 10 passes in high leve VME110 KDM ECB VM0O1 VMO2 IN LINE ASSEMBLER OB68K BRI DUAL ERG CP M68K BUILT IN TRACE DEBUG FEATURES installations 8 media PRICES START at 1 295 fora SINGLE COMPUTER LICENSE HP Series 200 32 bit version OK I m interested Please send me more information about the Multi FORTH system Name __ Company Address Phone Hardware Type 0 4801 Randolph Road le Y Creative Solutions Inc Rockville Maryland 20852 301 984 0262 Multi FORTH is a registered trademark of Creative Solutions Inc FORTH Dimensions Volume V No 3 FORTH Dimensions Published by FORTH Interest Group Volume V No 3 September October 1983
41. CP M Northstar DOS Micropolis and Stand alone Visa amp MC Accepted Available soon t When standard is approved CP M is a trademark of Digital Research TaskFORTH is a reg trademark of Shaw Labs Ltd Single user single computer license agreement is required SHAW LABORATORIES LIMITED 24301 Southland Drive Suite 216 Hayward California 94545 415 276 5953 En a M I M 9 EI n Nni DPIs v sre amp Volume V No 3 25 FORTH Dimensions Standards Corner Robert L Smith Sunnyvale California As many readers are aware the Forth 83 Standard has been approved by the Forth Standards Team By the time you read this copies of the stan dard should be available from the In stitute for Applied Forth Research MicroMotion or Mountain View Press The majority of members of the Forth Standards Team are vendors or potential vendors of Forth systems and applications The Forth 83 Standard represents a substantial input from the team members the referees and the Forth community Literally hundreds of proposals were received and ex amined In contrast to the past there were two major meetings of the Stan dards Team as a whole and very many meetings of the referees The result is a document of substa
42. DS after NAME or VIEW is sought in the direc tory the number 133 which follows the word SWORDS is pushed onto the stack and screen 133 is listed You can define other words like VIEW to per form any operation with the number on the stack If you want to load that screen then another word named NEED can be used e 2 NEED SWORDS This will search the current working directory screen and then load the screen which has SWORDS defined on it It checks to see if the word which is needed has been already defined if so it will not be loaded again This word is very useful since it can load other screens when and where they are needed See Figure Two Screen 133 is SCR 1353 SWORDS SORTED WORDS NEED SORT NEED IDZ SWORDS NAMES A N DUP CR 2DUP SORTED ID NAMES An Easy Directory System If any of the words needed are not already defined they will be loaded before the rest of the screen This way you can load the screens in any order as long as you have stated on each screen what words need to be loaded before that screen When screen 133 is loaded it checks for SORT ID lt and NAMES If any of these is not defined it will load screen 130 131 and or 132 as appropriate It then checks for NAMES which just hap pens to be on the same screen as NAMES and so will always be already defined NEED something else may have been used on needed screens and so forth This way all words
43. ED STAFF 213 577 1471 Hofstadter D R Godel Escher Bach an eternal golden braid New York Basic Books 1979 Loeliger R G Threaded Interpretive Languages Peterborough NH Byte Books 1981 Palmer J Nave R Wymore C Koehler R amp McMinn C Making Mainframe Mathematics Accessible to Microcomputers Electronics 8 May 1980 pp 114 121 Rash B Application Note AP 113 Getting Started with Numeric Data Processors Intel Corporation Feb ruary 1981 Simington R B The Intel 8087 Nu merics Processor Extension Byte 8 4 1983 pp 154 172 iAPX 86 88 USER S Manual Intel Corporation 1981 SUPPORTS DEVELOPMENT FOR DEDICATED APPLICATIONS INTERACTIVELY TEST HEADERLESS CODE IN PLACE COMPILATION OF ROMABLE TARGET CODE MULTIPLE PURGABLE DICTIONARIES FORTH 79 SUPERSET AVAILABLE NOW FOR TEKTRONIX DEVELOPMENT SYSTEMS 2250 MICROSYSTEMS INC 2500 E FOOTHILL BLVD SUITE 102 PASADENA CALIFORNIA 91107 FORTH Dimensions 22 Volume V No 3 P 9o i Code and Colon Compatibility David Held Hermosa Beach California I recently developed an approach to a problem which may be of interest to others I was developing a communica tions application in Forth 79 which would require some code definitions due to speed requirements For the development process however I preferred to begin with colon defini tions planning to convert pr
44. IATE DO COMPILE DO HERE 8 IMMEDIATE LOOP 8 PAIRS COMPILE LOOP BACK IMMEDIATE LOOP 8 PAIRS COMPILE LOOP BACK IMMEDIATE Screen 74 ELSE 2 PAIRS COMPILE BRANCH HERE O SWAP 2 COMPILE ENDIF 4 IMMEDIATE Use of a bit masked test thus allows THEN to follow either IF or ELSE but only allows ELSE to follow IF which is what we want The other thing is a compiler speed up enhancement I had always won dered why the dictionary search scan ned each entry character by character even though the length was known but just chalked it up to one of the mys teries of Forth that I d figure out some day It should be noted incidentally that I always use a WIDTH of thirty one Just recently however I found out how things work with a width of less than thirty one I think so I see the basic reason However I believe that things could be speeded up dramatical ly by just using the lower of WIDTH and the length found in the dictionary header as an increment to skip to the end of the name I use a 6801 based FIG system which was so modified and the compile times went down by over thirty percent for one system around 300 screens would you believe Best regards Mike Armstrong 7502 S W 143rd Ave Miami FL 33183 Continued on page 29 Volume V No 3 FIG Forth Vocabulary Structure Evan Rosen Bayside New York Vocabulary structure and linking in FIG Forth is a clever and complex a
45. Interpretive FG amp 79 140 IBM Z80 or 8086 y ae i D FORTH Fundamentals Voi Languages ves C ATARI by PNS FG amp X O Software Floating ix undamenta s vo y PNS F G amp X 90 Point 100 ll by McCabe 13 METAFORTH by L CP M by MM F amp 79 140 CJ 8087 Support Ij D Beginning FORTH by Cassady 30 Apple GraFORTH by 75 IBM PC or 8086 100 Chirlian 17 O Systems Guide to fig D Multi Tasking FORTH by SL O 9511 Support O FORTH Encyclopedia FORTH 25 CP M X amp 79 395 Z80 or 8086 100 Pocket Guide 7 invitation to FORTH 20 G TRS 80 or Ill by MMS C BURNS 3 O And So FORTH by Huang A O PDP 11 User Man 20 T B OA 190 er ida H college level text 25 O FORTH 83 Standard 15 LJ M xs by FD tape G X p Management 200 CL FORTH Programming by CO FORTH 79 Standard 15 Requires LM FORTH disk Scanlon 17 FORTH 79 Standard IH includes Victor 9000 by DE G X F2 O FORTH on the ATARI by E Conversion 10 Arung 95 150 Floegel 8 I NOVA fig FORTH by CCI i isti 15 C fig FORTH Programming Aids for decompiling callfinding U Starting FORTH by Brodie Source Listing and translating CP M IBM PC 280 or ADOS 150 Best instructional manual C NOVA by CCI User s Manual available soft cover 18 includes editor assembler CROSS COMPILERS Allow extending modifying and compiling for Speed and memory savings can also produce ROMable code eRequires FORTH disk hard cover 23 and uti
46. M or Epson printer 2 0 0 0 0 0 ccc ee Rh Ih hn 100 00 Nautilus Cross Compiler allows you to expand or modify the FORTH nucleus recompile on a host computer for a different target computer generate headerless and ROMable code Supports forward referencing Produces executable image in RAM or disk file No license fee for applications Prerequisite Application Development System for host computer Hosts 2 80 CP M 2 2 or MP M Il 8086 88 CP M 86 or MS DOS IBM PC PC DOS or CP M 86 68000 CP M 68K Targets 8080 2 80 8086 88 6502 LSI 11 68000 1802 Z 8 Cross Compiler for one host and one target 0 0c cece eee enn 300 00 Each additional target o deere ri Qo EVE WO e desee ER e Oboe RUE ae desc s Sot scs 100 00 AUGUSTA ADA subset compiler from Computer Linguistics for Z 80 computers under CP M 2 2 90 00 LEARNING FORTH computer assisted tutorial by Laxen and Harris for CP M includes Brodie s Starring FORTH 8 format only nouae ex y 0 dese EC p eE RATS RH CN a rt URL ROC E o e ec a 95 00 Z 80 Machine Tests Memory disk printer and console tests with all source code in standard Zilog InHOImorni6S ve Lea avo o e dei Stc noce mte Arp Sd deos Sada eap Sob quip OREO EES Se ee Mar 50 00 8080 and Z 80 application development systems require 48 kbytes RAM and 1 disk drive 8086 and 68000 require 64 kbytes Prices include shipping by UPS or first class mail within USA and Canada California re
47. T instead CONTINUED is from the reference word set and goes to a screen with no return It is used in the definition of FOLLOW A named gt can be done NAME word CONTINUED If B SCR is not 1 then remove the parentheses from around B SCR x in CONTINUED and CONNIVE First Screen of FORMATTER Directory FMT K amp P WWR 830714 LINES 230 230 DATE 230 DATE 230 TODAY 230 PAGELEN 231 PAGEWIDTH 231 HUGE 231 MAXSTRING 231 CURPAGE 23 LINENG 222 PLVAL 2232 MIVAL 232 M2VAL 232 MSVAL BOTTOM 232 HEADER 232 FOOTER 232 FILLING 223 RJUST 233 LSVAL 233 SFVAL ULVAL 233 QUTP BETWEEN 234 CAP 233 INYAL 233 RMVAL 233 TIVAL 23 234 QUTW 234 QUTWDS 234 DIRECTION 259 DATE 235 224 ALLCAP 234 OUTEUF 234 DATE 2 NEWPAGE 23 232 MAVAL 23 PI 4 CEVAL 233 ead TODAY 235 PUTTL 225 PUTHEAD 236 FPUTFOOT 226 PUTLINE 237 BR 23 FUTSPACE 238 FUTPAGE 239 GETPARAM 240 SETVAL 240 SETLS 241 241 GETTL 242 SETPAGE 242 SETSP 242 SETNE 242 2435 SETTI 243 SETHOTTOM 244 SETFL 244 SETCE 241 SETUL SETIN 24 SETRM SETMi 244 SETMZ BR 245 JU 245 HE 246 FO 246 244 SETMS 244 SETM4 244 FI 245 RJ 245 NJ 245 LS 246 CE 246 NF 245 UL 246 BF 247 SP 247 NE 247 INM 247 RM 247 Figure Three Volume V No 3 13 FORTH Dimensions A RAMdisk for 8086 8088 FIG Forth John W Irwin Kitt Peak GODO and Modular Programming Words Austin Texas 3 GODO 2k O MAX R 4 MIN R gt DUP D
48. Tee new ura 40 mh a rhe hoo Biodedeasru e 9 Q C a A e A o hee O uw o LS 2 9 p ci o Lu m W S T vf L 3 2 n i Center today ompat Volume V No 3 FIG Chapter News John D Hall Oakland California We now have forty four chapters The six new chapters are Rockwell FIG Chapter Hoffman Estates Illinois Wichita FIG Chapter FIGPAC Wichita Kansas Kansas City FIG Chapter Kansas City Missouri Colombia FIG Chapter Bogota Colombia Forth Interest Group U K London England Taiwan FIG Chapter Taipei Taiwan Orange County Chapter At the June 22 meeting Dr David E Winkel of the University of Wyom ing drew a full house He spoke primarily about computer processor development and bit slice design He also introduced a bit slice development system which he developed There was a short discussion about an HP 75 Forth which one member is developing Wil Baden went through the fun damentals of conditionals at the July 6 meeting Near the end of the meeting Wil introduced non compiling condi tionals which allow one to occasionally compile Also Greg Stevenson devel oped a compiling buffer approach for conditionals Bob Waters demonstrated Forth on a Timex Sinclair as advertised in Forth Dimen sions The Forth was direct compiling multi tasking and had windowing capability On July 27 Wil Baden presented the ONLY ALSO
49. The new default value for true should be somewhat more use ful than the old value A related side benefit is that the word NOT is now available to mean take the one s complement whereas previously it was synonymous with oz In most cases it is compatible with previous usage Historically division in Forth has varied from system to system Accord ing to Charles Moore if a machine had a hardware divide then its characteris tics determined the division result If division had to be done in software as with say the 8080 then floored divi sion was usually chosen However on ly positive denominators were generally considered In some cases took signed arguments and MOD took unsigned arguments In Forth 83 the result of the operation is the mathe matical floor of the real number quotient Alternatively one may say that the quotient is more useful than the 79 Standard version For example one can readily perform an arithmetic right shift by dividing by an ap propriate power of two In hexadecimal arithmetic 8712 100 MOD will yield a quotient of FF87 and a modulus of 12 so that the original number is readily split into 8 bit com ponents Under 79 Standard the operation would yield FF88 with a remainder of FF12 A nice result is that now the right shift operator 2 is identi cal to 2 In my opinion the enhanced utility of the Forth 83 quotient and modulus function outweighs the disad van
50. UP OR My IBM Personal Computer with 2 EXECUTE 320K of RAM has far more memory 6 GODO COMPILE GODO HERE 2 IMMEDIATE than is used by most Forth programs 7 Bg The desire to eliminate Wear and tear 9 INTERNAL CURRENT 3 3 start private program section on my diskette drives and diskettes 10 prompted me to develop a RAMDisk 11 EXTERNAL HERE end private program section Voter 12 application in Forth to make use of this 13 MODULE PFA LFA hide the private words resource The program measures the 14 unused RAM space remaining after i3 Forth is loaded and makes the free space into a virtual diskette drive of that maximum capacity The perform SCR 768 ance increase is impressive and the ab RamDisk Program INTERNAL sence of the usual diskette commotion 20 CONSTANT RAM total number of RamDisk buffers is welcome By copying a set of screens 3 16384 CONSTANT RAMBLE first block number to RAMDisk program changes may be 4 0 CONSTANT RAMSEG base segment address of RamDisk 5 tried non destructively and then copied i HEX back to the original screens when com B ASSEMBLE CODE MEM 12 INT PSHAX FSHCS END CODE pletely debugged 9 10 RDmemsize stores seg base RAMSEG and bfrs ra MEM 1000 DUP RAMSEG gt R 40 R 12 11 RAMM Non Standard Words i DESIMAL 14 My Forth although similar to the 15 FIG 8086 implementation is a greatly expanded version with
51. al programs and inexpensive program updates User Groups worldwide the MMSFORTH Newsletter Forth related books work shops and professional consulting IM FORTH A World of Difference e Personal licensing for TRS 80 129 95 for MMSFORTH or 3 4TH User System with FORTHWRITE DATA HANDLER and FORTHCOM for 399 95 e Personal licensing for IBM PC 249 95 for MMSFORTH or enhanced 3 4TH User System with FORTHWRITE DATAHANDLER PLUS and FORTHCOM for 549 95 e Corporate Site License Exten sions from 1 000 If you recognize the difference and want to profit from it ask us or your dealer about the world of MMSFORTH MILLER MICROCOMPUTER SERVICES 61 Lake Shore Road Natick MA 01760 617 653 6136 FORTH Dimensions 8080 Z80 FIG FORTH for CP M amp CDOS systems FULL SCREEN EDITOR for DISK amp MEMORY 50 saves you keying the FIG FORTH model and many published FIG FORTH screens onto diskette and debugging them You receive TWO diskettes see below for formats available The first disk is readable by Digital Research CP M or Cromemco CDOS and contains 8080 source keyed from the published listings of the FORTH INTEREST GROUP FIG plus a translated enhanced version in ZILOG Z80 mnemonics This disk also contains executable FORTH COM files for Z80 amp 8080 processors and a special one for Cromemco 3102 terminals The 2nd disk contains FORTH readable screens including an extensive FULL SCREEN
52. als O Non smoking roommate O FORML P O Box 51351 Palo Alto California 94303 U S A Volume V No 3 17 FORTH Dimensions aim T19 3 N n oo Ks 3 vr TEM TEX P Gs 41 ar d LEN 1 ez t Tan un i SN zu a S AN w 173827477 R 3 oe ammamma _ A Soh LAU 4 E TELA I n LI z s LT LII AC A PG we f Cis c f H as cM o w bad a LJ Ps i P R3 d g a LET lt a E u 1 ME Igo 4 TY ay Nina VENE v Md us ud ve hd d EN a Sm Break Through the 64K Barrier FORTH 32 lets you use up to one megabyte of memory for programming A Complete Development System Fully Compatible Software and 8087 Floating Point Extensions E Call today toll free or Eg iti ilck contact a participating Peer ee ee Computerland store 303 Williams Ave ea 800 558 8088 Now available for the IBM PC PC XT COMPAQ COLUMBIA MPC and other PC compatibles IBM COMPAQ MPC and FORTH 32 are trademarks of IBM COMPAQ Columbia Data Products and Quest Research respectively FORTH Dimensions 18 Volume V No 3 3 E In word Parameter Passing SCR S 00 J OY Un A UO hO E2 Cz SCR cmon O8 Un PB WHF 312 X amp X CTRL X SXX SXXXX TDH13DEC82 DECIMAL l WIDTH gt amp X put Ascii constant of X on stack HERE 2 C COMPILE LITERAL IMMEDIATE
53. ard Two articles in this issue provide a summary of some of the changes that have been introduced and of some objections that have been raised Our purpose in publishing these items is to show some of the changes that have been introduced and to let readers see at least part of the process as well as the importance of arriving at a new standard Of course the people responsible for all this are just FIG members who get involved There is always room for another contributor to this loose knit band Particularly welcome are ar ticles ideas and letters to the editor from the many new members receiving Forth Dimensions this year Let us know how we can help you and let others know how Forth can help them Meanwhile make good use of this is sue and the ones to come Articles and code are still being accepted for our is sues on data acquisition instrument control and math Utilities and useful applications are always welcome Writers guidelines are available to authors and potential authors who send a self addressed stamped en velope to Editor Forth Dimensions Forth Interest Group P O Box 1105 San Carlos CA 94070 We look forward to hearing from each of you Marlin Ouverson Editor Volume V No 3 FORTH Dimensions FORTH for VICTOR 9000 Microcomputer DAI E Chinese Language Computing System Including 5000 most common Chinese characters can be transmitted in accordance with establish
54. ard reference before it takes place and then resolve it some how later when its target address is known This is the Pascal approach and is a pretty good compromise At least you no longer have to count bytes into a word and hot patch it later You can simply name the forward referen ced word and define a mechanism that resolves it This approach also allows you to have multiple forward referen ces by linking them into a chain and resolving the entire chain once the tar get address is known Finally the last approach I will men tion is that of handling forward references on the fly I do not mean to imply that there are only three ways of doing this there are many more but three is enough for now In order to handle forward references on the fly we must modify the meta compiler s compiler Instead of issuing an error message when an undefined word turns out not to be a number we must define the word in question and remember the fact that it is a forward reference Basi cally all this entails is to change the compile loop to decide upon one of three cases instead of only two Case one is that the word to be compiled al ready exists in which case we simply compile it by executing it and letting it compile itself Case two is that the word is a number in the current base in which case we compile the code field for literal followed by the value of the literal Case three is that the word to be compiled is not already defi
55. ately each element type that re quires a stack might have a custom co processor The most important benefit of stack oriented co processors is their special ability to operate on an internal stack of predefined elements These proces sors provide an effective balance of in creased speed with a minimum of addi tional hardware and additional voca bulary The interaction between Forth and stack oriented co processors forms a strange loop where the sum is con veniently greater than the computa tional parts This paper has evolved from two earlier papers presented at the 4th An nual Forth Convention San Jose 9 October 1982 and at the Eighth Annual West Coast Computer Faire San Fran cisco 18 20 March 1983 Address communications to D Redington Sleep Research Center Department of Psychiatry and Behavioral Science Stanford University School of Medi cine Stanford California 94305 References Duncan R Intel s 8087 Numeric Data Processor Dr Dobb s Journal 1982 7 8 pp 47 50 Field T The IBM PC and the Intel 8087 Co processor Part 1 Overview and Floating Point Assembly Lan guage Support Byte 8 8 1983 pp 331 374 proFORTH COMPILER 8080 8085 Z80 VERSIONS MICROPROCESSOR BASED PRODUCT DESIGN SOFTWARE ENGINEERING DESIGN STUDIES COST ANALYSIS ELECTRONICS AND PRINTED CIRCUIT DESIGN PROTOTYPE FABRICATION AND TEST REAL TIME ASSEMBLY LANGUAGE proFORTH MULTITASKING DIVERSIFI
56. b s Jrnl 773 9 81 c3 9 82 m 9 83 3 Poplar Computing 9 83 3 50USA 5Foreign EACH Total FIG T shirts 7 Small jMedium Large j X Large 10 1 Poster BYTE Cover 8 80 16 x22 3 FORTH Programmer s Reference Card If ordered separately send a stamped self addressed envelope TOTAL NAME MS APT ORGANIZATION PHONE ADDRESS CITY STATE ZIP COUNTRY VISA MASTERCARD AMERICAN EXPRESS Minimum of 15 00 on Charge Cards Make check or money order in US Funds on US Bank payable to postage No purchase orders without check Card Expiration Date Free FOREIGN 27 18 18 18 22 28 35 12 FIG All prices include ORDER PHONE NUMBER 415 962 8653 FORTH INTEREST GROUP PO Box 1105 San Carlos CA 94070 prn rT i A Din t Tei A 4 DUD r NCIS DR T 4 aed Address Correction Requested California residents add sales tax 10 83 T 4 NE LUI ANA Be NM RO AA ERED e prt rM a 9 ARIN AI M G9 ARS PES AB NE rar d VC ar n a TO TARLAC Wer A ACA ddr A he ur THAM HAB eh OS ABI EE PR AO oP Aa BA AUR TAN A FORTH INTEREST GROUP PO BOX 1105 SAN CARLOS CA 94070 BULK RATE U S POSTAGE PAID Permit No 261 Mt View CA Rr RRCE QST RUNE TREES
57. botics Instrumentation Process Control Graphics and many more polyFORTH II has the high per formance features you need to slash development time by months POWER Ail the programming tools you need multiprogrammed OS FORTH compiler and assembler editor over 400 primitives and de bugging aids resident and ready to use SPEED 3 5 times faster than Pascal 20 times faster than Basic with a resi dent assembler for time critical functions MULTITASKING MULTI USER Supports any number of tasks Even the smallest systems may have two or more programmers coding and testing interactively COMPACT CODE Entire development system resi dent in under 12K ROMable appli cations can run under 1K Large applications up to 10 times small er than with other techniques SUPPORT On line interactive documentation over a thousand pages of manuals FORTH Programming Courses and the FORTH Inc Hot Line plus Contract Programming and Con sulting Services Available for most popular minis and micros From FORTH Inc the inventors of FORTH serving pro fessional FORTH programmers for ten years FORTH Inc 2309 Pacific Coast Hwy Hermosa Beach CA 90254 213 372 8493 TWX 910 344 6408 FORTH INC HMBH FORTH Dimensions tick In 79 Standard FIND wasn t of much use so most people used the state smart tick This led to problems since some state smart words must be used cautiou
58. cesco in Forth Dimensions Vol IV No 6 I share his feeling regarding the use of standard DOS files I currently am using MicroMotion s Forth which certainly is fine as far as the normal Forth operating systems go Mr Francesco mentioned that Wil liam Graves Forth II for the Apple II uses Apple s DOS Looking through your section on system vendors I could not find anything that looked like a potential Graves source If you could supply me with more informa tion regarding Graves Forth II I would appreciate it Or if you do not have the information at hand perhaps you could forward this letter to Mr Fran cesco Thank you very much Sincerely James W Patton 737 W Davies Way Littleton CO 80120 Continued DOES ANI SR THEN FIND RETURNS THE CFA OF THE NEXT Volume V No 3 SCR B 0 CASE EXAMPLE DEMONSTRATING FANCY BRANCHING 1 THE FOWER OF THE FORTH COMPILER gt 2 3 l SET RETURN Ro DUF gt R 2t R 3 4 i IFJUMP OVER IF DROF R gt R ELSE Re 2t es CASE CREATE J COMPILE SET RETURN HERE O DOES K amp EXECUTES COMFILE IFJUMP FING 2 IMMEDIATE 7 t ENDCASE COMPILE GROF HERE SWAF 8 COMPILE EXIT CCOMPILE C 3 IMMEDIATE 9 a ALL WORDS ARE 79 STANDARD ER WORE IN THE INFUT STREAM C I t ye SCR C Q CASE EXAMPLE gt i PRINT 1 DNE 3 yu t FRINT 2 TUO 3 3 FRINT 3 THREE 4 CASE TEST amp 1 EXECUTES FRINT 1 7 2 EXECUTES FRINT 2 3
59. d Which brings me to the subject of 2 2OVER dl d2 dl d2 dl gt R gt R 2DUP R gt R gt 2SWA P source code The Volume IV Number 3 2ROT dl d2 d3 d2 d3 dl gt R gt R 2SWAP R gt R gt 2SWAP 1 issue of Forth Dimensions has found 4 WAR XBUILDS DOES 5 s 2CON lt BUILDS DOES 26 a permanent place on my desk It con 6 D lt ROT 2DUP IF ROT ROT DMINUS D lt ELSE tains some of the best material on 7 SWAP SWAP DROP THEN SWAP DROP fixed point arithmetic that is available 8 D dl d2 d3 OVER 5 PICK U 6 ROLL 4 ROLL at least with regard to Forth The 9 2SWAP article on vector rotation using the 18 CORDIC algorithm was particularly l1 CODE 2SRA d n d 27n El C 07D C B7C useful to me as that type of conversion 12 QCA C NEXT LINK QElC CB C 902CC BBC is routinely performed in wind 13 lD C 9E3 C Q9CBC lC C BBC GIDC O0E3C speed direction computation The 14 03D C 020 C F3 C GES C NEXT original code did not however meet l9 my expectations with regard to ac curacy In particular it failed to return correct values for rotations of 0 45 90 es dice REENT pom 51411 and 180 degrees The accompanying A POLUM listing of a double precision version of l Zilog nmeumonics for definition of 2SRA the algorithm will provide the needed POP Hoo 1 SRA accuracy It converts all input into 4 ID ALL i RR 5 double precision numbe
60. direc tories can be thus defined Every system will have a standard or default working directory To get back to it we say MAIN On this disk it is defined 78 82 DIRECTORY MAIN The actual work of NAME is done by SUBJECT NAME picks up the limits for the current working directory and executes SUBJECT SUBJECT takes the next word in the input stream and puts it in PAD It then does CONNIVE which will look for that word on the screens indicated Only the names are compared the values are skipped over to make the search faster INTRIGUE is used by CONNIVE to look up the word in PAD on a single screen When and if the word in PAD is found the next word will be interpreted SUBJECT can be used to define words similar to NAME and VIEW for special directories A help system could be defined something like HELP HELP 2 SUBJECT LIST With shadow screens it could be even easier HELP NAME gt SHADOW LIST SCR 71 you may already have some of these 1 CONSTANT TRUE CONSTANT FALSE DEFINED lt names a f not FIND this is figforth E IND IF 64 precedence bit AND it s immediate ELSE 1 THEN SWAP CFA SWAP ELSE HERE THEN 3 name gt f or HAVE DEFINED SWAP DROP O NOT 5 word word here s homonym COMPARE al a2 nl negative zero positive OVER SWAP DG COUNT I Ca DUP IF SWAP O LEAVE THEN LOOP IF THEN
61. e for example NEWVOC was defined in the vocabulary VOC2 This is caused by the action of the BUILDS part of the word VOCABU LARY when it performs CURRENT CFA This is how the standard is written CFA is misleadingly used as slang for 2 and should be replaced When the first word call it NEW WORD in the vocabulary NEWVOC is defined its LF Link Field takes the value in the Graft Field and the Graft Field takes a new value namely the NFA Name Field Address of NEW WORD The trick is that this is accom plished in the usual way by CREATE which looks at where CURRENT is pointing when CREATE is ready to set up the new links for NEWWORD CREATE then gets the value in the Graft Field which in our example points to the Dummy Name Field in VOC2 and puts this into the link field of NEWWORD The graft has then been created More in a moment This points to the voc link field of the previously defined vocabulary For the bottom vocabulary generally FORTH this VOC LINK will be 0 to indi cate the end of the list We re not going to talk about voc links here Okay now let s see what happens when FIND unsuccessfully searches the context vocabulary NEWVOC Assume that some setup routine has properly arranged both the stack and the string that FIND will be trying to find The address where FIND will start looking will be at the top of the stack In this case it will be CONTEXT since CONTEXT points to th
62. e Graft Field of NEWVOC which points to the Name Field of the last word defined in NEW VOC Then FIND starts looking When FIND reaches the first word defined in NEWVOC which you recall was NEWWORD FIND again fails to find a match and so looks in the Link Field of NEWWORD to find out where to search next What is there if you re call is the address of the Dummy Name Field of voc2 The unsuspecting FIND then looks at this field where it sees the name 81 AO again fails to match and so goes to what it thinks is the link field corresponding to this C64 FORTH for the Commodore 64 FORTH SOFTWARE FOR THE COMMODORE 64 C64 FORTH TM for the Commodore 64 99 95 Fig Forth 79 implementation with extensions Full feature screen editor and macro assembler Trace feature for easy debugging e 320x200 2 color bit mapped graphics 16 color sprite and character graphics e Compatible with VIC peripherals including disks data set modem printer and cartridges Extensive 144 page manual with examples and application screens e SAVETURNKEY normally allows application program distribution without licensing or royalties C64 XTEND TM FORTH Extension for C 4 FORTH 59 95 Requires original C64 FORTH copy e Fully compatible floating point package including arithmetic relational logical and transcendenta functions e Floating point range of 1E 38 to 2E 39 String extensions including LEFT
63. ed CCC11 Communications Code e Chinese word processor e Chinese Forth Available Fourth Quarter 1983 Cali For Price Dai E FORTH tevet Beginners Package in Fig FORTH Style US 15000 Dai E FORTH tevell Professional Level FORTH Package Conforms with proposed 1983 standard Features On line Documentation Decompiler Debugger tracer JA Viewer help Line Editor and Screen Editor 8086 8088 Assembler Meta Compiler Double precision Math extensions Native Operating System file handler True LRU disk buffer mechanism Separate header Graphics Sound Interface Hashed dictionary structure Multi tasking Available for CP M MS DOS or stand alone versions US 35000 Coming Soon DAI E GRAPHICS with optical mouse Available fourth quarter 1983 SEE US AT BOOTH 16 FORTH INTERNATIONAL CONFERENCE Oct 14 amp 15 1983 PALO ALTO CA E DAI E T SYSTEMS INC MULTI LANGUAGE COMPUTING SYSTEMS 503 682 3201 29783 Town Center Loop West P O Box 790 Wilsonville Oregon 970 70 U S A FORTH Dimensions nM i RPN Blues Revisited Dear FIG I have been trying to implement Forth on my system for two years now but failed because of not having a good assembler for my system In those two years I mostly did not work on the Forth system because of frustration But now I had the opportunity to work with Forth on a friend s machine Su per There is one thing I
64. f fair FIG Forth makes extensive use of the linked list in vocabulary manage ment and creates a structure that al lows the dumb primitive FIND to look in the right places without FIND ever realizing it This note attempts to make both the creation and search processes a little clearer Before explaining how vocabulary structures work let s talk about what they do You may recall that during typical dictionary searches first the context and then the current vocabularies are searched These two searches are per formed in the same way Take the con text search as an example first looking at the broad picture and then the de tails Vocabulary Search big picture Assume we have the vocabulary tree shown in Figure One and that the vocabulary NEWVOC has had a few words added to it Assume that NEW voc is the context vocabulary When context is searched first NEWVOC is searched then voc2 then VOC1 and then FORTH assuming no match has been found voc3 is not searched Thus the context vocabulary is actual ly composed of a sequence of vocabu laries The word vocabulary itself is therefore somewhat ambiguous in FIG Forth usage After a few setup details the actual search is done by the not very smart primitive FIND which returns only on a match or on finding a zero for the next name field address in the search The zero shows up in the name field of the first word in FORTH usually LiT T
65. g III Henry Laxen Berkeley California Last time we talked about how to implement CODE words in the meta compiler and saw how such words must operate in order to make meta definitions work We also saw how to define a symbol table for the definitions that are created during meta compilation by using the existing vocabulary structure We also looked at how to create headers in the target address space If any of these concepts are unfamiliar to you I suggest you reread the previous two articles in this series which discuss them in detail I would now like to talk about a few of the subtle issue that come up during meta compilation that must be handled by some means or another Some of the subtle issues are how to handle for ward references and how immediate words such as are handled Other similar issues arise but we must leave some questions unanswered so that the reader can experience the joy of dis covery The issue of forward references during meta compiling has for some unknown reason become almost a religious issue The regular Forth inter preter treats forward references as an error condition which has its pros and cons Fortunately it is almost always possible to write your Forth applica tion in such a way that you can avoid forward references hence one branch of the religion considers the problem solved namely don t use forward references Unfortunately in the meta compiling process forward refe
66. gram load address each time it is used RDR W is equivalent to FIG Forth R W The stack at entry contains the standard R W call addr blk f If the block number is in the RAMDisk a GODO is used to interpret the flag else control is passed back to R W with the flag moved to the R stack RDwrite copies the Forth buffer into the RAMDisk buffer including the block number The update flag is never set in RAMDisk buffers since the RAMDisk represents the physical dis kette To provide some very needed feedback to the user that his EDIT is in deed being saved a speaker click is emitted for each RAMDisk buffer write This is done very simply in the two lines containing I O words by gating and immediately de gating a bit in the speaker port These lines can be deleted for other systems or if feedback is not desired RDread compares the RAMDisk buffer block number to the requested block number to see if the buffer has been written A valid buffer is indi cated by a match while an invalid buff er contains the zero put there by initialization If the buffer is valid the RAMDisk buffer is copied to the Forth buffer else the Forth buffer is blanked using FILL 5th FORML Conference November 23 25 1983 Asilomar Conference Center Pacific Grove California U S A FORML is a technically advanced conference of FORTH practitioners The topics to be discussed will affect the future evolution of FORTH FORTH programmers managers ve
67. h any standards discussion grew heated As the bell rang each side went to their respective corners We will hear more about this in the future Dayton Chapter At the June 25 meeting Dr Leonard Spialter gave a slide show of the Rochester conference On July 12 the group decided to have a Forth tutorial and Dr Spialter presented a flow chart for a Day of the Week program The group spent the rest of the meeting programming it in Forth Gary Grang er gave a talk about Forth to the Columbus Ohio Heath Users Group on July 11 and a Forth talk and demo to the Timex Sinclair Users group on July 19 Kansas City Chapter The first two meetings of the Kansas City Chapter had twenty to twenty five Chapters in Formation Here are more of the new chapters that are forming If you live in any of these areas contact one of these people and offer your support in forming a FIG chapter Contact Michael Perry 1446 Stannage Ave Berkeley CA 94702 Dick Turpin 3109 Breton Ave Davis CA 95616 Samuel J Cook 115 N Washington Ave Batavia IL 60510 Dr Edward Newberger 2739 Elmwood Ave Apt 3 Kenmore NY 14217 David Whitely 1163 West 550 North Clearfield UT 84015 Arnold Pinchuk 2130 Menasha Ave Manitowoc WI 54220 T William Rudolph FIG GRAPH East 592 Plymouth St Halifax MA 02338 Tony Van Muyden P O Box 7396 Edmonton Alberta T5E 6C8 Canada Jack Hung Comx World Operations 15 F Wo Kee Ho
68. h the end of a line The usual defini tion is next to that of QUERY or HEX 8081 HERE X R DROP IMMEDIATE DECIMAL compiled above where you re going to zero a link field should allow you to ex periment from the terminal but not from screens Volume V No 3 There are at least two major short comings to the present vocabulary or ganization 1 No pointer is kept to the first word in a new vocabulary only to the last hence rearranging the branches on the vocabulary tree is cumbersome 2 The search routine only looks at the current and context vocabularies and is thus limited in regard to generalized search patterns In my next article we ll look at some of the proposals for vocabulary struc turing Illustrative figures were kindly pro vided by Valpar International E R FOR TRS 80 MODELS 1 3 amp 4 IBM PC XT AND COMPAQ The MMSFORTH System Compare e The speed compactness and extensibility of the MMSFORTH total software environment optimized for the popular IBM PC and TRS 80 Models 1 3 and 4 An integrated system of sophisticated application programs word processing database management communications general ledger and more all with powerful capabilities sur prising speed and ease of use With source code for custom modifications by you or MMS The famous MMS support including detailed manuals and examples telephone tips addition
69. hita Chapter FIGPAC Monthly 3rd Wed 7 p m Wilber E Walker Co 532 S Market Wichita KS Call Arne Flones 316 267 8852 MNFIG Chapter Monthly Ist Mon 1156 Lincoln Avenue St Paul MN Call Fred Olson 612 588 9532 FORTH Dimensions Volume V No 3 e MISSOURI Kansas City Chapter Call Terry Rayburn 816 363 1024 St Louis Chapter Monthly 3rd Tue 7 p m Thornhill Branch of St Louis County Library Call David Douda 314 867 4482 e NEVADA Southern Nevada Chapter Suite 900 101 Convention Center Drive Las Vegas NV Call Gerald Hasty 702 453 3544 NEW JERSEY New Jersey Chapter Call George Lyons 201 451 2905 eves NEW YORK New York Chapter Monthly 2nd Wed 8 p m Queens College Call Tom Jung 212 432 1414 ext 157 days 212 261 3213 eves Rochester Chapter Monthly 4th Sat 2 p m Hutchison Hall Univ of Rochester Call Thea Martin 716 235 0168 Syracuse Chapter Call C Richard Corner 315 456 7436 e OHIO Athens Chapter Call Isreal Urieli 614 594 3731 Dayton Chapter Twice monthly 2nd Tues amp 4th Wed 6 30 p m CFC 11 W Monument Ave Suite 612 Dayton OH Call Gary M Granger 513 849 1483 OKLAHOMA Tulsa Chapter Monthly 3rd Tues 7 30 p m The Computer Store 4343 South Peoria Tulsa OK Call Art Gorski 918 743 0113 e OREGON Greater Oregon Chapter Monthly 2nd Sat 1 p m Computer amp Things 3460 SW 185th Aloha Call Ti
70. if forward referen ces are allowed You will often want a fatal error which could occur at a rela tively low level in your program to call say the main menu routine which obviously occurs at a very high level That is the case in Forth where ABORT which is used at a very low level calls the Forth interpreter which is defined at a very high level Enough religion let s take a look at some techniques for handling forward references during meta compilation The simplest method to implement and the hardest to control is to simply use a place holding word and then patch it later when the resolving for ward reference word is defined Nor mally this word is called GAP and it behaves like a comment skipping the following text until the next and sim ply compiling a zero into the target im age The intervening text is usually the name of the word which will later be patched into this location The prob lem with this approach is that you have to index some number of bytes depending on the location of the gap into the word that was defined and patch it with another value This ap proach is very inflexible and error prone since if you ever change the definition in which the gap occurs you must also change the place where it gets patched in a corresponding manner There is no intelligence required just conscientious effort something humans are not well equipped for Another approach is to explicitly declare a forw
71. in order to perform searches randomly or sequentially in either direction The program supports BLOCK disk I O and the CP M and MS DOS interface by Laboratory Mic rosystems Retail orders the price is 125 should be sent to Laboratory Microsystems for whose Forth systems INDEX is written others should contact Business Computing Press Sylmar Software now offers FIG Forth for the Otrona Attache The two disk set costs 50 and includes a full screen editor and various utilities A Towers of Hanoi version demonstrates the Attache s direct cursor operations The user should obtain the FIG Forth Installation Manual which provides definitions for the Forth words MASSACHUSETTS Boston Chapter Monthly 1st Wed 5 p m Mitre Corp Cafeteria Bedford MA Call Bob Demrow 617 688 5661 after 7 p m MICHIGAN CALIFORNIA Los Angeles Chapter Monthly 4th Sat 11 a m Allstate Savings 8800 So Sepulveda Boulevard Los Angeles Call Phillip Wasson 213 649 1428 Northern California Chapter Monthly 4th Sat p m FORML Workshop at 10 a m Fountain Valley Monthly Ist Wed 7 p m Mercury Savings Beach Blvd amp Eddington Huntington Beach Call Noshir Jesung 714 842 3032 San Diego Chapter Weekly Thurs 12 noon Call Guy Kelly 619 268 3100 ext 4784 Rockwell Chicago Chapter Call Gerard Kusiolek 312 885 8092 e KANSAS Detroit Chapter Call Dean Vieau 313 493 5105 MINNESOTA Wic
72. ing order of complexity 1 simply devising Colon and or Code definitions like writing floating point routines in software and 2 adapting memory mapped or port ed hardware like a floating point pro cessor such as adding a 9511 or 9512 with the necessary interface words or 3 incorporating a co processor spe cially equipped to deal with the desired stack elements Incorporating a co processor is the most interesting but seldom used alternative Stack Oriented Co Processing Co processing is a special form of multi processing The co processor as a guest lacks some of the faculties of the host processor The guest must rely on the host for some faculties such as memory segmentation and address generation One advantage of co pro cessing is that almost no overhead is in curred in setting up the guest to execute an instruction when the host and guest are working in unison A second ad vantage of co processing is that the guest can be performing a complex cal culation like raising a number to the ith power while the host is performing a few housekeeping chores this is referred to as an asynchronous co pro cessing mode A third advantage of co processing is that host and guest can work together in what is called maxi mum synchronized co processing the host waits until the instant the guest has completed a computation before continuing with the instruction stream Obviously a co processor i
73. itial block 4 6 2 return number of blocks 7 22 type information block gt 8 i GODO RDparms RDinit RAMBLK RAM RDparms THEN 9 10 MODULE FORTH 11 12 O RD 3 RD initialize RD and show user the size 13 j 14 15 Volume V No 3 End Listing 15 Program Interface The RAMDisk program should be loaded before other applications The only nucleus word affected is R W In order to make existing words such as FLUSH work with the RAMDisk this program replaces the first parameter word of R W R with the execution address of RDR W RDR W checks the block number to see if the call is to RAMDisk If not then the R gt replaced at WR W is emulated and execution proceeds with the native R W code Since the RAMDisk program modifies a nucleus word it should be sealed under FENCE to prevent accidental FORGETing The assembler word MEM returns two values from which the available memory is determined The PC DOS call 12 INT returns the memory size in Kbytes Pushing the CS register returns the beginning address of the Forth code segment From these values GET MEM SIZE determines space available for the RAMDisk so that the compiled ap plication can be moved freely between machines with differing memory size If Forth is loaded at a fixed location in a fixed memory size machine the word MEM can be replaced by a constant for memory size and a constant for the end of the Forth segment My F
74. lities 25 C Installation Manual for fig FORTH 15 Source Listings of fig FORTH for specific CPU s and computers The L CP M 300 O iBMe C 8086 300 O Z80 em Installation Manual is required for implementation Each 15 O Northstar 300 J Apple ll II 300 O 1802 C 6502 CL 6800 1 AlphaMicro O 8080 O 8086 88 O 9900 D APPLE II s seh pe a eg HE DPACE 6809 ONOVA D PDP 11 LSl 11 LJ 16K RAM Pack 50 D 48K RAM Pack 125 O68000 O Eclipse VAX 0280 O Par Sec Interface 100 Ordering information Check Money Order payable to MOUNTAIN VIEW PRESS INC VISA MasterCard COD s 5 extra No billing or unpaid PO s California residents add sales tax Shipping costs in US included in price Foreign orders pay 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 20 for each item over 100 Minimum order 15 All prices and products subject to change or withdrawal without notice Single system and or single user license agreement required on some products DEALER amp AUTHOR INQUIRIES INVITED MOUNTAIN VIEW PRESS INC PO BOX 4656 MOUNTAIN VIEW CA 94040 415 961 4103 LM Laboratory Microsystems MM MicroMotion MMS Miller Microcomputer Services NS Nautilus Systems PNS Pink Noise Studio SL Shaw Labs Key to vendors CCI Capstone Computing Inc DE Dai E Systems FD Forth Dimension I Insoft LH Laxen and Harris FORTH Dimensions
75. ment of software for the Epson QX 10 computer presented a graphics package on August 3 Its performance was impressive Mr Vock is a graphics expert and knows the subject very well he had done it with 8K of Forth Rochester Chapter The Rochester New York FIG Chapter had its second meeting on June 25 at the University of Rochester The group looked at the new 83 Standard draft and Larry Forsley repeated the talk Bob Smith gave at the Rochester Conference on the specific differences between Forth 79 and 83 Standard There was much discussion of the implications for ROMmed systems of the new mono addressing rules Specifical does BODY gt reference an address in RAM or ROM It was suggested that copies of Bob s slides accompany distributed copies of the new standard Nova Scotia Chapter The Nova Scotia Chapter held their first meeting on June 29 The group took a survey at this meeting and found as in most chapters that the members had a wide range of ex perience with Forth Some people had no Forth experience at all while others had written meta compilers They decided for purposes of code ex change that they would use 79 Standard People were volunteered a common Forth practice to look into transferring screens to dissimilar computers and into collecting a list of all Forth information Owned by various mem bers in order to generate a master list Graphics standards were also discussed and as wit
76. mothy Huang 503 289 9135 e TEXAS Dallas Ft Worth Metroplex Chapter Monthly 4th Thurs 7 p m Software Automation Inc 14333 Porton Dallas Call Marvin Elder 214 392 2802 or Bill Drissel 214 264 9680 San Antonio Chapter T L Schneider 8546 Broadway Suite 207 San Antonio TX 78217 e VERMONT Vermont Fig Chapter Monthly 4th Thurs 7 30 p m The Isley Library 3rd fl 3rd Floor Meeting Room Middleburynes VT Call Hal Clark 802 877 2911 days 802 452 4442 eves e VIRGINIA Potomac Chapter Monthly 1st Tues 7 p m Lee Center Lee Highway at Lexington St Arlington VA Call Joel Shprentz 703 437 9218 eves FOREIGN AUSTRALIA Australia Fig Chapter Contact Ritchie Laird 25 Gibsons Road Sale Victoria 3850 051 44 3445 FIG Australia Chapter Contact Lance Collins 65 Martin Road Glen Iris Victoria 3146 03 29 2600 Sydney Chapter Monthly 2nd Fri 7 p m Morven Brown Bidg Rm LG16 Univ of New South Wales Sydney Contact Peter Tregeagle 10 Binda Rd Yowie Bay 02 524 7490 e BELGIUM Belgium Chapter Contact Luk Van Loock Lariksdreff 20 B2120 Schoten 03 658 6343 e CANADA Nova Scotia Chapter Contact Howard Harawitz P O Box 688 Wolfville Nova Scotia BOP 1X0 902 542 7812 Southern Ontario Chapter Monthly 1st Sat 2 p m General Sciences Bldg Rm 312 McMaster University Contact Dr N Solntseff Unit for Computer Science McMaster University Hamilton Ontario L
77. ndors and users will benefit from several informative conference sessions All attendees are asked to participate and are encouraged to write a paper for presentation in an oral or poster session Topics Suggested for Presentation Hardware FORTH Implementation Nucleus Variations Large Address Space Environments Operating System Environments Multiprogramming Architectures System Generation Techniques Registration and Papers Complete the registration form selecting accomodations desired and send with your payment to FORML Include a 100 word abstract of your proposed paper Upon acceptance by FORML a complete author s packet will be sent Completed papers are due September 30 1983 Registration Form Complete and return with check made out to FORML P O Box 51351 Palo Alto Calif 94303 Name Company Address City State M ZIP Phone day _ ss 1 evening have been programming in FORTH for years months Accommodations Desired Prices include coffee breaks wine and cheese parties use of Asilomar facilities rooms Wednesday and Thursday nights meals from lunch Wednesday through lunch Friday Conference attendees receive notebooks of papers presented Conference attendees share a double room number of people x 200 Attendees in single room limited availability number of people x 250 Non conference guests number of people x 165 TOTAL ENCLOSED Options Vegetarian me
78. ned and is Volume V No 3 31 FORTH Dimensions not a number hence it must be a for ward reference In this case we must create an entry for it in the symbol table of forward references compile a gap in the word currently being defined and set up the run time of the forward reference to either link itself into a chain if it is not already resolved or to compile itself if it is already resol ved Thus forward references become basically transparent except that they must be resolved somehow This reso lution can either be automatic as the word is actually defined or explicit requiring you to issue commands that will cause the resolution Personally I prefer the explicit method since I am afraid of things happening behind my back and it slightly discourages the use of forward references which deep in my heart I know is right Enough about forward references le s talk for a moment about im mediate words Immediate words present a special problem since they must be executed at compile time They may do arbitrarily crazy things and must do them in the target environ ment For example must look up the next word in the input stream and com pile its code field as literal Another ex ample is which must scan the input until another is encountered and then compile the runtime address for which may not even be known yet followed by the count delimited string that was scanned The usual mechanism
79. ng Bldg 585 609 Castle Peak Rd Kwai Chung N T Hong Kong attendees The first meeting was spent getting acquainted and discovering who was doing what with Forth At the second meeting the group generated a list of topics of special interest for groups or programs The highest items on the list were program organization coding style graphics data base applications and target compilers Support your local chapter John D Hail is the Chapter Coor dinator for the Forth Interest Group and is a consulting programmer Ravizza Donato Sonnenbergstr 34A Uster 8610 Switzerland Greg Stevenson 8002 Poinsettia Place Buena Park CA 90620 Glen Bowie 25746 North Player Dr Q 1 Valencia CA 91355 Marc Perkel Perkel Software Systems 1452 N Clay Springfield MO 65802 417 862 9830 H Marcus Bacon 704 1H E I DuPont Savannah River Plant Aiken SC 29808 Richard Bloch Eastern VA Center for MH Studies Drawer A Williamsburg VA 23187 Wes Thomas Jupiter Ace SIG Frank Barth Inc 500 Sth Ave New York NY 10110 Scott Miles Robotics Christensen Diamond Products 2532 South 3270 West Salt Lake City UT 84119 Erick Ostergaard COMPEX 2 Gertsvej 2300 Copenhagen S Denmark Marc Tamir Weiner Moshav Neve Ilan D N Harei Yehuda 90850 Israel Volume V No 3 35 FORTH Dimensions New Product Announcements Forth Dimensions welcomes press releases and product announcements as well a
80. ng the note Sincerely yours Nicholas L Pappas Ph D 1201 Bryant St Palo Alto CA 94301 Wy t E Have You Mp rep FORTH Fundamentals Advanced Systems amp Tools For further information please send for our complete FORTH workshop catalogue Companies such as IBM Atari Varian Hewlett Packard Dysan and Memorex are now using FORTH for a number of applications If you are concerned about efficiency and transportability then FORTH is a language you should learn Join the FORTH Revolution e Intensive 5 day workshops e Small classes e Experienced professionals On site classes by special arrangement Continued from page 26 techniques for compiling and may occur when is compiled into a definition This subject will certainly be a topic of discussion for the next meeting of the Forth Standards Team Again the definition of has not changed and therefore should not be a reason to reject the new standard By adopting the new standard the Forth Standards Team accepts Forth 83 as the current official FST standard superceding all prior standards It is important that we have a standard for writing transportable application code as a basis for writing books and documents and for teaching and communication 395 00 495 00 Inner Access Corporation P O Box 888 Belmont CA 94002 415 591 8295 FORTH Dimensions 30 Volume V No 3 Techniques Tutorial Meta Compilin
81. nta Monica CA 90403 213 394 0796 Bouiton Dave 581 Oakridge Dr Redwood City CA 94062 415 525 8582 Mcintosh Norman 2908 California Ave 3 San Francisco CA 94115 Software Engineering 6308 Troost Ave 210 Kansas City MO 64131 816 363 1024 Brodie Leo ERES Softweaver 9720 Baden Ave Metalogic Corp P O Box 7200 Chatsworth CA 91311 4325 Miraleste Dr Santa Cruz CA 95061 Y Rancho Palos Verdes CA 90274 408 425 8700 an it odia 213 519 7013 Eastgate Systems Inc Technology Management Inc P O Box 1307 Peschke Manfred 1520 S Lyon St Cambridge MA 02238 Girton George 1753 Franklin Santa Monica CA 90404 213 829 1074 Go FORTH 504 Lakemead Way Redwood City CA 94062 415 366 6124 603 774 7762 Suite 104 213 908 0160 Intersystems Mgmt amp Consult Story Hill Rd RFD 3 Dunbarton NH 03045 Petri Martin B Computer Consultants 16005 Sherman Way Santa Ana CA 92705 714 835 9512 Timin Mitchel 3050 Rue d Orlean 307 San Diego CA 92110 619 222 4185 Van Nuys CA 91406 a E AE E E E ERREUR REPARARE UR APER A URINE RR FORTH Dimensions 32 Volume V No 3 imensions FORTH D ity contact your nearest ity and reliab qual pRELIM E ion ion 206 for locat titiititi i A GODBOGUT company 3506 Breakwater Ct Hayward CA 94545 33 7 Seit am Tee scm pro m9 CompuP Teese ae rh eoa call 415 786 0909 extens pte ede rhe umo rrr roo rae
82. ntial quality The team rules require a two thirds affirm ative vote of the members to accept the new standard The actual vote as of the time of this writing is twenty two yes votes one no vote and three votes not received We can see that the vote was quite decisively in favor of the new standard In my opinion the new standard offers a significant improve ment over previous Forth standards Like all standards Forth 83 is the result of many compromises and therefore not all readers will agree on the desirability of some of the features It should be pointed out that the Forth Standards Team is not forcing anyone to adhere to the standard In the for ward to the standard the following sentence appears A programmer or vendor may choose to strictly adhere with the standard but the choice to deviate is acknowledged as beneficial and sometimes necessary Certainly if one has programs which work on an older standard or a non standard sys tem there is no requirement that the old system be thrown away and the programs rewritten just because a new standard exists Let us briefly review some of the dif ferences from the previous standard Forth 83 Standard which may affect a more general accep tance of Forth 83 Most of the issues have been previously aired in this column for the purpose of information and to encourage public input The new DO LOOP is somewhat dif ferent from previous DO LOOPs Mo
83. oftware P O Box 7668 Little Rock AR 72217 1 IDPC Company P O Box 11594 Philadelphia PA 19116 215 676 3235 2 IUS Cap n Software 281 Arlington Ave Berkeley CA 94704 415 525 9452 Inner Access 517K Marine View Belmont CA 94002 415 591 8295 4 Innovatia Laboratories 5275 Crown St West Linn OR 97068 5 Insoft 10175 S W Barbur Blvd Suite 202B Portland OR 97219 503 244 4181 6 Interactive Computer Systems Inc 6403 Di Marco Rd Tampa FL 33614 Wd 1 JPS Microsystems Inc 361 Steelcase Rd W Markham Ontario Canada L3R 3V8 416 475 2383 I Kukulies Christoph Ing Buro Datentec Heinrichsallee 35 Aachen 5100 West Germany Laboratory Microsystems 4147 Beethoven St Los Angeles CA 90066 213 306 7412 2 Laboratory Software Systems Inc 3634 Mandeville Canyon Los Angeles CA 90049 213 472 6995 3 dem Lynx 3301 Ocean Park 301 Santa Monica CA 90405 213 450 2466 Lyons George 280 Henderson St Jersey City NJ 07302 201 451 2905 M amp B Design 820 Sweetbay Dr Sunnyvale CA 94086 MicroMotion 12077 Wilshire Blvd 506 Los Angeles CA 90025 213 821 4340 Microsystems Inc 2500 E Foothill Blvd 102 Pasadena CA 91107 213 577 1477 Micro Works The P O Box 1110 Del Mar CA 92014 714 942 2400 Miller Microcomputer 61 Lake Shore Rd Natick MA 01760 617 653 6136 Mountain View Press P O Box 4656 Mountain View CA
84. ogressive ly higher level words into code as the work progressed Thus I faced the problem of creating code definitions for words that might be called either as subroutines from other code words or as Forth compatible words from colon definitions The critical difference between the two is that a machine language sub routine should end by returning to its caller pop the stack for the caller s address whereas a Forth code defini tion ends by jumping to NEXT To resolve the dilemma I used the tech niques illustrated in Figure One by 8080 machine language These words would permit me to make calls to any machine language sub routine such as in my system s monitor for example SCROLL F010 CALL would write F010 over the zero in the definition of CALL and would then subroutine to CALL 0 to JMP NEXT execute CALL Thus the monitor sub routine at F010 would be executed followed by a jump to NEXT Now we want to create subroutines that can be used either from colon definitions or code words Here is a defining word which defines such sub routines When invoked from colon definitions the run time behavior is similar to CALL above To use the sub routine from code definitions merely tick its address and CALL it in as sembly language Figure Two shows the defining word SUBROUTINE For example this word might be used to define subroutine SUB1 as fol lows SUBROUTINE SUB1 80 A MV1 C01
85. oised until a special com mand sequence is detected ESC When the special co processor com mand is read the 8087 interprets the subsequent commands accessing me mory as necessary and executing the in terpreted commands The 8086 waits until the NDP has completed the com mands before continuing In a true co processing fashion the 8086 88 and 8087 interpret the same instruction stream containing embedded NDP commands The 8087 was designed with a stack structure the charter of the 8087 design team was first to achieve excep tional functionality and then obtain high performance APX manual p S 3 The 8087 is a Stack Oriented Co processor maybe an SOC This structure makes it compatible not only with the 8086 but also with the archi tecture of Forth Forth and a Stack Oriented Co processor The stack oriented structure of the 8087 provides an easy incorporation in to an 8086 Forth environment All that is needed is a small 8087 assembler that contains the primitive commands to communicate with the NDP this kind of assembler is described elsewhere2 The operation of a stack oriented co processor is identical to the operation 1 Good references on the 8087 include Duncan 1982 Field 1983 Palmer et al 1980 Rash 1981 Simington 1983 2 I resurrected an 8086 8087 assembler written in Forth by John Bumgarner on my Seattle Com puter Products 8086 8087 Gazelle system run
86. oncepts invol ved in meta compiling The best way to really learn about meta compilers is to write one Hopefully I have provided you with enough ammunition to at tempt such an undertaking Let me tell you that if you do you will raise your level of Forth consciousness many levels and I think it is an exercise well worth the effort Next time I will talk about multi tasking an issue many have heard about but few have seen We will im plement a very simple and slow high level multi tasker and discover its principles of operation Until then good luck and may Forth be with you Copyright 01983 by Henry Laxen Ail rights reserved The author is Chief Software Engineer for Universal Research 150 North Hill Drive 10 Brisbane CA 94005 specializing in the development of portable computers FORTH Vendors Continued from page 39 InnoSys Harris Kim R Redding Co 2150 Shattuck Ave Forthright Enterprises P O Box 498 Berkeley CA 94704 P O Box 50911 Georgetown CT 06829 415 843 8114 Palo Alto CA 94303 203 938 9381 415 858 0933 Intersystems Management Computer Consultancy Schleisiek Klaus Eppendorfer Landstr 16 D 2000 Hamburg 20 Consultation amp Training Onl See Sum Vendor kid 7 Story Hill Rd RFD3 West Germany for others Dunbarton NH 03045 040 480 8154 603 774 1162 Schrenk Dr Walter Laxen Henry H Postfach 904 E Leen 1259 Cornell Ave 7500 Karlstruhe 41 Berkeley CA 94706 West Germany Sa
87. orth uses 256 byte blocks Each block is assigned seventeen six teen byte 8086 88 paragraphs This wastes twelve bytes per block but sim plifies buffer addressing The extra segment pointer EB is set to the start ing address of RAMDisk plus seven teen times the relative block number within the RAMDisk The block iden tifier is then at offset zero and the block proper at offset two to 257 rela tive to the segment register EB This scheme is easily adapted to other buff er sizes For systems with 1K blocks each block is assigned sixty five para graphs Program Functions RD is the only RAMDisk word visible to the user This word accepts a func tion flag as follows FORTH Dimensions FORTH for Z 80 8086 68000 and IBM PC FORTH Application Development Systems include interpreter compiler with virtual memory management and multi tasking assembler full screen editor decompiler utilities and 130 page manual Standard random ac cess files used for screen storage extensions provided for access to all operating system functions 2 80 FORTH for CP M 2 20FMPIM Il aa alle 50 00 8080 FORTH for CPIM 2 2 or MPMI oaoa oaa len 50 00 8086 FORTH for CP M 86 or MS DOS ouau aa EE 100 00 PCIFORTH for PC DOS CP M 86 or CCPM ouaaa aa a 100 00 68000 FORTH for CPIM 68K ouaaa aE 250 00 83 Standard version of all application development systems available soon All registered users will be en
88. rences are unavoidable and we must develop a technique to handle them Before I discuss a few solutions I would like to present my view of the forward reference issue The use of forward references is not sinful immoral il legal or fattening It should be dis couraged but not banned The problem that arises with forward references is that you can get yourself into big trouble It destroys the bottom up na ture of Forth and can cause you to re test previously working words because they make use of a forward reference which has changed It also decreases the usefulness of program listings if you are never sure of which way to turn the pages when you encounter an un familiar word Forward references also complicate the compiler since it now must handle another class of objects other than previously defined words and num bers Most threatening however is that if forward references are abused you can wind up with totally un decipherable spaghetti code Just look at almost any Fortran program larger than 100 lines and written by a physicist and you will see what I mean The case for forward references is that sometimes you must have them For example if you are using recur sion and word A calls word B which calls word A I am afraid a forward reference is somewhat unavoidable if recursion is the natural solution to your problem it would be silly not to use it Also error conditions are often more easily handled
89. rs with the bi 5 OR AA EX SP HL nary point between bits 15 and 16 i e 6 JP Z NEXT RR H the upper half of a number represents 7 POP HL RR L the integer part and the lower half 8 EX SP HL represents the fractional part 9 cont d next column DEC A This was written for Z80 Forth by 19 JR NZ 1 Laboratory Microsystems This inter 11 PUSH HL preter allows double number literals in 12 JP NEXT colon definitions Modify these entries 13 for FIG Forth or other interpreters 14 which do not allow this extension The 15 conversion is fast due to the machine code divide by factor of two 2SRA routine FORTH Dimensions 24 Volume V No 3 wae Screen 4 30 crc 16435 9 CORDIC ALGORITHM l ALPHA i 65536 32768 arctan 1l 2 i Pi 2 2VAR ALPHAS 4 ALLOT 3 536870912 316933406 167458907 85004756 4 42667331 21354465 190679838 5340245 5 2670163 1335087 667544 333772 6 166886 83443 7 convert double to single with round up 8 D gt S 32768 D SWAP DROP 9 RVSUBl gt R 2ROT 2ROT 20VER 20VER R gt 2SRA 18 RVSUB2 gt R 2ROT 2ROT 2SWAP R gt 2SRA ll RVSUB3 gt R 2ROT R gt 4 ALPHAS 26 12 KN n d n 65536 9 60725293 13 256 MOD SWAP gt R S gt D 10188914 D 14 R gt S D 39797 D D 15 gt Screen 31 crc 23246 CORDIC ALGORITHM l ROTVECTOR n y old n x old n ang n y new n x new 2 gt R
90. rth Dimensions to evaluate Forth software like other magazines e g InfoWorld I had to buy three different Forths before find ing one I feel comfortable with I need more information on each piece of software like which follows the Forth Standard disk format supported and options like eighty column screen lower case editor etc These would save my time and money Thank you for your time and patience with this comment about pub lication and evaluation Yours sincerely William A Paine 11025 131st Ave NE Kirkland WA 98033 Continued Editorial Once a month a pioneering group of Forth aficionados meets to coordinate the considerable business of running a world wide organization That it is a not for profit affair does not make their duties less complex than those as sociated with any international busi ness That the board members are unpaid does not make them less com mitted diligent and effective as managing leaders The work of Forth Interest Group members has been largely responsible for the growing public acceptance of Forth They have called attention to Forth as a practical language and for more and more projects as the lan guage of preference Whenever ele ments of the language have posed obstacles they have contributed hours of labor to modify argue test debate and re modify to create an improved Forth standard Standard Fare Forth 83 has been accepted as the official stand
91. ry LIT LFA Hence FIND has somehow to be guided in order to search all the right vocabularies This is where Dummy Name Fields containing the two bytes 81 and AO come in To understand the details we have to look at the structure of a vocabulary word VOCS3 VOC1 EDITOR ASSEMBLER Nu LIT NEWWORD NEWVOC Schematic of Example Vocabulary Tree Note that lines emerging from the sides of vocabulary words do not represent real pointers See Figure Two for actual con figuration Figure One Figure Two Vocabulary Searches detailed picture Performing VOCABULARY NEWVOC wil create the elements shown in Figure Two in the dictionary Taking these items in order we have E The length byte of the new word with high bit set for detection by TRA VERSE If NEWVOC were immediate bit 6 would be set also making this byte C6 Volume V No 3 FORTH Dimensions e is represented by example r CONTEXT latest word in NEWVOC vocabulary Cer NEWWORD UNK ete latest word in VOC2 vocabulary ae AA ri i ee eee eee VOC3 words not shown latest word in VOC1 vocabulary EDITOR words not shown ASSEMBLER words not shown es FORTH Unk Socr srao GRAFT VOO UNK est Jo ete latest word in FORTH vocabulary Detailed Structure of Exampie Vocabulary Tree Figure Three FORTH Dimensions 6 Volume V No 3 NEWVOC ASCII of
92. s Monthly 3rd Wed 7 p m Cochituate MA Dick Miller 617 653 6136 25 groups world wide Volume V No 3 FORTH Dimensions FORTH System Vendors by Category Codes refer to alphabetical listing e g Al signifies AB Computers etc Processors Z8D000 5 ccs vea o POR 9900 costis bu rotes C2 C3 F3 F6 L3 R1 R2 82 C3 F3 F5 K1 L3 M6 TI P4 C3 F3 L3 M6 TI C3 C5 DI El K1 P4 A5 C2 C3 F4 IS L1 L3 M3 M6 R1 T3 A3 AS C3 F4 I3 L1 M2 M3 M5 NI T3 C3 F2 F3 L1 L3 M6 EA L3 A3 AS C3 F3 13 L3 M1 M2 M6 T3 C3 FORTH Vendors Alphabetical The following vendors offer FORTH systems applications or con sultation FIG makes no judgment on any product and takes no responsibility for the accuracy of this list We encourage readers to FORTH Systems A 1 AB Computers 252 Bethlehem Pike Colmar PA 18915 215 822 7727 2 Acropolis 17453 Via Valencia San Lorenzo CA 94580 415 276 6050 4 Applied Analytics Inc 8910 Brookridge Dr 300 Upper Marlboro MD 20870 5 Aristotelian Logicians 2631 E Pinchot Ave Phoenix AZ 85016 7 Abstract Systems etc RFD Lower Prospect Hill Chester MA 01011 8 Armadillo Int Software P O Box 7661 Austin TX 78712 512 459 7325 1 Blue Sky Products 729 E Willow Signal Hill CA 90806 2 Business Computing Press 2210 Wilshire Blvd Suite 289 Santa Monica CA 90403 213 394
93. s a device that augments a processor by extending and or redefining the host s capability An ideal co processor shares the host s resources This shared resources ap proach also has a severe hardware limi tation a special co processor must ex ist for a specific microprocessor And in the case of Intel s 8086 a special 8087 Numeric Data Processor NDP is available The 16081 numeric co pro cessor exists for National s 16000 series and Motorola is developing an NDP for the 68000 The 8087 The 8087 is a true co processor It augments the register and instruction sets of the host 8086 88 microproces sor it enhances the variety of numeric data types and it accelerates the 8086 88 s numeric computation capa bilities The 5Mhz 8087 was initially FORTH Dimensions 20 Volume V No 3 introduced in July 1980 A newer fast er 8 Mhz 8087 is projected for Janu ary 1984 The 8087 has eight 80 bit registers two pointers a control regis ter and a status register supports seven data or number types performs all computations on a temporary real for mat 80 bit and has six principle in struction types Detailed technical in formation on the 8086 88 8087 can be found elsewhere One of the unique features of the 8087 illustrates how co processing in structions are interpreted In a maxi mum synchronized mode the NDP in terprets the instruction stream along with the host processor The NDP remains p
94. s reader letters regarding pro duct performance Addresses of the distributors and manufacturers men tioned in this column may be found in the Vendors List section The latest Forth news from Little Rock is that Hawg Wild Software of fers the XFORTH XCHANGE to original users of the XFORTH Forth 79 product Questions ideas and implementations should be sent to that company who says their newest service will be free and unrestricted Atari owners will be interested in Power Forth for the 800 800XL and 1200XL from Elcomp Publishing It is an extended FIG Forth with editor and I O routines The utilities package in cludes decompiler sector copy Atari filehandling graphics and sound joy stick program and player missile The 39 95 price also covers two game demos and a mailing list application Floating point with trig is an added 29 95 and the beginners subset Learn Forth requires 32K for disk or 16K for tape version costs 19 95 UNIX like word processing in Forth is the claim made for Forth ms The licensed source code runs on Apple Fig Chapters U S Palo Alto area e COLORADO Contact FIG Hotline Denver Chapter 415 962 8653 e ARIZONA Monthly 1st Mon 7 p m Phoenix Chapter Call Dennis L Wilson 602 956 7678 II computers using Epson printers with Graphtrax Plus but can be configured by the user for other printers Print spooling allows simultaneous use of printer and keyboard
95. sidents add appropriate sates tax Purchase orders accepted at our discretion Master Charge and Visa accepted Disk formats available Standard CP M 8 SSSD Northstar 5 QD Micropolis 5 QD Sage 5 DD Apple 5 Victor 9000 5 Kaypro 5 Osborne 51 DD Micromate 5 IBM PC 5 Standard MS DOS 5 SSDD Most other formats can be special ordered Laboratory Microsystems Inc 4147 Beethoven Street Los Angeles CA 90066 213 306 7412 i 2 80 is a registered trademark of Zilog Inc Augusta is a trademark of Computer Linguistics CP M is a registered trademark of Digital Research Inc dBASE ll is a trademark of Ashton Tate IBM is a registered trademark of International Business Machines Corp PC FORTH and PC GEN are trademarks of Laboratory Microsystems Inc FORTH Dimensions 16 Volume V No 3 0 RD 0 clears RAMDisk sets RAMDisk length RD n returns initial block of RAMDisk 2RD 2 n returns number of blocks in RAMDisk 22 RD 3 types a summary block on the screen This function call interface is implemented by GODO and is very easy to interface to existing programs Clearing the RAMDisk 0 RD should be done before use and is done simply by writing zero to the block numbers in the RAMDisk This opera tion checks the memory size and resets the RAMDisk origin and length allow ing the program to dynamically adapt to a different memory size and pro
96. sly when compiled within a colon definition The solution adopted was to make all words state dumb and to add words to handle some of the lost functions FIND was later made useful yet state dumb words remain A side effect of the state dumb sweep is that some words were made state dumb that would have been bet ter left state smart regardless of the tick decision For example there is no reason why ABORT should be state dumb The system dependent func tions associated with ABORT only appear within ABORT ABORT could have been of great use outside of a colon definition yet that has now been precluded Some current systems use mono addressing e g CFA or PFA yet the standard now dictates dual addressing e g CFA and PFA This tradeoff favors an easier implementation and was the subject of many hours of dis cussion Some of the original dissen tors still believe that a mono addressing system is easier to use Disk mass storage I O has been changed to disallow altering the data within a block buffer unless UPDATE is also used Even if EMPTY BUFFERS which is no longer a required word were used the alterations might still be written to disk Combined with the multi tasking implications BUFFER can no longer be used for a temporary scratch or data collection area Al though this codifies good program ming practice there are valid reasons why the standard should not be so restrictive A minor but
97. ssing the bulk through the name of the word Screen 399 provides two examples of how DUPX will duplicate the xth stack entry to the top of the stack This is similar to x PICK except the index is included in the name DROPX performs similar to the combination of n ROLL DROP The word SWAPXY Screen 314 extends the same concept one step fur ther in that it passes two single digit parameters It swaps the xth and the Yth stack entry The word VSWAP addrl addr2 used in line 10 will swap the contents of two addresses lt addrl gt and addr2 This word can be defined as VSWAP addrl addr2 2DUP OR e SWAP R gt SWAP Figure One displays some examples of usages D H 436 94 3 72 LORS 98 7 6 54 32 l OK DUP5 CP 5 9 8 76 542 1 5c0K DROP CR S 96765 43 21 OK DROP CR S 8 6 5 4 3 2 LOK SP OF 9 806 5 4 3 2 10K SWAP37 CF S 983654721 OK SWAP29 CR S 28365479 OK SWAPl5 CP S 5 SPACES SWAPS1 S 2836153795 2 8 32 00 54 7 9 1 0K Figure One Volume V No 3 19 FORTH Dimensions Stack Oriented Co Processors and Forth Dana Redington Redwood City California Ideally a computer can be adapted to a wide variety of laboratory situa tions provided that two conditions are met The first condition requires using an appropriate interactive environ ment Here Forth provides one of the best alternatives The second condition usually requires extending software to
98. st people now seem to prefer the new circular arithmetic DO LOOP Briefly the advantages are 1 the index I now has a full 65K range 2 there is no longer a need to have a separate LOOP for unsigned indices and 3 in most cases the new loop is faster than most older ones A few vendors would prefer that 0 0 DO LOOP would cause a null result It appears that if that result is desirable it could be obtained by using the new System Word Set and defining the desired function with a different name Note that old code which used the construct 0 0 DO would be incompatible in either case A closely related issue is that of the new version of LEAVE which causes control to transfer to the end of the loop There is an implementation issue here There is not adequate space to discuss the issue thoroughly but one vendor would prefer to have either a more complicated form called LEAVES or alternatively to allow only one occur rence of LEAVE within a given loop The default value of true for comparison operators now returns all bits set rather than just the low order bit In most cases a comparison is fol lowed by a test for non zero such as the word IF In that case there will be no difference If old code uses com parisons in conjunction with arithmetic operations then some change will be required to work under the new stan dard The simplest change is to follow the comparison with a negation operator
99. tage that some older code may need to be somewhat modified when nega tive arguments are employed In many cases previous ambiguities have been resolved or clarified There is at least one word which is ambiguous in certain rare cases It is important to realize that the new standard has not changed the meaning of this word from previous standards The problem arises from alternative Continued on page 30 ee RM UM Aa ii E MEMEMEEEGBGMSGOUSGESCESSEZETPCELEELTCCICIECCCIZTSIEEELTEIIIZEECEETE ELETIIEISETPLT ZL TLZIII IIIL l l D FORTH Dimensions 26 Volume V No 3 rr E muc T MUT Fr en a Forth 83 A Minority View Glenn S Tenney Belmont California Having participated as a member of the Forth Standards Team FST and as a referee of the 83 Standard I am strongly in favor of a new Forth Stan dard Despite the many weeks I devoted to this my professional con science did not allow me to vote to ac cept the 83 Standard For these reasons I was asked to document my concerns as well as those of others As you read this please remember that many of the following are the concerns of others and do not necessarily repre sent my own views The Forth 83 Standard has recently been accepted and is now being published Many people have been ex pressing varying degrees of concern over this new standard After discard ing a certain amount of gripes these concerns fall into one of four categories minor and
100. ties li Engineering a Scientific Applications E Turn Key Systems Inner Access Corporation P O Box 888 Belmont CA 94002 PHONE 415 591 8295 Volume V No 3 23 FORTH Dimensions CORDIC Algorithm Revisited Dave Freese Cape May Court House New Jersey I am employed as a senior engineer Screen 27 cre 25114 MQ CORDIC ALGORITHM words for machine code ing analyst and routinely use PL I l Pascal Fortran and BASIC at my place 2 HEX of employment Until recently Forth 3 4 create header with CFA pointing to body of word was just for hacking around at home B 2 CODE BASE HEX CREATE but it may just prove to be the answer 6 Pos mg r to a real Sorat problem AF WOT k I 7 terminate body of word with a jump to NEXT am developing special purpose wind g jp next speed direction instruments for the 9 NEXT 0C3 C NEXT LINK SMUDGE U S Navy and have been frustrated by 19 BASE the fat code produced by all of the ll compilers at my disposal None of the 12 DECIMAL compilers have the option of pruning 13 the object code by removing unwanted 14 support code When you are 15 gt downloading the resultant code to ROMSs a trade off must be made be tween code size and speed Forth may Screen 28 crc 5781 just let me have the best of both CORDIC ALGORITHM double number words worlds L 2DUP 2SWAP 2DROP D D 2 2 previously define
101. titled to software update at nominal cost FORTH Systems are 32 bit implementations that allow creation of programs as large as 1 megabyte The en tire memory address space of the 68000 or 8086 88 is supported directly for programs and data PC FORTH for PC DOS or CP M 86 0 0 cece hh rae 250 00 8086 FORTH fOr GPIM BO dor eta Brod i dee Re S RAEI E red oe be whe Ewes efe bn ee 250 00 68000 FORTH 4 TOF GCPIM GOK 4 559200 tracti DDR om eR do PE aH RICE PAPE VERA ee eg 400 00 Extension Packages for FORTH systems Software floating point Z 80 8086 PC only 0 ccc ce hn 100 00 Intel 8087 support 8086 PC only eee tenet marre 100 00 AMD 9511 support 8086 Z 80 only 0 6 ce ee hr hn 100 00 Color graphics with animation support PC only 0 0 0 0 cee ce eee RI 100 00 r Symbolic interactive debugger PC only 2 0 anann nuenean n 100 00 Gross feference Uutllily iiu e eo EIS a ERU or DARNOS CS VER oa ea whale Boats 25 00 PC GEN custom character sets PC only iiis re 50 00 PC TERM communications program for PC and Smartmodem 0 0 eee eee eee 60 00 Hierarchical file manager xis obi ob es hak de He ee eee EY be eee UE EK D Seeds 50 00 B tree index manager cosecha Weder era e ost ee e d deant De OW ee eal De as 125 00 B tree index and file manager 1 0 ccc cc eee eee II A 9 e man 200 00 QTF Screen editor and text formatter by Leo Brodie for IBM PC with IB
102. ts are inferred to be 16 bit num bers even though other types of ele ments exist e g character strings on a string stack or sprite planes on a gra phics stack The stack elements are stored one on top of the other where the most recently placed element on the stack is usually the first to come off that is a last in first out stack The stack is also a place to transform ele ments using the reverse polish num ber sequence 1 3 yields 4 OK There are different types of stacks in Forth The type is determined by the meaning of the stack elements what function the elements serve A data or parameter stack is used to store ele ments that usually represent data or the address of a variable A return stack is used to store numbers that usually rep resent program flow control parame ters like the code field address of the next word to be executed Unfortunately in Forth it becomes increasingly awkward to deal with numbers of larger sizes as in the rip ple of the carry bit problem beyond 16 bits The problem of larger numbers becomes more apparent on 16 and 32 bit computers Examples include attempting to access memory beyond the 64K byte limit and dealing with numbers well beyond 16 bits as in qua druple word arithmetic or floating point computation In such cases an al ternative is necessary There are three primary alternatives to augmenting the Forth stack environ ment They are in increas
103. will get their loca tion from the directory If at any time you move the screen to another loca tion just change the directory to show the proper screen number Any screen which depends on the word whose screen location has changed will not be affected A directory is specified by two screen numbers starting screen and ending screen The system remembers these values for the current working direc tory DIR will list the first screen of the current working directory To change the screen numbers of the current working directory ESTABLISH can be used starting scr gt lt ending scr gt ESTABLISH WWE WWE 820317 NEED NAMES NEED NAMES NAMES DEFINED CR Figure Two NENNEN DUUM DA AMA nnn Volume V No 3 11 FORTH Dimensions The defining word DIRECTORY at compile time takes two values from the stack which at run time will be used as arguments for ESTABLISH DIRECTORY 2CONSTANT DOES gt 2 ESTABLISH You could define a word DOC which when executed would establish the current working directory for documentation as follows assuming it to be on 45 through 47 45 47 DIRECTORY DOC You can even get the values from the current working directory NAME DOC DIR NAME DOC DIR END DIRECTORY DOC assuming that the current working directory has entries DOC DIR 45 DOC DIR END 47 poc will change the current working directory to the documentation direc tory Any number of working
Download Pdf Manuals
Related Search
Related Contents
Avec les bois feuillus français, vous avez le choix ! Novembre Sunbeam LC3200 User's Manual GDO Accessories BUS - Bitron Video C, D & E-Series Carton Clamps Guia do usuário Panasonic SC-HC17 10.一等航空整備士(飛) Copyright © All rights reserved.
Failed to retrieve file