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



_______________________________________________
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