From 9b874d69d45a0946840b5bb984e1e41d5307be1a Mon Sep 17 00:00:00 2001 From: rich Date: Sun, 23 Sep 2007 20:06:00 +0000 Subject: [PATCH] ID. and WORDS --- jonesforth.S | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jonesforth.S b/jonesforth.S index ac866ee..c41cbed 100644 --- 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 http://annexia.org/forth This is PUBLIC DOMAIN (see public domain release statement below). - $Id: jonesforth.S,v 1.23 2007-09-23 20:00:58 rich Exp $ + $Id: jonesforth.S,v 1.24 2007-09-23 20:06:00 rich Exp $ gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o jonesforth jonesforth.S */ - .set JONES_VERSION,23 + .set JONES_VERSION,24 /* 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. ) -\\: 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 ) -- 2.39.2