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:
6c050b5
)
Fix last EXIT in SEE
author
rich
<rich>
Fri, 28 Sep 2007 19:39:21 +0000
(19:39 +0000)
committer
rich
<rich>
Fri, 28 Sep 2007 19:39:21 +0000
(19:39 +0000)
jonesforth.S
patch
|
blob
|
history
jonesforth.f
patch
|
blob
|
history
diff --git
a/jonesforth.S
b/jonesforth.S
index be0420a4f2a080973b506f40b4d42eeb9ca012db..b7990e8cb9d0c8e12943320503f846bf8f226ad1 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.3
7 2007-09-28 18:55:10
rich Exp $
+ $Id: jonesforth.S,v 1.3
8 2007-09-28 19:39:21
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,3
7
+ .set JONES_VERSION,3
8
/*
INTRODUCTION ----------------------------------------------------------------------
/*
INTRODUCTION ----------------------------------------------------------------------
diff --git
a/jonesforth.f
b/jonesforth.f
index 3a7612e2c6ab2b67da00f66d9d21182ba5d14d53..b2cf98ac55483c03709a21bb11f16ae231f13745 100644
(file)
--- a/
jonesforth.f
+++ b/
jonesforth.f
@@
-2,7
+2,7
@@
\ 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.f,v 1.
7 2007-09-28 18:55:10
rich Exp $
+\ $Id: jonesforth.f,v 1.
8 2007-09-28 19:39:21
rich Exp $
\
\ The first part of this tutorial is in jonesforth.S. Get if from http://annexia.org/forth
\
\
\ The first part of this tutorial is in jonesforth.S. Get if from http://annexia.org/forth
\
@@
-1013,7
+1013,6
@@
>DFA ( get the data address, ie. points after DOCOL | end-of-word start-of-data )
( now we start decompiling until we hit the end of the word )
>DFA ( get the data address, ie. points after DOCOL | end-of-word start-of-data )
( now we start decompiling until we hit the end of the word )
- ( XXX we should ignore the final codeword if it is EXIT )
BEGIN ( end start )
2DUP >
WHILE
BEGIN ( end start )
2DUP >
WHILE
@@
-1051,6
+1050,16
@@
CFA> ( and force it to be printed as a dictionary entry )
ID. SPACE
ENDOF
CFA> ( and force it to be printed as a dictionary entry )
ID. SPACE
ENDOF
+ ' EXIT OF ( is it EXIT? )
+ ( We expect the last word to be EXIT, and if it is then we don't print it
+ because EXIT is normally implied by ;. EXIT can also appear in the middle
+ of words, and then it needs to be printed. )
+ 2DUP ( end start end start )
+ 4 + ( end start end start+4 )
+ <> IF ( end start | we're not at the end )
+ ." EXIT "
+ THEN
+ ENDOF
( default case: )
DUP ( in the default case we always need to DUP before using )
CFA> ( look up the codeword to get the dictionary entry )
( default case: )
DUP ( in the default case we always need to DUP before using )
CFA> ( look up the codeword to get the dictionary entry )