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
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to