Annotation of gforth/model, revision 1.10
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.10 ! anton 5: \ Copyright (C) 1995,2000,2003,2007 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
1.9 anton 11: \ as published by the Free Software Foundation, either version 3
1.5 anton 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
1.9 anton 20: \ along with this program. If not, see http://www.gnu.org/licenses/.
1.1 anton 21:
22: The instruction pointer (ip) is post-incremented.
24: Branches are relative:
26: offset: target - offset
28: target: ...
30: The top-of return stack is in memory
32: The top of data stack need not be in memory. Other data stack items
33: are in memory.
35: The stacks grow downward
37: flags are represtented by 0 and -1
39: The loop control parameters are the index on the top of return stack
40: and the limit on the second item.
42: Everything except the virtual machine registers (ip, sp, etc.) is
45: The return address on the return stack occupies one cell.
47: There is a floating point stack
48: The floating point numbers are the same as C's double numbers
50: The error returns of the file word set are FALSE or TRUE. (or should
51: we use errno? Does this work with stdio functions?)
53: No assumptions can be made about the order of fetching the xt of the
54: next word wrt the other operations in a forth word. This makes a
55: difference only if you want to execute code lying on the stack or if
56: you store into the very next word that is executed.