Random Access Memory

Free Ram ?

Ram starts at $2000000 and grows upwards to the physical limit. My STM32F051 has 8KB Ram therefore the maximum is at $20002000

Mecrisp will use a certain amount ($38C or 908 decimal bytes in this example).

Find The Start of Free Ram

compiletoram here hex. 2000038C  ok.

Create The Word “freeram”

: freeram ( -- )
  flashvar-here 4 -
  compiletoram here
  - . ." Bytes "
;

“freeram” Word Dictionary Entry

Address: 2000038C Link: 000000C0 Flags: 00000000 Code: 2000039A Name: freeram

Note

Tick(‘) also shows markers memory location

' freeram hex. 2000039A  ok.

Free Ram Start (after “freeram” has been created)

compiletoram here hex. 200003D0  ok.

Find The End of Free Ram

flashvar-here 4 -

A Word to Find Free Ram

“freeram” already created above

: freeram ( -- )
  flashvar-here 4 -
  compiletoram here
  - . ." Bytes "
;
freeram

freeram 7028 Bytes  ok.