eeprom   flash   ram   fl-   fl+   iflush   HERE   ALIGN   hi

ram ( ---)

Specific Flash Forth

Set address context to SRAM.

eeprom ( ---)

Specific Flash Forth

Set address context to EEPROM.

flash ( ---)

Specific Flash Forth

Set address context to Flash.

Flash memory space is reserved for FORTH definitions, constants and data which is not required to be written or modified by the programs applications.

Variables and data that need to be changed frequently must be defined in RAM memory.

fl- ( -- )

Specific Flash Forth

Disables writes to Flash memory, EEPROM.

The use of this word in a definition prevents accidental writing in FLASH memory, therefore, a possible crash of the FORTH dictionary.

A crash of the FORTH dictionary requires the complete reinstallation of the FORTH language.

Example of use:

\ main loop
: buttons.loop
    fl- \ Disable writes to flash and eeprom
    begin
       \ ... rest of definition 
    key? until
    fl+ \ Enable writes to flash and eeprom
  ;

fl+ ( -- )

Specific Flash Forth

Enable writes to Flash, EEPROM, default.

iflush ( -- )

Specific Flash Forth

Flush the flash write buffer.

HERE ( -- addr )

Leave the current data section dictionary pointer.

ALIGN ( -- )

Align the current data section dictionary pointer to cell boundary.

hi ( -- u )

Specific Flash Forth

Leave the high limit of the current data space.

\ MCU with eeprom
: .free
  cr ." Flash:" flash hi here - u. ." bytes"
  cr ." Eeprom:" eeprom hi here - u. ." bytes"
  cr ." Ram:" ram hi here - u. ." bytes"
;
 
\ MCU without eeprom
: .free
  decimal
  cr ." Flash:" flash hi here - u. ." bytes"
  cr ." Ram:" ram hi here - u. ." bytes"
;