Annotation of gforth/model, revision 1.7
1.5 anton 1: This file describes the implementation model of Gforth. The things
2: described herein are valid in all implementations of Gforth.
3: !! needs updating
1.1 anton 4:
1.7 ! anton 5: \ Copyright (C) 1995,2000 Free Software Foundation, Inc.
1.5 anton 6:
7: \ This file is part of Gforth.
9: \ Gforth is free software; you can redistribute it and/or
10: \ modify it under the terms of the GNU General Public License
11: \ as published by the Free Software Foundation; either version 2
12: \ of the License, or (at your option) any later version.
14: \ This program is distributed in the hope that it will be useful,
15: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
16: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: \ GNU General Public License for more details.
19: \ You should have received a copy of the GNU General Public License
20: \ along with this program; if not, write to the Free Software
1.6 anton 21: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
1.1 anton 22:
23: The instruction pointer (ip) is post-incremented.
25: Branches are relative:
27: offset: target - offset
29: target: ...
31: The top-of return stack is in memory
33: The top of data stack need not be in memory. Other data stack items
34: are in memory.
36: The stacks grow downward
38: flags are represtented by 0 and -1
40: The loop control parameters are the index on the top of return stack
41: and the limit on the second item.
43: Everything except the virtual machine registers (ip, sp, etc.) is
46: The return address on the return stack occupies one cell.
48: There is a floating point stack
49: The floating point numbers are the same as C's double numbers
51: The error returns of the file word set are FALSE or TRUE. (or should
52: we use errno? Does this work with stdio functions?)
54: No assumptions can be made about the order of fetching the xt of the
55: next word wrt the other operations in a forth word. This makes a
56: difference only if you want to execute code lying on the stack or if
57: you store into the very next word that is executed.