/* 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.17 2007-09-08 22:10:43 rich Exp $
+ $Id: jonesforth.S,v 1.18 2007-09-08 22:23:16 rich Exp $
gcc -m32 -nostdlib -static -Wl,-Ttext,0 -o jonesforth jonesforth.S
-
+*/
+ .set JONES_VERSION,18
+/*
INTRODUCTION ----------------------------------------------------------------------
FORTH is one of those alien languages which most working programmers regard in the same
_Z
S0 Stores the address of the top of the parameter stack.
R0 Stores the address of the top of the return stack.
+ VERSION Is the current version of this FORTH.
*/
defvar "STATE",5,,STATE
defvar "_Z",2,,TZ
defvar "S0",2,,SZ
defvar "R0",2,,RZ,return_stack
+ defvar "VERSION",7,,VERSION,JONES_VERSION
/*
RETURN STACK ----------------------------------------------------------------------
CHAR puts the ASCII code of the first character of the following word on the stack. For example
CHAR A puts 65 on the stack.
- SYSEXIT pops the status off the stack and exits the process (using Linux exit syscall).
+ SYSEXIT exits the process using Linux exit syscall.
*/
defcode "CHAR",4,,CHAR
\\ ALLOT is used to allocate (static) memory when compiling. It increases HERE by
\\ the amount given on the stack.
-: ALLOT HERE +! ;
+\\: ALLOT HERE +! ;
\\ Finally print the welcome prompt.
+.\" JONESFORTH VERSION \" VERSION @ . CR
.\" OK \"
"