Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!troi.cc.rochester.edu!lm03_cif From: lm03_cif@troi.cc.rochester.edu (Larry Moss) Newsgroups: comp.lang.forth Subject: PolyFORTH installation/troubleshooting Summary: novice forth user wants to strangle PolyFORTH manual writers Keywords: help, no memory, poor code Message-ID: <14433@ur-cc.UUCP> Date: 11 Jun 91 17:49:32 GMT Sender: news@uhura.cc.rochester.edu Organization: University of Rochester - Rochester, New York Lines: 132 I'm a novice forth user and I'm running into some difficulty with PolyFORTH running on an AST 286 machine with a TMS320c25 DSP board in it. Hopefully someone reading this has a similar system and can be more helpful than FORTH Inc.'s tech support. Alternatively, if you know of another FORTH system that will work with a DSP board (preferably, but not necessarily the one mentioned above) I'd be interested in hearing about that too. I'm not incredibly pleased with PolyFORTH or the people on the phone. (FOr those curious about why a non-FORTH programmer is looking specificaly for a FORTH system to do this, we already have a tremendous amount of the code we need. Due to the time frame we're looking at we don't particularly want to rewrite everything in another language - and I am having fun with forth.) Some of my problems are definitely system specific. Others might be eliminated by better coding. I'll start with a system specific problem in the hopes that that will solve some other problems on its own. The installation section of the manual says to type ".RAM" after starting up forth to examine the memory on the board and make sure it's configured correctly. I'm fairly certain I have the board configured correctly now but I still get the message "No low program RAM." Should I be concerned? The person I spoke to on the phone about this said that I should probably ignore it, but he couldn't remember if it had anything to do with a bug in old releases of the software. (He then went on to tell me that we should purchase a support contract.) The next step in the manual is to make sure the information in block 1 is correct for the system. I'm having a lot of trouble following the book. Can someone tell me what it should look like for a board that has two 32K x 8 chips (first two sockets) and 8K x 8 on the rest? After playign with thte configuration a bit I figured I would try to rebuild the system, following the steps in the manual: COMPILER LOAD NUCLEUS LOAD TESTING LOAD INSTALL That just gives me something like "Error spawning shell." Now here's the part that better coding might be able to fix. Otherwise, would some PolyFORTH guru please straighten me out? In trying to get up to speed with the system I'm using I've been playing with some simple programs that I've grabbed from various places and modified a bit on my own. Below is code for the towers of hanoi that I've been working with. It works reasonably in the IBM FORTH environment, but not the DSP FORTH. In IBM FORTH, my biggest problem is that the number input routine (taken directly from "Starting Forth" doesn't like backspacing. RAther than backspacing a character on the screen it prints a character that I assume is what it thinks is the ascii equivalent of 8. I also had to redefine ASCII to get it to work correctly. That code is also taken from "Starting Forth". I was also succesful in using the turnkey compiler to get this to work as a stand alone program. Now the important part - getting code to run on the DSP board. If I run HANOI, the number input stuff doesn't work at all. If I run TOWERS-OF-HANOI with the proper stuff on the stack, it restarts DSP FORTH. If I ever manage to get this to run I'll need to learn how to use the target compiler next. The examples in teh manual for that don't seemto work either. I hadn't intended for this to be so long. I hope some one actually makes it this far and is willing to help. I'd appreciate any advice anyone has to offer. Thanks in advance, Larry \ Block #1800 ( The Towers Of Hanoi - Salman, Tisserand, Toulout) : TOWERS ; VARIABLE MOVES : -ROT ( A B C -- C A B) ROT ROT ; : COPY ( X Y Z -- X Y Z X Y Z ) >R 2DUP R@ -ROT R> ; : DISPOSE ( X Y Z -- ) 2DROP DROP ; : EDIT ( D A N -- D A N) COPY DROP SWAP ." From: " . ." To: " . CR ; : PREPARE-CALL ( D A N -- D A N D I N-1) COPY -ROT OVER + 6 SWAP - ROT 1- ; : PREPARE-RETURN ( D A N -- D A N I A N-1) COPY SWAP ROT OVER + 6 SWAP - SWAP ROT 1- ; \ Block #1801 : TOWERS-OF-HANOI ( DEPARTURE ARRIVAL NUMBER --) DUP IF PREPARE-CALL RECURSE 1 MOVES +! EDIT PREPARE-RETURN RECURSE THEN DISPOSE ; : HANOI ( -- ) 0 MOVES ! 1 3 PAGE ." How many disks are there? " 2 DIGITS CR TOWERS-OF-HANOI MOVES @ ." IT TOOK " . ." MOVES" CR ; \ Block #1802 \ NUMERIC INPUT 1 OF 2 - FROM "STARTING FORTH" : BACK 8 EMIT ; : BS? ( C -- T=BACKSPACE-KEY) 8 = ; : CR? ( c -- t=return-key) 13 = ; \ FIX ASCII SO IT WORKS INSIDE OF : DEFINITIONS : ASCII ( -- c ) \ Compile: c ( -- ) \ Interpret: c ( -- c) BL WORD 1+ C@ STATE @ IF [COMPILE] LITERAL THEN ; IMMEDIATE : #? ( c -- t=valid-digit) ASCII 0 ASCII 9 1+ WITHIN ; \ Block #1803 \ NUMERIC INPUT 2 OF 2 : ACCEPT ( 1st-adr last-a+1 curr-adr c -- 1st-adr last curr' ) >R 2DUP > IF R@ DUP EMIT OVER C! 1+ THEN R> DROP ; : REVERSE ( 1st-adr last-a+1 curr-adr c -- 1st-adr last curr') DROP SWAP >R 2DUP < IF BACK SPACE BACK 1- DUP 1 BLANK THEN R> SWAP ; : EXPECT# ( a max-width -- actual-width) OVER + OVER BEGIN KEY DUP CR? NOT WHILE DUP #? IF ACCEPT ELSE DUP BS? IF REVERSE ELSE DROP THEN THEN REPEAT ROT 2DROP SWAP - ; : DIGITS ( #digits -- d ) PAD SWAP 2DUP 1+ BLANK EXPECT# DROP PAD 1- NUMBER ; -- lm03_cif@uhura.cc.rochester.edu / "Sixty minutes of thinking of any kind is lmo3_ss@db1.cc.rochester.edu / bound to lead to confusion and unhappiness." lmo3_ss@uordbv.bitnet / - James Thurber