From: Jan K. <jan...@ic...> - 2018-12-06 18:46:44
|
Hello, I have make a buffer, after loading the program I aspect that all locations will be zero. When take a look there are some places with values! **** /Users/jankromhout/Documents/amforth-6.7/tools (ATmega328P)> clearBuffer ok (ATmega328P)> .Buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12288 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 After clearing the locations there will be values on some locations. What do I wrong? Cheers, Jan marker --SSD1306-- \ size of display for memory buffer 128 constant SSD1306_LCDWIDTH 64 constant SSD1306_LCDHEIGHT SSD1306_LCDHEIGHT SSD1306_LCDWIDTH * 8 / constant BUFFERSIZE BUFFERSIZE 2 * buffer: buffer : buffer! buffer + ! ; : buffer@ buffer + @ ; \ display buffer inhoud : .Buffer [ 1024 15 - ] literal 0 do 16 0 do j i + buffer@ . loop cr 16 +loop ; : clearBuffer 1024 0 do 0 i buffer! loop ; |
From: Martin B. <mar...@t-...> - 2018-12-06 19:03:41
|
Daag Jan, see below ... Hope it helps! Regards Martin BTW You'r marching through 1009 * 16 words in memory - is that what you want? Am Donnerstag, 6. Dezember 2018, 19:46:33 CET schrieb Jan Kromhout via Amforth-devel: > Hello, > > I have make a buffer, after loading the program I aspect that all locations > will be zero. When take a look there are some places with values! > > **** /Users/jankromhout/Documents/amforth-6.7/tools > (ATmega328P)> clearBuffer > ok > (ATmega328P)> .Buffer > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 12288 56 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > After clearing the locations there will be values on some locations. > > What do I wrong? > > Cheers, > > Jan > > > > marker --SSD1306-- > > > \ size of display for memory buffer > 128 constant SSD1306_LCDWIDTH > 64 constant SSD1306_LCDHEIGHT > > SSD1306_LCDHEIGHT SSD1306_LCDWIDTH * 8 / constant BUFFERSIZE > > BUFFERSIZE 2 * buffer: buffer > > : buffer! > > buffer + ! > ; > > : buffer@ > > buffer + @ > ; > > \ display buffer inhoud > > : .Buffer > > [ 1024 15 - ] literal 0 do [ buffersize 2 * 16 / ] literal 0 do > 16 0 do > j i + buffer@ . J 16 * i + buffer@ > loop > cr > 16 +loop > ; > > : clearBuffer > > 1024 0 do > 0 i buffer! > loop > ; > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel -- Getippt im 9-Fingersystem von mir selbst. |
From: Jan K. <jan...@ic...> - 2018-12-06 19:06:58
|
Thanks Martin, What I wont is a buffer of 1024 bytes. Is that posible in amForth? Cheers, Jan > Op 6 dec. 2018, om 20:03 heeft Martin Bitter <mar...@t-...> het volgende geschreven: > > Daag Jan, > > see below ... > > Hope it helps! > > Regards Martin > > BTW You'r marching through 1009 * 16 words in memory - is that what you > want? > > Am Donnerstag, 6. Dezember 2018, 19:46:33 CET schrieb Jan Kromhout via > Amforth-devel: >> Hello, >> >> I have make a buffer, after loading the program I aspect that all > locations >> will be zero. When take a look there are some places with values! >> >> **** /Users/jankromhout/Documents/amforth-6.7/tools >> (ATmega328P)> clearBuffer >> ok >> (ATmega328P)> .Buffer >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 12288 56 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> >> After clearing the locations there will be values on some locations. >> >> What do I wrong? >> >> Cheers, >> >> Jan >> >> >> >> marker --SSD1306-- >> >> >> \ size of display for memory buffer >> 128 constant SSD1306_LCDWIDTH >> 64 constant SSD1306_LCDHEIGHT >> >> SSD1306_LCDHEIGHT SSD1306_LCDWIDTH * 8 / constant BUFFERSIZE >> >> BUFFERSIZE 2 * buffer: buffer >> >> : buffer! >> >> buffer + ! >> ; >> >> : buffer@ >> >> buffer + @ >> ; >> >> \ display buffer inhoud >> >> : .Buffer >> >> [ 1024 15 - ] literal 0 do > [ buffersize 2 * 16 / ] literal 0 do >> 16 0 do >> j i + buffer@ . > J 16 * i + buffer@ > >> loop >> cr >> 16 +loop >> ; >> >> : clearBuffer >> >> 1024 0 do >> 0 i buffer! >> loop >> ; >> _______________________________________________ >> Amforth-devel mailing list for http://amforth.sf.net/ <http://amforth.sf.net/> >> Amf...@li... <mailto:Amf...@li...> >> https://lists.sourceforge.net/lists/listinfo/amforth-devel <https://lists.sourceforge.net/lists/listinfo/amforth-devel> > > > -- > Getippt im 9-Fingersystem von mir selbst. > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ <http://amforth.sf.net/> > Amf...@li... <mailto:Amf...@li...> > https://lists.sourceforge.net/lists/listinfo/amforth-devel <https://lists.sourceforge.net/lists/listinfo/amforth-devel> |
From: Jan K. <kro...@ho...> - 2018-12-06 19:18:43
|
Martin, When I look to this [ buffersize 2 * 16 / ] literal 0 do than I get a very low value. Is it correct what you have written? Cheers, Jan Op 6 dec. 2018, om 20:03 heeft Martin Bitter <mar...@t-...<mailto:mar...@t-...>> het volgende geschreven: [ buffersize 2 * 16 / ] literal 0 do |
From: Martin B. <mar...@t-...> - 2018-12-06 19:36:00
|
Jan, the result of ( buffersize 2 * 16 /] literal gives a low value. This value ist the counter for a outer loop. In the inner loop there are 16 accesses to the buffer. Met vriendelijke groet Martin Am Donnerstag, 6. Dezember 2018, 19:18:34 CET schrieb Jan Kromhout: > Martin, > > When I look to this > > [ buffersize 2 * 16 / ] literal 0 do > > than I get a very low value. Is it correct what you have written? > > Cheers, > > Jan > > > > Op 6 dec. 2018, om 20:03 heeft Martin Bitter > <mar...@t-...<mailto:mar...@t-...>> het volgende > geschreven: > > [ buffersize 2 * 16 / ] literal 0 do > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel -- Getippt im 9-Fingersystem von mir selbst. |
From: Martin B. <mar...@t-...> - 2018-12-06 19:20:39
|
Am Donnerstag, 6. Dezember 2018, 20:06:45 CET schrieb Jan Kromhout via Amforth-devel: Maybe this helps: Variable buffer 1024 allot This gives a buffer in RAM Or do you need it in FLASH? tot ziens Martin > Thanks Martin, > > What I wont is a buffer of 1024 bytes. > > Is that posible in amForth? > > Cheers, > > Jan > > > Op 6 dec. 2018, om 20:03 heeft Martin Bitter <martin.bitter@t- online.de> > > het volgende geschreven: > > > > Daag Jan, > > > > see below ... > > > > Hope it helps! > > > > Regards Martin > > > > BTW You'r marching through 1009 * 16 words in memory - is that what you > > want? > > > > Am Donnerstag, 6. Dezember 2018, 19:46:33 CET schrieb Jan Kromhout via > > > > Amforth-devel: > >> Hello, > >> > >> I have make a buffer, after loading the program I aspect that all > > > > locations > > > >> will be zero. When take a look there are some places with values! > >> > >> **** /Users/jankromhout/Documents/amforth-6.7/tools > >> (ATmega328P)> clearBuffer > >> ok > >> (ATmega328P)> .Buffer > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 12288 56 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >> > >> After clearing the locations there will be values on some locations. > >> > >> What do I wrong? > >> > >> Cheers, > >> > >> Jan > >> > >> > >> > >> marker --SSD1306-- > >> > >> > >> \ size of display for memory buffer > >> 128 constant SSD1306_LCDWIDTH > >> 64 constant SSD1306_LCDHEIGHT > >> > >> SSD1306_LCDHEIGHT SSD1306_LCDWIDTH * 8 / constant BUFFERSIZE > >> > >> BUFFERSIZE 2 * buffer: buffer > >> > >> : buffer! > >> > >> buffer + ! > >> ; > >> > >> : buffer@ > >> > >> buffer + @ > >> ; > >> > >> \ display buffer inhoud > >> > >> : .Buffer > >> > >> [ 1024 15 - ] literal 0 do > > > > [ buffersize 2 * 16 / ] literal 0 do > > > >> 16 0 do > >> j i + buffer@ . > > > > J 16 * i + buffer@ > > > >> loop > >> cr > >> 16 +loop > >> ; > >> > >> : clearBuffer > >> > >> 1024 0 do > >> > >> 0 i buffer! > >> > >> loop > >> > >> ; > >> _______________________________________________ > >> Amforth-devel mailing list for http://amforth.sf.net/ > >> <http://amforth.sf.net/> Amf...@li... > >> <mailto:Amf...@li...> > >> https://lists.sourceforge.net/lists/listinfo/amforth-devel > >> <https://lists.sourceforge.net/lists/listinfo/amforth-devel> > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel -- Getippt im 9-Fingersystem von mir selbst. |
From: Jan K. <jan...@ic...> - 2018-12-06 19:24:25
|
Dank je wel Martin, Some questions. How to do this when I wont to place it in FLASH. How to write and acces RAM? How to write and acces in FLASH? Met vriendelijke groet, Jan > Op 6 dec. 2018, om 20:20 heeft Martin Bitter <mar...@t-...> het volgende geschreven: > > Am Donnerstag, 6. Dezember 2018, 20:06:45 CET schrieb Jan Kromhout via > Amforth-devel: > > Maybe this helps: > > Variable buffer 1024 allot > > This gives a buffer in RAM > > Or do you need it in FLASH? > > tot ziens > > Martin > > > >> Thanks Martin, >> >> What I wont is a buffer of 1024 bytes. >> >> Is that posible in amForth? >> >> Cheers, >> >> Jan >> >>> Op 6 dec. 2018, om 20:03 heeft Martin Bitter <martin.bitter@t- > online.de> >>> het volgende geschreven: >>> >>> Daag Jan, >>> >>> see below ... >>> >>> Hope it helps! >>> >>> Regards Martin >>> >>> BTW You'r marching through 1009 * 16 words in memory - is that what > you >>> want? >>> >>> Am Donnerstag, 6. Dezember 2018, 19:46:33 CET schrieb Jan > Kromhout via >>> >>> Amforth-devel: >>>> Hello, >>>> >>>> I have make a buffer, after loading the program I aspect that all >>> >>> locations >>> >>>> will be zero. When take a look there are some places with values! >>>> >>>> **** /Users/jankromhout/Documents/amforth-6.7/tools >>>> (ATmega328P)> clearBuffer >>>> ok >>>> (ATmega328P)> .Buffer >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 12288 56 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >>>> >>>> After clearing the locations there will be values on some locations. >>>> >>>> What do I wrong? >>>> >>>> Cheers, >>>> >>>> Jan >>>> >>>> >>>> >>>> marker --SSD1306-- >>>> >>>> >>>> \ size of display for memory buffer >>>> 128 constant SSD1306_LCDWIDTH >>>> 64 constant SSD1306_LCDHEIGHT >>>> >>>> SSD1306_LCDHEIGHT SSD1306_LCDWIDTH * 8 / constant BUFFERSIZE >>>> >>>> BUFFERSIZE 2 * buffer: buffer >>>> >>>> : buffer! >>>> >>>> buffer + ! >>>> ; >>>> >>>> : buffer@ >>>> >>>> buffer + @ >>>> ; >>>> >>>> \ display buffer inhoud >>>> >>>> : .Buffer >>>> >>>> [ 1024 15 - ] literal 0 do >>> >>> [ buffersize 2 * 16 / ] literal 0 do >>> >>>> 16 0 do >>>> j i + buffer@ . >>> >>> J 16 * i + buffer@ >>> >>>> loop >>>> cr >>>> 16 +loop >>>> ; >>>> >>>> : clearBuffer >>>> >>>> 1024 0 do >>>> >>>> 0 i buffer! >>>> >>>> loop >>>> >>>> ; >>>> _______________________________________________ >>>> Amforth-devel mailing list for http://amforth.sf.net/ >>>> <http://amforth.sf.net/> Amf...@li... >>>> <mailto:Amf...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/amforth-devel >>>> <https://lists.sourceforge.net/lists/listinfo/amforth-devel> >> _______________________________________________ >> Amforth-devel mailing list for http://amforth.sf.net/ >> Amf...@li... >> https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > -- > Getippt im 9-Fingersystem von mir selbst. > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Martin B. <mar...@t-...> - 2018-12-06 19:56:40
|
Jan, don't know if this the right way - but my solution was like this: (It's extractet from more sophisticated working code. Hope I don't produce errors this way. Let me know if it works. Cave at! Memory allocatet this way will not bee freed bye markers or resets. In worst case you have to reflash your arduino.) : fl.erase ( addr n -- ) 0 ?do $ffff over i + !i loop drop ; : fl.allot ( length -- ) dp + to dp ; : fl.buffer: ( n -- ) ( -- addr ) <builds dp over fl.allot swap fl.erase does> @ ; examlple 1024 fl.buffer: festspeicher groeten Martin Am Donnerstag, 6. Dezember 2018, 20:24:13 CET schrieben Sie: > Dank je wel Martin, > > Some questions. > > How to do this when I wont to place it in FLASH. > > How to write and acces RAM? > > How to write and acces in FLASH? > > Met vriendelijke groet, > > Jan > > > Op 6 dec. 2018, om 20:20 heeft Martin Bitter <martin.bitter@t- online.de> > > het volgende geschreven: > > > > Am Donnerstag, 6. Dezember 2018, 20:06:45 CET schrieb Jan Kromhout via > > Amforth-devel: > > > > Maybe this helps: > > > > Variable buffer 1024 allot > > > > This gives a buffer in RAM > > > > Or do you need it in FLASH? > > > > tot ziens > > > > Martin > > > >> Thanks Martin, > >> > >> What I wont is a buffer of 1024 bytes. > >> > >> Is that posible in amForth? > >> > >> Cheers, > >> > >> Jan > >> > >>> Op 6 dec. 2018, om 20:03 heeft Martin Bitter <martin.bitter@t- > > > > online.de> > > > >>> het volgende geschreven: > >>> > >>> Daag Jan, > >>> > >>> see below ... > >>> > >>> Hope it helps! > >>> > >>> Regards Martin > >>> > >>> BTW You'r marching through 1009 * 16 words in memory - is that what > > > > you > > > >>> want? > >>> > >>> Am Donnerstag, 6. Dezember 2018, 19:46:33 CET schrieb Jan > > > > Kromhout via > > > >>> Amforth-devel: > >>>> Hello, > >>>> > >>>> I have make a buffer, after loading the program I aspect that all > >>> > >>> locations > >>> > >>>> will be zero. When take a look there are some places with values! > >>>> > >>>> **** /Users/jankromhout/Documents/amforth-6.7/tools > >>>> (ATmega328P)> clearBuffer > >>>> ok > >>>> (ATmega328P)> .Buffer > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 12288 56 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > >>>> > >>>> After clearing the locations there will be values on some locations. > >>>> > >>>> What do I wrong? > >>>> > >>>> Cheers, > >>>> > >>>> Jan > >>>> > >>>> > >>>> > >>>> marker --SSD1306-- > >>>> > >>>> > >>>> \ size of display for memory buffer > >>>> 128 constant SSD1306_LCDWIDTH > >>>> 64 constant SSD1306_LCDHEIGHT |
From: Jan K. <jan...@ic...> - 2018-12-06 20:13:39
|
Martin, Thanks. When I construct this and make a buffer of 1024 and after the buffer I create a dummy so I can calculate the difference. ‘ dummy - ‘ buffer = 1029. Thats means there is a space of 1024 bytes or words available. How can I store/read a byte or word to the location? This I have tried, (ATmega328P)> $ff festspeicher 100 + c! Timed out waiting for ok response Groeten Jan > Op 6 dec. 2018, om 20:56 heeft Martin Bitter <mar...@t-...> het volgende geschreven: > > 1024 fl.buffer: festspeicher |
From: Martin B. <mar...@t-...> - 2018-12-06 20:22:32
|
Store and fetch in flash is !i and @i Groeten Martin Am Donnerstag, 6. Dezember 2018, 21:13:28 CET schrieb Jan Kromhout via Amforth-devel: > Martin, > > Thanks. > When I construct this and make a buffer of 1024 and after the buffer I > create a dummy so I can calculate the difference. ‘ dummy - ‘ buffer = > 1029. Thats means there is a space of 1024 bytes or words available. > > How can I store/read a byte or word to the location? > > This I have tried, > > (ATmega328P)> $ff festspeicher 100 + c! > Timed out waiting for ok response > > > Groeten > > Jan > > > Op 6 dec. 2018, om 20:56 heeft Martin Bitter <martin.bitter@t- online.de> > > het volgende geschreven: > > > > 1024 fl.buffer: festspeicher > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel -- Getippt im 9-Fingersystem von mir selbst. |
From: Jan K. <kro...@ho...> - 2018-12-06 20:26:18
|
Last question for this evening. When I make a variable : variable buffer 1024 allot => is this in flash? Thanks for the great help this evening. Met een vriendelijke groet, Jan > Op 6 dec. 2018, om 20:18 heeft Jan Kromhout <kro...@ho...> het volgende geschreven: > > Martin, > > When I look to this > > [ buffersize 2 * 16 / ] literal 0 do > > than I get a very low value. Is it correct what you have written? > > Cheers, > > Jan > > > > Op 6 dec. 2018, om 20:03 heeft Martin Bitter <mar...@t-...<mailto:mar...@t-...>> het volgende geschreven: > > [ buffersize 2 * 16 / ] literal 0 do > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Matthias T. <mt...@we...> - 2018-12-08 11:47:42
|
Am Donnerstag, den 06.12.2018, 20:26 +0000 schrieb Jan Kromhout: > Last question for this evening. > When I make a variable : variable buffer 1024 allot => is this in > flash? your code does the following first it defines a word called variable (bad choice, since variable is already in use, nevertheless possible). Unless you have a word buffer already defined, the definition will fail with exception -13. If there is a word buffer defined, the definition will compile and when calling the new variable word it will call you buffer word and allocates 1024 bytes of RAM. Since you do not keep the address of this area (HERE is your friend), the memory is essentially blocked but cannot be accessed. what you probably intended to do is 1024 buffer: foo It allocates 1024 bytes of RAM and creates a word foo which when called leaves the start address of the RAM region. Using buffer: inside a colon definitions is possible, but advanced dark art ;) HTH Matthias |