Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Forth — Parallax Forums

Propeller Forth

EdKirkEdKirk Posts: 27
edited 2007-03-29 14:56 in Propeller 1
Guys,

I have succeeded in getting PROPELLER FORTH to run on my Protoboard.

Simple Forth commands work great.

How can I determine what Forth words have been defined and what they do.· There must be a way to access the Dictionary or the Glossary.

EdKirk

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-25 00:29
    Here's some code I wrote at the time to dump memory and the dictionary etc. Since nothing further has happened with this version I have restarted my own version of Forth for the Propeller that I had shelved at the time. My version is compiled from the Propeller tool and executes compact byte tokens. So it is easy to add Spin and ASM objects to roll your own kernel.

    *Peter*

    \ PBJ's q&d CLB propeller forth extensions
    hex
    \ convert start and cnt to form suitable for "DO"
    : bounds ( start cnt -- end start )
     over + swap ;
    
    : spaces ( cnt -- )
     0 do space loop ;
    
    : .hex ( nibble -- )
     30 + dup
     39 > if 7 + then
     emit ;
    
    \ Print as 2 hex digits regardless of current base
    : .byte ( byte -- )
     FF and 10 /mod .hex .hex ;
    
    : .word ( 16bits -- )
     FFFF and 100 /mod .byte .byte ;
    
    : .long
     dup 10 rshift .word .word ;
    
    : .chars ( adrh adrl -- )
     do i c@ 7F and
       dup 20 < if drop 2E then emit
     loop ;
    
    \ dump hex bytes + ascii from main memory
    : dump ( adr cnt -- )
     bounds
     do i 10 bounds
       do
         i 0F and 0= if cr i .word ." : " then
         i c@ .byte space
       loop
       2 spaces i 10 + i .chars
     10 +loop ;
    
    
    : variable
     [noparse][[/noparse] ' create H, ] 0 ,
     ;
    
    variable cksum
    ' Dump memory in INTEL hex format
    : IDUMP ( src cnt --- )
            HEX  BOUNDS
             DO 0 cksum !
             CR 3A EMIT
             10 DUP cksum +! .byte
             I FF AND cksum +! I 8 RSHIFT FF AND cksum +!
             I FFFF AND .word
             0 .byte I 10 BOUNDS
               DO I C@ DUP cksum +! .byte LOOP
             0 cksum C@ - .byte
             10 +LOOP
            CR ." :00000001FF" CR
            ;
    
    \ dump words from cog memory
    : ldump ( wadr wcnt -- )
     bounds
     do
       i 7 and 0= if cr i .word ." : " then
       i l@ .long space
     loop ;
    
    : ftype ( addr cnt -- )
     bounds do i c@ dup 0= if 20 + then emit loop ;
    
    : .head ( cfa -- )
     dup .word ." =[noparse][[/noparse]" \ print cfa
     dup h@ .word ." ] "
     cfa>nfa
     dup c@ 80 and if ." I" else ." ." then
     dup c@ 40 and if ." C" else ." ." then
     dup c@ 20 and if ." S" else ." ." then
     dup c@ 1F and .byte \ print count+atr
     space 1+ 7 ftype  \ print name
     4 spaces ;
    
    
    \ list dictionary words
    : WORDS
     0 latest @
     begin
       \ 4 words/line
       over 3 and 0= if cr then
       dup .head
       swap 1+ swap
       cfa>nfa nfa>lfa h@ dup
     while
     repeat
     2drop ;
    
    
    1F0 CONSTANT PAR
    1F1 CONSTANT CNT
    1F2 CONSTANT INA
    1F3 CONSTANT INB
    1F4 CONSTANT OUTA
    1F5 CONSTANT OUTB
    1F6 CONSTANT DIRA
    1F7 CONSTANT DIRB
    1F8 CONSTANT CTRA
    1F9 CONSTANT CTRB
    1FA CONSTANT FRQA
    1FB CONSTANT FRQB
    1FC CONSTANT PHSA
    1FD CONSTANT PHSB
    1FE CONSTANT VCFG
    1FF CONSTANT VSCL
    
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-25 01:00
    BTW, this is the word list in the format:-
    * main memory address (header)
    * cog address
    * attributes (Immediate, Compile only)
    * name count
    * name



    *Peter*


    WORDS
    
    221E=[noparse][[/noparse]003C] ...04 VSCL       2210=[noparse][[/noparse]003C] ...04 VCFG       2202=[noparse][[/noparse]003C] ...04 PHSB       21F4=[noparse][[/noparse]003C] ...04 PHSA
    21E6=[noparse][[/noparse]003C] ...04 FRQB       21D8=[noparse][[/noparse]003C] ...04 FRQA       21CA=[noparse][[/noparse]003C] ...04 CTRB       21BC=[noparse][[/noparse]003C] ...04 CTRA
    21AE=[noparse][[/noparse]003C] ...04 DIRB       21A0=[noparse][[/noparse]003C] ...04 DIRA       2192=[noparse][[/noparse]003C] ...04 OUTB       2184=[noparse][[/noparse]003C] ...04 OUTA
    2176=[noparse][[/noparse]003C] ...03 INB        2168=[noparse][[/noparse]003C] ...03 INA        215A=[noparse][[/noparse]003C] ...03 CNT        2112=[noparse][[/noparse]001D] ...05 WORDS
    2074=[noparse][[/noparse]001D] ...05 .head      2048=[noparse][[/noparse]001D] ...05 ftype      202A=[noparse][[/noparse]001D] ...05 ldump      1FE2=[noparse][[/noparse]001D] ...05 IDUMP
    1FD2=[noparse][[/noparse]004B] ...05 cksum      1FB8=[noparse][[/noparse]001D] ...08 variabl    1F56=[noparse][[/noparse]001D] ...04 dump       1F32=[noparse][[/noparse]001D] .C.06 .chars
    1F16=[noparse][[/noparse]001D] ...05 .long      1EF2=[noparse][[/noparse]001D] ...05 .word      1ED0=[noparse][[/noparse]001D] ...05 .byte      1EA0=[noparse][[/noparse]001D] ...04 .hex
    1E84=[noparse][[/noparse]001D] ...06 spaces     1E70=[noparse][[/noparse]001D] ...06 bounds     1E5E=[noparse][[/noparse]001D] ...07 SECONDS    1E38=[noparse][[/noparse]001D] ...02 HZ
    1E20=[noparse][[/noparse]001D] ...0C MILLISE    1E0C=[noparse][[/noparse]001D] ...06 REBOOT     1DF6=[noparse][[/noparse]001D] ...07 LOCKRET    1DE0=[noparse][[/noparse]001D] ...07 COGSTOP
    1DC8=[noparse][[/noparse]001D] ...05 COGID      1DB2=[noparse][[/noparse]001D] ...06 CLKSET     1D88=[noparse][[/noparse]001D] ...07 LEDEMIT    1D76=[noparse][[/noparse]001D] ...06 SECOND
    1D68=[noparse][[/noparse]003C] ...04 VSCL       1D5A=[noparse][[/noparse]003C] ...04 VCFG       1D4C=[noparse][[/noparse]003C] ...04 PHSB       1D3E=[noparse][[/noparse]003C] ...04 PHSA
    1D30=[noparse][[/noparse]003C] ...04 FRQB       1D22=[noparse][[/noparse]003C] ...04 FRQA       1D14=[noparse][[/noparse]003C] ...04 CTRB       1D06=[noparse][[/noparse]003C] ...04 CTRA
    1CF8=[noparse][[/noparse]003C] ...04 DIRA       1CEA=[noparse][[/noparse]003C] ...04 OUTA       1CDC=[noparse][[/noparse]003C] ...03 INA        1CCE=[noparse][[/noparse]003C] ...03 CNT
    1CC0=[noparse][[/noparse]003C] ...03 PAR        1CB2=[noparse][[/noparse]003C] ...08 'CLKFRE    1C58=[noparse][[/noparse]001D] ...0B INTERAC    1C24=[noparse][[/noparse]001D] ...05 PAUSE
    1C10=[noparse][[/noparse]001D] ...08 ACTIVAT    1BCA=[noparse][[/noparse]001D] ...0A START-T    1B96=[noparse][[/noparse]001D] ...0D SCHEDUL    1B82=[noparse][[/noparse]001D] ...0E ANONYMO
    1B6A=[noparse][[/noparse]001D] ...04 TASK       1B4E=[noparse][[/noparse]001D] ...09 TCB-ALL    1B3C=[noparse][[/noparse]001D] ...09 THIS-TA    1B02=[noparse][[/noparse]001D] ...0A USER-AL
    1AC4=[noparse][[/noparse]001D] ...0C INIT-TA    1AB0=[noparse][[/noparse]001D] ...08 TCB>PRE    1A9C=[noparse][[/noparse]001D] ...08 TCB>NEX    1A88=[noparse][[/noparse]001D] ...09 TCB>FLA
    1A74=[noparse][[/noparse]001D] ...06 TCB>SP     1A66=[noparse][[/noparse]001D] ...09 TCB>UAD    1A52=[noparse][[/noparse]001D] ...04 #TCB       19FA=[noparse][[/noparse]001D] ...04 FIND
    19D8=[noparse][[/noparse]001D] ...02 .S         19AC=[noparse][[/noparse]001D] ...05 THROW      197E=[noparse][[/noparse]001D] ...05 CATCH      1968=[noparse][[/noparse]001D] I..01 \
    1952=[noparse][[/noparse]001D] I..01 (          192E=[noparse][[/noparse]001D] I..02 S"         1902=[noparse][[/noparse]001D] ...04 (S")       18E6=[noparse][[/noparse]001D] I..02 ."
    18BE=[noparse][[/noparse]001D] ...04 (.")       18A4=[noparse][[/noparse]001D] I..05 +LOOP      188A=[noparse][[/noparse]001D] I..04 LOOP       1874=[noparse][[/noparse]001D] I..02 DO
    185A=[noparse][[/noparse]001D] I..06 REPEAT     1844=[noparse][[/noparse]001D] I..05 WHILE      182E=[noparse][[/noparse]001D] I..05 UNTIL      1818=[noparse][[/noparse]001D] I..05 AGAIN
    1808=[noparse][[/noparse]001D] I..05 BEGIN      17EE=[noparse][[/noparse]001D] I..04 ELSE       17DE=[noparse][[/noparse]001D] I..04 THEN       17C8=[noparse][[/noparse]001D] I..02 IF
    17B2=[noparse][[/noparse]001D] I..02 .(         1790=[noparse][[/noparse]001D] ...01 '          174E=[noparse][[/noparse]001D] I..08 POSTPON    1730=[noparse][[/noparse]001D] ...06 !COLON
    170E=[noparse][[/noparse]001D] ...09 !CONSTA    16F6=[noparse][[/noparse]001D] I..03 [noparse][[/noparse]']        16DE=[noparse][[/noparse]001D] I..01 ;          16CA=[noparse][[/noparse]001D] ...08 CONSTAN
    16B4=[noparse][[/noparse]001D] ...01 :          163A=[noparse][[/noparse]001D] ...06 CREATE     1618=[noparse][[/noparse]001D] ...09 IMMEDIA    15F6=[noparse][[/noparse]001D] ...06 REVEAL
    15D4=[noparse][[/noparse]001D] ...04 HIDE       157E=[noparse][[/noparse]001D] ...0A NAME-MA    1556=[noparse][[/noparse]001D] ...04 3DUP       1500=[noparse][[/noparse]001D] ...07 COMPARE
    14A6=[noparse][[/noparse]001D] ...0C CASE-CO    1482=[noparse][[/noparse]001D] ...0A >LOWERC    1424=[noparse][[/noparse]001D] ...04 QUIT       1404=[noparse][[/noparse]001D] ...07 ?REFILL
    139E=[noparse][[/noparse]001D] ...09 INTERPR    1378=[noparse][[/noparse]001D] ...0C DIGIT>N    12EE=[noparse][[/noparse]001D] ...07 >NUMBER    128E=[noparse][[/noparse]001D] ...07 NUMBER?
    1244=[noparse][[/noparse]001D] ...06 DIGIT?     1210=[noparse][[/noparse]001D] ...09 MAX-DIG    11E2=[noparse][[/noparse]001D] ...07 BETWEEN    11B2=[noparse][[/noparse]001D] ...0A PARSE-W
    119A=[noparse][[/noparse]001D] I..06 [noparse][[/noparse]CHAR]     1184=[noparse][[/noparse]001D] ...04 CHAR       111E=[noparse][[/noparse]001D] ...05 PARSE      10A8=[noparse][[/noparse]001D] ...01 ]
    1092=[noparse][[/noparse]001D] I..01 [noparse][[/noparse]          107E=[noparse][[/noparse]001D] ...05 ABORT      1068=[noparse][[/noparse]001D] ...04 ?DUP       1042=[noparse][[/noparse]001D] ...07 ACCEPT2
    0F96=[noparse][[/noparse]001D] ...06 ACCEPT     0F2C=[noparse][[/noparse]001D] ...01 .          0F14=[noparse][[/noparse]001D] ...06 RUBOUT     0EFC=[noparse][[/noparse]001D] ...03 PAD
    0ECE=[noparse][[/noparse]001D] I..07 STRING,    0EAA=[noparse][[/noparse]001D] ...08 XALIGNE    0E96=[noparse][[/noparse]001D] ...08 HALIGNE    0E82=[noparse][[/noparse]001D] ...07 ALIGNED
    0E6C=[noparse][[/noparse]001D] ...06 HALIGN     0E56=[noparse][[/noparse]001D] ...05 ALIGN      0E2C=[noparse][[/noparse]001D] ...05 DIGIT      0E00=[noparse][[/noparse]001D] ...04 TYPE
    0DEC=[noparse][[/noparse]001D] ...08 <RESOLV    0DDC=[noparse][[/noparse]001D] ...05 MARK>      0DC4=[noparse][[/noparse]001D] ...05 <MARK      0DAE=[noparse][[/noparse]001D] ...08 RESOLVE
    0D9A=[noparse][[/noparse]001D] ...07 NFA>LFA    0D86=[noparse][[/noparse]001D] ...07 NFA>CFA    0D72=[noparse][[/noparse]001D] ...07 CFA>NFA    0D62=[noparse][[/noparse]001D] ...08 COMPILE
    0D48=[noparse][[/noparse]001D] ...02 C,         0D2E=[noparse][[/noparse]001D] ...02 H,         0D14=[noparse][[/noparse]001D] ...01 ,          0CFC=[noparse][[/noparse]001D] ...05 ALLOT
    0CEA=[noparse][[/noparse]001D] ...04 HERE       0CD8=[noparse][[/noparse]001D] ...05 SPACE      0CB8=[noparse][[/noparse]001D] ...0A PARSE-A    0CA4=[noparse][[/noparse]001D] ...06 SOURCE
    0C8E=[noparse][[/noparse]001D] ...07 DECIMAL    0C78=[noparse][[/noparse]001D] ...03 HEX        0C6A=[noparse][[/noparse]003C] ...02 BL         0C58=[noparse][[/noparse]001D] ...03 S>D
    0C48=[noparse][[/noparse]001D] ...03 D>S        0C2A=[noparse][[/noparse]001D] ...04 /MOD       0C18=[noparse][[/noparse]001D] ...01 /          0C06=[noparse][[/noparse]001D] ...02 <>
    0BF4=[noparse][[/noparse]001D] ...04 TUCK       0BDA=[noparse][[/noparse]001D] ...02 +!         0BC6=[noparse][[/noparse]001D] ...02 CR         0BB4=[noparse][[/noparse]001D] ...01 *
    0BA2=[noparse][[/noparse]001D] ...05 2DROP      0B90=[noparse][[/noparse]001D] ...04 2DUP       0B80=[noparse][[/noparse]001D] ...09 HALFCEL    0B6C=[noparse][[/noparse]001D] ...05 CELLS
    0B5E=[noparse][[/noparse]001D] ...05 CHARS      0B4A=[noparse][[/noparse]001D] ...05 #USER      0B3A=[noparse][[/noparse]0043] ...03 TIB        0B2A=[noparse][[/noparse]0043] ...07 HANDLER
    0B1A=[noparse][[/noparse]0043] ...0A FIRST-W    0B0A=[noparse][[/noparse]0043] ...04 RSP0       0AFA=[noparse][[/noparse]0043] ...03 SP0        0AEA=[noparse][[/noparse]0043] ...0B SOURCEC
    0ADA=[noparse][[/noparse]0043] ...03 >IN        0ACA=[noparse][[/noparse]0043] ...05 STATE      0AB8=[noparse][[/noparse]0043] ...04 BASE       0AAA=[noparse][[/noparse]003C] ...05 FALSE
    0A9C=[noparse][[/noparse]003C] ...04 TRUE       0A84=[noparse][[/noparse]001D] ...04 PAGE       0A6A=[noparse][[/noparse]0050] ...02 DP         0A4A=[noparse][[/noparse]0050] ...08 OPERATO
    0A3C=[noparse][[/noparse]003C] ...07 TIBSIZE    0A2E=[noparse][[/noparse]003C] ...06 'DOVAR     0A20=[noparse][[/noparse]003C] ...08 'CURREN    0A12=[noparse][[/noparse]003C] ...07 'KERNEL
    0A02=[noparse][[/noparse]0050] ...06 LATEST     09F2=[noparse][[/noparse]0180] ...03 BYE        09E6=[noparse][[/noparse]017B] ...05 HUBOP      09DA=[noparse][[/noparse]0176] ...07 WAITCNT
    09CE=[noparse][[/noparse]0170] ...04 WAIT       09C2=[noparse][[/noparse]016C] ...04 RSP@       09B6=[noparse][[/noparse]0168] ...03 SP@        09AA=[noparse][[/noparse]0164] ...02 U0
    099E=[noparse][[/noparse]0160] ...04 USP!       0992=[noparse][[/noparse]015C] ...04 RSP!       0986=[noparse][[/noparse]0158] ...03 SP!        097A=[noparse][[/noparse]0154] ...01 I
    096E=[noparse][[/noparse]0147] ...07 (+LOOP)    0962=[noparse][[/noparse]013C] ...06 (LOOP)     0956=[noparse][[/noparse]0137] ...06 BRANCH     094A=[noparse][[/noparse]0132] ...07 0BRANCH
    093E=[noparse][[/noparse]012C] ...07 ?BRANCH    0932=[noparse][[/noparse]012A] ...02 1-         0926=[noparse][[/noparse]0128] ...02 1+         091A=[noparse][[/noparse]011D] ...06 (/MOD)
    090E=[noparse][[/noparse]010F] ...02 M*         0902=[noparse][[/noparse]010A] ...02 U<         08F6=[noparse][[/noparse]0107] ...02 0=         08EA=[noparse][[/noparse]0105] ...02 0<
    08DE=[noparse][[/noparse]0100] ...01 >          08D2=[noparse][[/noparse]00FB] ...01 =          08C6=[noparse][[/noparse]00F6] ...01 <          08BA=[noparse][[/noparse]00F1] ...09 INVERTA
    08AE=[noparse][[/noparse]00EF] ...06 INVERT     08A2=[noparse][[/noparse]00EB] ...02 OR         0896=[noparse][[/noparse]00E7] ...03 AND        088A=[noparse][[/noparse]00E3] ...03 MIN
    087E=[noparse][[/noparse]00DF] ...03 MAX        0872=[noparse][[/noparse]00DA] ...06 RSHIFT     0866=[noparse][[/noparse]00D5] ...06 LSHIFT     085A=[noparse][[/noparse]00D3] ...06 NEGATE
    084E=[noparse][[/noparse]00D1] ...02 2/         0842=[noparse][[/noparse]00CF] ...02 2*         0836=[noparse][[/noparse]00CA] ...01 -          082A=[noparse][[/noparse]00C6] ...01 +
    081E=[noparse][[/noparse]00B3] ...03 KEY        0812=[noparse][[/noparse]00A4] ...04 EMIT       0806=[noparse][[/noparse]00A0] ...02 L@         07FA=[noparse][[/noparse]0099] ...02 L!
    07EE=[noparse][[/noparse]0097] ...01 @          07E2=[noparse][[/noparse]0095] ...02 H@         07D6=[noparse][[/noparse]0093] ...02 C@         07CA=[noparse][[/noparse]008C] ...01 !
    07BE=[noparse][[/noparse]008A] ...02 H!         07B2=[noparse][[/noparse]0088] ...02 C!         07A6=[noparse][[/noparse]007F] ...03 2>R        079A=[noparse][[/noparse]007B] ...02 R@
    078E=[noparse][[/noparse]0076] ...02 R>         0782=[noparse][[/noparse]0071] ...02 >R         0776=[noparse][[/noparse]006F] ...03 NIP        076A=[noparse][[/noparse]0067] ...03 ROT
    075E=[noparse][[/noparse]0062] ...04 OVER       0752=[noparse][[/noparse]005F] ...04 DROP       0746=[noparse][[/noparse]005C] ...03 DUP        073A=[noparse][[/noparse]0057] ...04 SWAP
    072E=[noparse][[/noparse]0050] ...07 DOVAR32    0722=[noparse][[/noparse]004B] ...05 DOVAR      0716=[noparse][[/noparse]0043] ...06 DOUSER     070A=[noparse][[/noparse]003C] ...05 DOCON
    06FE=[noparse][[/noparse]0037] ...07 EXECUTE    06F2=[noparse][[/noparse]002F] ...05 LIT16      06E6=[noparse][[/noparse]0025] ...07 LITERAL    06DA=[noparse][[/noparse]0022] ...04 EXIT
    06CE=[noparse][[/noparse]001D] ...05 ENTER      06C2=[noparse][[/noparse]0019] ...04 NEXT        ok
    
    
  • EdKirkEdKirk Posts: 27
    edited 2007-03-26 02:46
    Thanks Peter.

    Your reply gives me a good start.

    EDKirk
  • fred2fred2 Posts: 47
    edited 2007-03-28 22:16
    Having done some Forth programming in the past, I am anxious to try this on a demo board. I read all the
    past messages looking for the download but the best I could find was a binary file in one of the past messages.
    Although there was a source file listed, it was not present when I tried to download it. I did get the binary file
    and the following instruction indicated:

    From this page, you can download a binary image of PropellerForth, suitable for transfer directly to the Parallax Propeller chip using the Propeller Tool.

    How do you load a binary file to the propellor using the Propellor tool? I read through all the docs in the Hydra
    manual but I didn't see any reference to being able to upload a binary file to the propellor...

    I may be mis-reading some of this, I have been known to do things like that -- so please be kind to a propellor
    newbie.

    Fred2
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-28 22:20
    In the open dialog (when you choose Open from the File menu), there's a selector for the type of file. By default it's set to open Spin files. You can change it to open binary files or all files. Once you've opened it, you can download it using the usual Fn keys and menu items.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-28 22:30
    Click on FILE, OPEN, Files of type: (binary), then you can load to RAM or EEPROM from there.

    Cliff wrote this Forth and there is no Spin/ASM source available as the binary was assembled from Cliff's Propasm tool. Cliff has since been abducted by aliens.

    *Peter*
  • fred2fred2 Posts: 47
    edited 2007-03-29 01:49
    Thank you, thank you, thank you!

    I hope the aliens take pity on us and let him do some more wonderful programs..

    I'm getting ready to do some FORTH!!!

    Fred2
  • rjo_rjo_ Posts: 1,825
    edited 2007-03-29 02:24
    Fred2

    I have a compound question.

    (I haven't really looked at FORTH, but I've read a little about it. I did look at Cliff's website and I am afraid that Peter is right... except, I suspect Cliff might actually BE an alien, living among us. I am afraid that he might have gotten bored and just left.[noparse]:)[/noparse]

    I even went as far as to forgo my usual reasons for accessing the newsgroups and looked at the Forth stuff there... to put it mildly, if you wanted to engage in anti-Forth advertising you couldn't do it better than the newsgroups do... I didn't find a single question that seemed like it was in English or a single answer that didn't sound like it was a joke I would appreciate... if I could understand it.

    1) I was half-thinking about the Propeller for some number theory stuff... and Forth seems like it could do things like very big numbers... would that be accurate?

    and

    b) do I have to join a cult or can normal people learn Forth?

    For instance, with what you now know... if you sat down to create a huge number capacity in Forth... how long would it take you?
    Let's say for argument that by "huge number" we mean integers of unlimited scale, with support in the usual operators.

    Rich

    ps... I'm getting old. So, write slowly.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-29 03:18
    rjo_ said...
    Fred2

    I have a compound question.

    (I haven't really looked at FORTH, but I've read a little about it. I did look at Cliff's website and I am afraid that Peter is right... except, I suspect Cliff might actually BE an alien, living among us. I am afraid that he might have gotten bored and just left.[noparse]:)[/noparse]

    I even went as far as to forgo my usual reasons for accessing the newsgroups and looked at the Forth stuff there... to put it mildly, if you wanted to engage in anti-Forth advertising you couldn't do it better than the newsgroups do... I didn't find a single question that seemed like it was in English or a single answer that didn't sound like it was a joke I would appreciate... if I could understand it.

    1) I was half-thinking about the Propeller for some number theory stuff... and Forth seems like it could do things like very big numbers... would that be accurate?

    and

    b) do I have to join a cult or can normal people learn Forth?

    For instance, with what you now know... if you sat down to create a huge number capacity in Forth... how long would it take you?
    Let's say for argument that by "huge number" we mean integers of unlimited scale, with support in the usual operators.

    Rich

    ps... I'm getting old. So, write slowly.


    Ok rjo, I'm writing slowly, each character is taking approximately 200,000,000,000ps to type so bear with me.

    b)
    I'm sorry to tell you that if you need to ask whether you need to join a cult to learn Forth then you are not "one of us". Forth is a write-only language incomprehensible to the uninitiated. Forth is not learned, it is something instinctive to the select few and incantations are best carried out in dark basements away from bright corporate lights.

    Computer languages are much the same really, you just need to learn the rules. Unfortunately Forth has no rules which makes it that much harder to learn. Most conventional languages require strict syntax and strong data typing to suit the compiler and since there are very few ways of doing one thing it is easy to teach and learn.

    Forth IS the compiler, and the O/S, and the language, the debugger etc. So the "compiler" can be rehashed simply to suit the application and the language changed to suit the applicator etc. This is why Forth is dangerous in the hands of the uninitiated, like the wizard's apprentice you can end up making a real mess of things.

    What IS required is a different way of thinking, you are not bound by compiler rules so you can make the rules that suit. Have a look at the online book "Thinking Forth" by Leo Brodie thinking-forth.sourceforge.net/

    Yes, you can handle big big numbers contrary to what most people think (because Forth does not come standard with Floating Point (sinful!)). The secret is in the extensible nature of the language so that you could define 256-bit numbers and number handlers if you wished.

    Ok, I better get back to abduct some more humans delving into alien concepts.

    *Peter*
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-03-29 03:30
    Peter!

    Love that!

    Love the Prop for same reasons.

    I have fallen in love three times.

    First time with present wife. That was a long time ago.

    Second time when I learned about Forth back in 1981 (I think).

    Third time when I met the Propeller.

    Falling in love every twentieth year keeps you young at heart.
  • rjo_rjo_ Posts: 1,825
    edited 2007-03-29 12:19
    Peter,

    Thanks!!!

    Rich
  • fred2fred2 Posts: 47
    edited 2007-03-29 13:57
    rjo

    read your message a little late, so I am a few messages from your original post.

    when an early home computer came out in the pre-pc days termed the "jackintosh", I was so anxious to
    get one that I haunted a local store until the first one arrived and snapped it up. Unfortunately, (as was
    the case in those days) there were no programs available except for a FORTH implementation. I was
    more used to assembly languages but I was determined to get a memory dump and so I pored over the
    FORTH specs and by "cut and try" experimentation, I managed to get a dump working. I was so impressed
    with the FORTH capabilities that I wrote an article about the process and it was published in one of the
    computer magazines at the time. BUt I hadn't used FORTH since then and now here is my chance to
    do it again.

    I have learned how to upload the binary file to the demo board but I have had no success in getting a
    display, either on TV or VGA. And since it is a binary, I don't know where or how to debug it to find the
    problem. I do see that the pin leds 17,19,21 and 23 are lit if that is a significant clue. I would appreciate
    any suggestions....

    I, too, am interested in number theory and playing with large numbers. One of my goals with the Propellor
    was to write a program called TRAC which is a string handling program that uses only integers and can
    generate extremely large numbers for analysis. I have written versions of TRAC for many early machines
    like the PDP8 and similar small computers.

    Can anyone suggest some steps to get the FORTH program active on the demo board? And is the output
    supposed to be TV or VGA?

    Fred2
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-03-29 14:18
    Fred, sad to hear you had sallied Forth only to "dump" it. This Forth binary is very basic and there is not much you can do with it as it just uses the serial RX & TX pins for coms. Even there it is slow and needs a lot of delays after each character and line just to work. There is no VGA or TV output with it unfortunately, it is a little more than a demo program.

    As I have mentioned previously I am writing my own Propeller Forth (restarting actually) but it uses the Propeller tool environment so you can add the objects that you wish to etc. Once you have downloaded your "distro" of Forth into EEPROM it is possible to develop and test Forth programs independent of the PC, especially if you have extra storage connected such as an SD card.

    Hopefully, if I don't get too sidetracked I will release some code in the next few weeks.

    *Peter*
  • fred2fred2 Posts: 47
    edited 2007-03-29 14:56
    Thanks for the quick response, Peter.

    In the meantime, I tried various speeds in Hyperterm until I hit the right one and got
    a display indicating "PropellorForth v1.0 20061112" and "Ready". I tried keyboard input
    but no response.

    The "dump" I referred to was a program to do a memory dump, not a criticism of the program.... smile.gif

    Now I understand why there was no output to TV or VGA.

    I am now more anxious than ever to try FORTH on the demo board. All the previous messages
    gave the impression that people had been using the program and that is what gave me the
    idea to try it.

    Good luck and I will anxiously await any further code releases.

    Fred2
Sign In or Register to comment.