projects
/
rrq
/
jonesforth.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e52b1a0
)
ID. and WORDS
author
rich
<rich>
Sun, 23 Sep 2007 20:06:00 +0000
(20:06 +0000)
committer
rich
<rich>
Sun, 23 Sep 2007 20:06:00 +0000
(20:06 +0000)
jonesforth.S
patch
|
blob
|
history
diff --git
a/jonesforth.S
b/jonesforth.S
index ac866ee0854955e2b2a7b1f3a4448604e5b4bbb1..c41cbed029bb72676d7fd5b6a26fb29701138cd0 100644
(file)
--- a/
jonesforth.S
+++ b/
jonesforth.S
@@
-1,11
+1,11
@@
/* A sometimes minimal FORTH compiler and tutorial for Linux / i386 systems. -*- asm -*-
By Richard W.M. Jones <rich@annexia.org> http://annexia.org/forth
This is PUBLIC DOMAIN (see public domain release statement below).
/* A sometimes minimal FORTH compiler and tutorial for Linux / i386 systems. -*- asm -*-
By Richard W.M. Jones <rich@annexia.org> http://annexia.org/forth
This is PUBLIC DOMAIN (see public domain release statement below).
- $Id: jonesforth.S,v 1.2
3 2007-09-23 20:00:58
rich Exp $
+ $Id: jonesforth.S,v 1.2
4 2007-09-23 20:06:00
rich Exp $
gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o jonesforth jonesforth.S
*/
gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o jonesforth jonesforth.S
*/
- .set JONES_VERSION,2
3
+ .set JONES_VERSION,2
4
/*
INTRODUCTION ----------------------------------------------------------------------
/*
INTRODUCTION ----------------------------------------------------------------------
@@
-2572,11
+2572,13
@@
buffer:
XXX: Because we wrote VARIABLE to store the variable in memory allocated before the word,
in the current implementation VARIABLE FOO FORGET FOO will leak 1 cell of memory.
)
XXX: Because we wrote VARIABLE to store the variable in memory allocated before the word,
in the current implementation VARIABLE FOO FORGET FOO will leak 1 cell of memory.
)
-\\: FORGET
-
-
+: FORGET
+ WORD FIND ( find the word, gets the dictionary entry address )
+ DUP @ LATEST ! ( set LATEST to point to the previous word )
+ HERE ! ( and store HERE with the dictionary address )
+;
-( While compiling,
[COMPILE] WORD compiles WORD
if it would otherwise be IMMEDIATE. )
+( While compiling,
'[COMPILE] word' compiles 'word'
if it would otherwise be IMMEDIATE. )
: [COMPILE] IMMEDIATE
WORD ( get the next word )
FIND ( find it in the dictionary )
: [COMPILE] IMMEDIATE
WORD ( get the next word )
FIND ( find it in the dictionary )