aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-08-19 12:15:28 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-08-19 12:15:28 +0200
commit67d25d837ac55f28a366c0a3b262e439a6e75fc3 (patch)
treedf7715c7724c5935ab87c807f3b8b4ef529315e3 /amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt
parente0d6784e89dba33226c0edb815bb974486fa7c48 (diff)
Add AmForth
Diffstat (limited to 'amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt')
-rw-r--r--amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt23
1 files changed, 23 insertions, 0 deletions
diff --git a/amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt b/amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt
new file mode 100644
index 0000000..8d5756b
--- /dev/null
+++ b/amforth-6.5/avr8/lib/forth2012/core-ext/marker.frt
@@ -0,0 +1,23 @@
+\ Defines a word which resets the dictionary and removes itself
+\ when called.
+\ Better then forget but still has limitations.
+
+\ all information is in the first few EEPROM cells.
+\ (marker) is a value that holds the max eeprom address
+
+: marker
+ \ get information to remove the marker itself
+ get-current @e dp
+ \ create the wordlist entry
+ create
+ \ save all data
+ (marker) 0 do i @e , 2 +loop
+ \ save the marker-remove data
+ , ,
+ does>
+ \ restore data from saved state
+ (marker) 0 do dup @i i !e 1+ 2 +loop
+ \ purge the marker itself
+ dup @i to dp
+ 1+ @i get-current !e
+;