After buffer_write, Forth don't recognizesome words(2+,+ * st?).
I operate step by step.
No problem buffer_make & buffer_display.
Forth don't recognize st? on third inside do - loop of buffer_write
Value for buffer & buffer+2 & buffer+4 are 0.
Where is mistake?
variable buffer
: buffer_make create buffer a allot drop ;
: buffer_display buffer a 0 do dup W@ . 2+ loop drop ;
: buffer_write buffer 2- a 0 do 2+ over over W! loop ;
buffer_make
buffer_display
0 0 3CF2 628B 6675 6566 5F72 616D 656B 271C Cog6 ok
0 buffer_write
buffer_display
0 0 0 0 0 0 0 0 0 0 Cog6 ok
st?
UNDEFINED WORD ???
reboot
UNDEFINED WORD ???
It's been a while but I don't think you should mix variable and create. Also, the space you add with allot is in bytes so if nothing else buffer_write will corrupt your dictionary/memory (10 words vs (4 + 10) bytes). You're better off creating your array like this:
variable buffer 10 allot
That's 4 bytes initial size + 16 extra bytes (10 hex -> 16 dec). buffer_display and buffer_write look OK but buffer_write should clean up the stack (drop drop).
put the code to execute and write it to the definition in the dictionary
<$code_address> w,
forthentry freedcit
finish the definition. This is like what the ';' normally does in a colon definition.
In your case, you just want an array, so use
variable <name> <bytes> allot
as kuroneko said. Also note that variable reserves 4 bytes for a long, and wvariable reserves 2 bytes for a word, so you need to be aware of how many bytes are already there when you 'allot' the additional bytes. kuroneko's example has a typo, it allocate 10 (hex) bytes which is 16 (decimal) for a total of 20 (decimal) bytes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I see that there is no entry for '*' in the dictionary, and see that
4 5 *
responds with UNDEFINED WORD.
So there is no signed multiply in the dictionary(!)
There IS however the entry for u* which is the unsigned multiply.
4 5 u* .
14
decimal
4 -5 u* .
-20
hex
behave as expected. I think the definition
: * u* ;
which just make * do u* will function correctly, but there might be something going on in the flags or carry bits that needs attention. pi'd actually pointed this out earlier in a PM, and I asked Sal about it, but he's not back from vacation yet. He should be back this weekend.
I figure Sal just wanted to to keep thinks clear in the code that everything was unsigned multiplies at that point, and it's just and oversight.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
prof_braino said...
kuroneko's example has a typo, it allocate 10 (hex) bytes which is 16 (decimal) for a total of 20 (decimal) bytes.
Well, caskaz is accessing 10 word entries in his array which boils down to 20 bytes in my book ... although I can see how the comment is slightly confusing. I'll adjust that.
Hi.
I have problem.
I'm going to make lcd_demo,now.
Now, I copy/paste word step by step to TeraTerm .
Usually no error, but sometimes error occure. (when I copied many word)
caskaz said...
Hi.
I have problem.
I'm going to make lcd_demo,now.
Now, I copy/paste word step by step to TeraTerm .
Usually no error, but sometimes error occure. (when I copied many word)
How can I send words to Prop without error?
The symptoms you describe are consistent with not including the 'fl' word at the being of the pasted text as described in the documentation. If you don't, pasting won't work for the reasons described.
Let me know where the documentation is not clear and I will attempt to correct it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/29/2010 11:14:31 PM GMT
Hi.
I deleted every comments and spaces character in front of words on LQ020B8UB02_demo.
I did copy/paste whole file(adding fl).
Successed without errors.
But after "LQ020"word, error occured "COG6 RESET - last status: MAIN Stack OVERFLOW".
I use prot board.
Anything idea?
I paste adding "fl"word at top of word.
But error always occure "UNDEFINED WORD when word are many.
Therefore I copy/past 10-line step by step.
Very inconvenient.
I use PSPad.
I copy word on PSPad's window and paste on TeraTerm's window.
I select "OK" on TeraTerm's ClipBoard confirmation.
Incorrect?
Yes, ok on teraterm's clipboard confirmation is the final step,
BUT
No, if you are getting 'undefined word' your are still not doing it correctly.
the fl word goes at the BEGINNING ALL TEXT PASTEs. The form indicated in the following code boxes is the required composition of a source text paste into the teraterm window:
fl / this must always be the begining of every paste
: MyWord / ( stack comment)
<...code...>
;
: anotherWord
MyWord <...more code...> ;
The blue led will flash as fl loads the code into eeprom, then the red led will flash after fl points the interpreter at the code in the eeprom buffer and text scrolls across the screen
Subsequent pastes ALSO must be in the same form:
fl / this must always be the begining of every paste
: MyWord-2 / ( stack comment)
<...code...> ;
: anotherWord-2 MyWord Myword-2 <...more code...> ;
If you still have problems, please PM me and I will set up a time to talk you through it using skype or something.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
No, if you are getting 'undefined word' your are still not doing it correctly.
the fl word goes at the BEGINNING ALL TEXT PASTEs. The form indicated in the following code boxes is the required composition of a source text paste into the teraterm window:
fl / this must always be the begining of every paste
: MyWord / ( stack comment)
<...code...>
;
: anotherWord
MyWord <...more code...> ;
I did not know about the FL command, until this part of the thread it wasn't very well documented. Now, in my ignorance I thought it was some kind of command for TeraTerm and ignored it.
I am using ZTerm, an ancient but still oh-so-useful program, under Mac OS X Snow Leopard. I was just taking large hunks of code and copy/paste sans the FL command, and having no problems. The only thing I can think of is that ZTerm's "pacing" parameters are in increments on 1/60th of a second so a 1 and 1 setting would be 17 ms per char and per line end. PropForth seems to be able to keep up with that.
No, if you are getting 'undefined word' your are still not doing it correctly.
the fl word goes at the BEGINNING ALL TEXT PASTEs. The form indicated in the following code boxes is the required composition of a source text paste into the teraterm window:
fl / this must always be the begining of every paste
: MyWord / ( stack comment) <...code...> ;
I did not know about the FL command, until this part of the thread it wasn't very well documented. Now, in my ignorance I thought it was some kind of command for TeraTerm and ignored it
Now I'm getting worried. I thought I put a section about pasting text and 'fl' on one of the getting started pages, and in the FAQ.
There was also an explanation about flow control and lag spike when a definition is committed to the dictionary, to explain why the garbled characters ocure and what Sal did to overcome all this.
Has nobody found these?
How can I organize the material better so this is more in the forefront?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
caskaz said...
Hi.
How does font-datas define for PropForth?
Right now the serial communication uses VT100 type ascii codes, that's why there is the 1b emit 5b emit etc in PropForthPart1.f to turn text lines red.
It uses whatever font your terminal program uses.
Propforth uses the internal font for VGA, at the moment. This may change in version 3.3+
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
NOTE
10 base w! / in hex, sets the base to 16 (decimal)
10 base w! / in decimal, sets the base to 16 (decimal)
That looks slightly off (probably suffers from copy/paste). If you're in decimal mode then the last word sequence does effectively nothing.
I posted this in the PropForth 2.7 thread a while back. It displays the current base in decimal. There is also a more verbose word somewhere in this thread.
Hi prof_braino.
I deleted every comments and spaces character in front of words on LQ020B8UB02_demo.
I did copy/paste whole file(adding fl).
After I paste on TearTerm, fl displayed on TearTerm while blue LED lit on prot board.
Then red LED lit.
Words are displayed on Tearterm.
fl
C77 chars
many word displayed
: LQ020
..
..
;
Cog6 ok
LQ020
COG6 RESET - last status: MAIN STACK OVERFLOW
Cog6 ok
It shoud load fine because it don't stop loading.
But not work.
I copy/paste LQ020B8UB02_demo with 10-lines step by step. This works fine.
WHY? I don't have idea.
About "How does font-datas define for PropForth?"
Sorry, My question was bad.
for example, PropBasic define font character by using DATA statement. (word for spin)
How does PropForth?
Comments
After buffer_write, Forth don't recognizesome words(2+,+ * st?).
I operate step by step.
No problem buffer_make & buffer_display.
Forth don't recognize st? on third inside do - loop of buffer_write
Value for buffer & buffer+2 & buffer+4 are 0.
Where is mistake?
That's 4 bytes initial size + 16 extra bytes (10 hex -> 16 dec). buffer_display and buffer_write look OK but buffer_write should clean up the stack (drop drop).
Post Edited (kuroneko) : 7/21/2010 1:29:47 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
create <name> <$code_address> w, forthentry freedcit
So after the
create <name>
put the code to execute and write it to the definition in the dictionary
<$code_address> w,
forthentry freedcit
finish the definition. This is like what the ';' normally does in a colon definition.
In your case, you just want an array, so use
variable <name> <bytes> allot
as kuroneko said. Also note that variable reserves 4 bytes for a long, and wvariable reserves 2 bytes for a word, so you need to be aware of how many bytes are already there when you 'allot' the additional bytes. kuroneko's example has a typo, it allocate 10 (hex) bytes which is 16 (decimal) for a total of 20 (decimal) bytes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
When I look in the dictionary with
I see that there is no entry for '*' in the dictionary, and see that
responds with UNDEFINED WORD.
So there is no signed multiply in the dictionary(!)
There IS however the entry for u* which is the unsigned multiply.
behave as expected. I think the definition
which just make * do u* will function correctly, but there might be something going on in the flags or carry bits that needs attention. pi'd actually pointed this out earlier in a PM, and I asked Sal about it, but he's not back from vacation yet. He should be back this weekend.
I figure Sal just wanted to to keep thinks clear in the code that everything was unsigned multiplies at that point, and it's just and oversight.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (kuroneko) : 7/21/2010 2:04:48 PM GMT
I have problem.
I'm going to make lcd_demo,now.
Now, I copy/paste word step by step to TeraTerm .
Usually no error, but sometimes error occure. (when I copied many word)
How can I send words to Prop without error?
The symptoms you describe are consistent with not including the 'fl' word at the being of the pasted text as described in the documentation. If you don't, pasting won't work for the reasons described.
Let me know where the documentation is not clear and I will attempt to correct it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Post Edited (prof_braino) : 7/29/2010 11:14:31 PM GMT
I paste adding "fl"word at top of word.
But error always occure "UNDEFINED WORD when word are many.
Therefore I copy/past 10-line step by step.
Very inconvenient.
I use PSPad.
I copy word on PSPad's window and paste on TeraTerm's window.
I select "OK" on TeraTerm's ClipBoard confirmation.
Incorrect?
Post Edited (caskaz) : 7/30/2010 2:07:23 AM GMT
I made lcd_demo.
Needing about 10 copy/paste to load on Prop.
How does font-datas define for PropForth?
I deleted every comments and spaces character in front of words on LQ020B8UB02_demo.
I did copy/paste whole file(adding fl).
Successed without errors.
But after "LQ020"word, error occured "COG6 RESET - last status: MAIN Stack OVERFLOW".
I use prot board.
Anything idea?
caskaz
Yes, ok on teraterm's clipboard confirmation is the final step,
BUT
No, if you are getting 'undefined word' your are still not doing it correctly.
the fl word goes at the BEGINNING ALL TEXT PASTEs. The form indicated in the following code boxes is the required composition of a source text paste into the teraterm window:
The blue led will flash as fl loads the code into eeprom, then the red led will flash after fl points the interpreter at the code in the eeprom buffer and text scrolls across the screen
Subsequent pastes ALSO must be in the same form:
If you still have problems, please PM me and I will set up a time to talk you through it using skype or something.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I did not know about the FL command, until this part of the thread it wasn't very well documented. Now, in my ignorance I thought it was some kind of command for TeraTerm and ignored it.
I am using ZTerm, an ancient but still oh-so-useful program, under Mac OS X Snow Leopard. I was just taking large hunks of code and copy/paste sans the FL command, and having no problems. The only thing I can think of is that ZTerm's "pacing" parameters are in increments on 1/60th of a second so a 1 and 1 setting would be 17 ms per char and per line end. PropForth seems to be able to keep up with that.
Does that make sense?
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
Now I'm getting worried. I thought I put a section about pasting text and 'fl' on one of the getting started pages, and in the FAQ.
There was also an explanation about flow control and lag spike when a definition is committed to the dictionary, to explain why the garbled characters ocure and what Sal did to overcome all this.
Has nobody found these?
How can I organize the material better so this is more in the forefront?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I update the FAQ correctly this time, now the explanation for the file load command should be there.
Also, I put another link to the page detailing what going on and why it was done this way.
Please give a look at http://code.google.com/p/propforth/wiki/PropForthFAQ
and let me know if I should change it further
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
Right now the serial communication uses VT100 type ascii codes, that's why there is the 1b emit 5b emit etc in PropForthPart1.f to turn text lines red.
It uses whatever font your terminal program uses.
Propforth uses the internal font for VGA, at the moment. This may change in version 3.3+
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people in the world: those who understand binary, and those who don't
I have been puzzling over this;
Is this a typo? If it isn't, please explain what I am suppose to learn from it.
I know that I can use the words hex and decimal to set the base, but is there a word that will cause what the current base value is to be displayed?
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
www.wulfden.org/TheShoppe/prop/ - Propeller Products
www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
I posted this in the PropForth 2.7 thread a while back. It displays the current base in decimal. There is also a more verbose word somewhere in this thread.
Given that a number of words have been renamed the above word should probably now read:
I deleted every comments and spaces character in front of words on LQ020B8UB02_demo.
I did copy/paste whole file(adding fl).
After I paste on TearTerm, fl displayed on TearTerm while blue LED lit on prot board.
Then red LED lit.
Words are displayed on Tearterm.
It shoud load fine because it don't stop loading.
But not work.
I copy/paste LQ020B8UB02_demo with 10-lines step by step. This works fine.
WHY? I don't have idea.
About "How does font-datas define for PropForth?"
Sorry, My question was bad.
for example, PropBasic define font character by using DATA statement. (word for spin)
How does PropForth?
Post Edited (caskaz) : 7/31/2010 12:39:32 AM GMT
My proto board has reset problem.(refer to http://forums.parallax.com/showthread.php?p=847290
When board is removeed from PC, problem occured.
Isn' t it relation?
I have question.
Code below not work.
Value for cnt L@ is akways 64FE0A03.
What wrong?
At least that's how it worked under 2.7
Propforth v3.2
But code below don't work.
It takes 53seconds to display next figure. Counter pass through..
What's wrong?
Post Edited (caskaz) : 7/31/2010 8:41:31 AM GMT
But same result.
It takes 53seconds to display next figure. Counter pass through..
I use default.
My misunderstanding.
minumum is clkfreq/40e(about 1msec)
PropForth is very slow?
Post Edited (caskaz) : 7/31/2010 3:37:20 PM GMT