PropForth 2.7
prof_braino
Posts: 4,313
Version 2.7 is no long the current release of PropForth
Please see the new thread for PropForth 3.2
http://forums.parallax.com/forums/default.aspx?f=25&m=468264
There is a new version of PropForth on google code http://code.google.com/p/propforth/
PropForth 2.7 has several changes:
fixed the error in the "saveforth" word
updates to documentation
instructions to generate new propforth.spin code
Additional updates to the documentation will be posted in the next week or so,
currently enough is present to get up and running.
Questions and comments are welcome.
Please point out anything that needs clarification.
Notice: PropForth is separate from propellerforth, which unfortunately has not been updated since 2008
and does not have any source available.
PropForth has the spin source posted and can be modified in the source in addition to or in combination with modifying the forth dictionary
Cheers!
braino
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/18/2010 2:11:02 PM GMT
Please see the new thread for PropForth 3.2
http://forums.parallax.com/forums/default.aspx?f=25&m=468264
There is a new version of PropForth on google code http://code.google.com/p/propforth/
PropForth 2.7 has several changes:
fixed the error in the "saveforth" word
updates to documentation
instructions to generate new propforth.spin code
Additional updates to the documentation will be posted in the next week or so,
currently enough is present to get up and running.
Questions and comments are welcome.
Please point out anything that needs clarification.
Notice: PropForth is separate from propellerforth, which unfortunately has not been updated since 2008
and does not have any source available.
PropForth has the spin source posted and can be modified in the source in addition to or in combination with modifying the forth dictionary
Cheers!
braino
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/18/2010 2:11:02 PM GMT
Comments
I have a project that the interactivity of FORTH would be helpful, but I need another serial port, one port to monitor the prop, one to communicate with other hardware. Is that possible?
If you get a change to look at the documentation on the serial.f extension, please post comments and questions. The documentation is being re-written so that an average person other than the author (i.e. me) can understand it, and your questions will move a given topic towards the top of the list.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
This who understand binary, and those who don't
Just out of curiosity, why is the serial driver statically assigned to a specific cog? Typically, you do not want to make static cog assignments but, rather, let cognew do the assigning for you. cogstart coginit should almost never be used for starting cogs.
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 6/1/2010 8:37:59 PM GMT
That's a question for Sal Sanci. As far as I know from the comments, Spin starts in cog0, starts the serial driver in cog7, and starts cog6 as a forth cog. The other cogs are idle until you do something in cog 6 to start them as additional (forth) cogs.
I think its might be because this forth is closer to assembler than spin. Forth tends to be "close to the metal". Neither of the words cognew or cogstart appear in the in the source code. This makes sense since those are spin words, and this forth is based on the small section of assembler that precedes "ForthDictStart" in the propforth.spin file. The spin portion only uses coginit and cogstart, if my search tool is working.
All those words to do with controlling cogs from within propforth are implemented in propforth, near as I can tell.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
This who understand binary, and those who don't
If everybody used coginit, chaos and conflict would reign. cognew prevents that.
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 6/1/2010 8:38:19 PM GMT
I'm a little hazy to how chaos and confusion reigns as a result of coginit. Do you mean a well written SPIN program should be cog-agnostic?
If this is in the context of running forth as an object under spin, or running spin object under forth, I don't think that is supported in this version.
So far, I've only seen it as "forth only" once propforth is running.
I remember a discussion about an 8 bit token threaded forth built on the spin ROM intended to run under spin and/or call spin object from forth. That would be a later version or even a separate project. Please see update 5 or so posts below
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
Post Edited (prof_braino) : 6/6/2010 8:36:00 PM GMT
I'm going to install PropForth, but I'm confused.
On "Getting Started",
Download PropForth.spin
Load into eeprom
Start up TeraTerm
On "VerifyPropforth ",
Upload spinmakerPart1.f to the prop
Upload spinmakerPart2.f to the prop
spinmaker 'rebuilding the entire forth dictionary
copy the output from ForthDictStart to ForthMemoryEnd of spinmaker
output of spinmaker into PropForth-template.spin.
But on "RebuildingPropForth"
Upload PropForthPart1.f and PropForthPart2.f to prop.
load spinmaker
spinmaker
no upload PropForthPart1.f and PropForthPart2.f on "Getting Started",
upload spinmakerPart1.f and spinmakerPart2.f on "VerifyPropforth".
Which is correct way to install?
On the page
http://code.google.com/p/propforth/wiki/PropForth
links have been reviewed for the pages
PropForthStatus
GettingStarted
VerifyPropforth
DownloadSourceText
DownloadPropforthSource
Those pages should be clear, correct and accurate for the current version (let me know where they are not and I will fix them)
The remaining links on the page have not been reviewed and may or may not have useful information:
The following pages are under review:
* SavingPropForth
* RebuildingPropForth
* AddingSerialMonitor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
This who understand binary, and those who don't
Post Edited (prof_braino) : 6/4/2010 8:17:32 PM GMT
The word spinmaker generates the forth definitions that go at the end of the propforth.spin file.
It makes the forth definitions from the forth image that is currently running on the prop. This is what is happening in the VerifyPropForth page.
Here's what was different in the old version:
In the last version of the instructions, the author was trying to demonstrate how one would go about redefining the entire forth image in high level forth (rather than assembler, which the prototypes had been up to that point). This is what was being demonstrated in the RebuildingPropForth page. He just didn't say so. I didn't get it either. that's why we started rewriting the documentation. BUT you can still do it the RebuildingForth way. Anybody that can write a valid forth system can define a forth for the prop IN FORTH, load those definitions into propforth, use spinmaker to make spin code, and generate a eeprom-able image by putting that spin code into the spin code template and loading to the prop using Propeller Tool. We walked through it, and it worked, but figured out that this method is too confusing, so we made the VerifyPropForth page. But both are correct. The thing is, after RebuildingPropForth was done once successfully, there was no longer a need for switch from the assembler to forth, because the starting image is now in forth.
Propforthpart1.f and propforthpart2.f are the original forth definintions that were compiled by the minimal prototype forth kernel to produce the image that became propforth 2.7. After those definitions were compiled into the dictionary, the word "saveforth" was run to save the image into eeprom. Next, the device was rebooted and the definitions for spinmaker were loaded (compiled into the dictionary). The spinmaker word was executed to product a big chunk of text, which was captured from the terminal program screen, and copy and psted into propforth-template.spin, and this resulting file was saved as propforth.spin.
Now, if propforth.spin (downloaded from googlecode) is loaded into a propeller, and spinmaker is loaded and executed, it will produce the exact source text as found in the assembler section of propforth.spin between the ForthDictStart and the ForthMemoryEnd text. Also, these definitions are identical to the definitions in PropForthpart1.f and propforthpart2.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
Post Edited (prof_braino) : 6/6/2010 8:38:02 PM GMT
"Cognostic" - One of a sect of propeller followers who lived near the gushing oil sea in pre-turboprop antiquity in whose writings we find the belief that it is not possible for the creator (of instructions) to produce a perfect system with an affinity to any given cog and such systems tend toward chaos for users more than cogs selected from a pool (just one definition).
Forgive me .... I hope all Forth users find great happiness with PropForth.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
Turns out I was mistaken in my previous post, I spoke with the author and have the following corrections:
There is no technical reason why the cogstart command cannot be used rather than the coginit command. For the purpose of propforth 2.7 the author wanted to control exactly which specific cog was performing each specific function, but this need not always be the case.
There is no technical reason why spin cannot call forth, and forth run as any other spin object. The author is defining the method to communicate with forth from spin. These will be posted and documented shortly.
There is no technical reason why forth cannot call spin routines. The author designed propforth to suit his specific need, which could not easily be addressed in spin due to size and timing constraints (or something else). In situations where these constraints are not an issue, it would not cause problems for forth to pass parameters to a spin object, run the spin object and get the results. The author is defining words for this purpose, and they will also be posted and documented shortly.
Propforth 2.8 (or so) should support calling forth from spin, and calling spin from forth. A new thread will be posted when this happens.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
I have question.
16 + 16 = 2C
32 + 32 = 64
Display for result is decimal or hex?
Is this bug?
Or another reason?
caskaz
The first is only true for hex, the latter is true for both decimal and hex. Provided the base isn't changed behind the scenes and/or without user interaction you end up with hex as the common denominator.
Not sure if it's implemented (it should) but try
and see what it says.
I check word.
: hex 10 mcwBase w! ;
: decimal A mcwBase w! ;
I seem to be word"decimal" operate like to be "hex".
Operation of word"hex" is strange.
In the second example you switch to hex so the st? output matches your input more closely. HTH
Sorry, it's my misunderstanding.
mcwBase
are an artifact of design considerations of the previous propject, spinforth. In that project, the author intended to have each forth running an independent dictionary in each cog. The naming convention selected for that purpose is more or less decribed in the comments at the beginning of
Propforth.spin
The experience form the spinforth project indicated that a more efficeint method would be to have a common dictionary, and any special words that need to be optimized or reduced in size be implemented in assembler (which is how this is usually done in forth) and these optimized assembler definitions could then reside only in the cogs where they are needed. This simplifies the overall structure of the new version propforth, and still allows special words in each cog as needed.
The next version of propforth (3.0 possibly) is to have different names such that it will be closer to a standard forth, where "mcwBase" will be renamed BASE, cog memory access will be @ and ! as these are long only; HUB memory access will be something like C@ C! W@ W! L@ L! for byte, word and long access, and only prop-specific words to support standard words will be in lowercase.
At this time, this work is not complete. In addition to the items described, there are other issues due to the unique nature of the prop that need to be worked through.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
Post Edited (prof_braino) : 6/13/2010 1:57:41 PM GMT
This forth defaults in hex, and the code expects the base to be set to hex at this point.
One of the planned changes for version 3.0(?) is to implement more standard words like
.S etc
If you are interesting in helping with the work on the "standard forth" version of PropForth, please send me a message.
Your inputs would be appreciated.
Tasukarimasu Arigato
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
I checked about mcwBase.
But same as hex and decimal.
What's wrong about my idea?
Post Edited (kuroneko) : 6/15/2010 6:37:01 AM GMT
I see reading your explanation.
Your word works.
I checked below;
I try to blink LED.
But LED not blink.
After word "blink", Forth cogs 4 - 6. 1 cog used?
And I made blink.f to adding "FL". But loaded it, message was "UNDEFINED WORD".
What's wrong?
caskaz
Post Edited (caskaz) : 6/15/2010 11:47:17 AM GMT
Something like this might go in "developer extensions" if you have such a thing
"Period" character in the front of a word means "print ..."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
I try to make lcd-driver.
Although success to send cammnad for lcd, parameter not yet.
I tested below: (trying to write data[noparse][[/noparse]$77] to v-ram[noparse][[/noparse]42768bytes])
Why PropForth is reset?
And using cog increase from cog:5-6 to cog:4-6.
LCD is displyes initial v-ram's status(red/blue/green's dot).
I think command-sending is success because command(display on/off, display invert/normal) is good.
caskaz
Post Edited (caskaz) : 6/19/2010 7:04:12 AM GMT
As far as I can tell parameter consumes a single parameter from the stack. Given that you duplicate the 77 inside the loop you're probably running out of stack. Just get rid of the dup.
When a word executes and causes a stack underflow or overflow, and affects more than the first stack item, the cog is reset.
reset also actives the next cog as a forth cog. There are other conditions that cause resets, but not all are documented.
This looks like one of your words has an error.
The messages indicate the severity or result of the error. However, the MEANING of the messages is not yet documented.
But here's what I think it means:
The entire propeller might not have reset. Resting the entire propeller would not have displayed cogs 4-6, it would have displayed 5-6
So just the cog reset, but word that had an issue had some bad effect beyond that one cog, and recovery involved a bit more than resetting the single cog.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world,
Those who understand binary, and those who don't
Thanks kuroneko-san.
Thanks prof_braino.
In case of executing wrong code, finally massage is " Forth cogs: 0 - 6".
Actually proceeding cogs: 0 - 6?
Definition of ffcog is different. no : and ;.
I cannot understand word-ffcog.
ffcog call onself by ffcog?
Post Edited (caskaz) : 6/20/2010 5:20:45 AM GMT