Commit 58d3846d authored by Anton Ertl's avatar Anton Ertl
Browse files

Integrated locals (in particular automatic scoping) into the system.

parent 2eacd44a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
RM	= echo 'Trying to remove'
GCC	= gcc
CC	= gcc
SWITCHES = -DUSE_TOS -DUSE_FTOS -DDEFAULTBIN='"'$(PWD)'"' # -DDIRECT_THREADED 
SWITCHES = -D_POSIX_VERSION #-DUSE_TOS -DUSE_FTOS -DDEFAULTBIN='"'$(PWD)'"' # -DDIRECT_THREADED 
CFLAGS	= -O4 -Wall -g $(SWITCHES)

#-Xlinker -n puts text and data into the same 256M region
+5 −2
Original line number Diff line number Diff line
\ CROSS.FS     The Cross-Compiler                      06oct92py
\ $Id: cross.fs,v 1.5 1994-06-01 10:05:14 pazsan Exp $
\ $Id: cross.fs,v 1.6 1994-06-17 12:34:58 anton Exp $
\ Idea and implementation: Bernd Paysan (py)
\ Copyright 1992 by the ANSI figForth Development Group

@@ -134,6 +134,7 @@ include machine.fs
: cell+         cell + ;
: cells         cell<< lshift ;
: chars         ;
: floats	float * ;
    
>CROSS
: cell/         cell<< rshift ;
@@ -488,6 +489,8 @@ Cond: [Char] ( "<char>" -- ) restrict? Char lit, ;Cond

Cond: EXIT ( -- )  restrict?  compile ;S  ;Cond

Cond: ?EXIT ( -- ) 1 abort" CROSS: using ?exit" ;Cond

Cond: ; ( -- ) restrict?
               depth ?dup IF   1- <> ABORT" CROSS: Stack changed"
                          ELSE true ABORT" CROSS: Stack empty" THEN
+0 −7
Original line number Diff line number Diff line
\ High level floating point                            14jan94py

: faligned ( addr -- f-addr )
  [ 1 floats 1- ] Literal + [ -1 floats ] Literal and ;

: falign ( -- )
  here dup faligned swap
  ?DO  bl c,  LOOP ;

: f, ( f -- )  here 1 floats allot f! ;

\ !! have create produce faligned pfas
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
;; file named COPYING.  Among other things, the copyright notice
;; and this notice must be preserved on all copies.

;;; $Header: /usr/local/lib/cvs-repository/src-master/gforth/gforth.el,v 1.1 1994-05-07 14:55:53 anton Exp $
;;; $Header: /usr/local/lib/cvs-repository/src-master/gforth/gforth.el,v 1.2 1994-06-17 12:35:01 anton Exp $

;;-------------------------------------------------------------------
;; A Forth indentation, documentation search and interaction library
@@ -121,6 +121,7 @@ OBS! All words in forth-negatives must be surrounded by spaces.")
  (make-local-variable 'parse-sexp-ignore-comments)
  (setq parse-sexp-ignore-comments t))
  
;;;###autoload
(defun forth-mode ()
  "
Major mode for editing Forth code. Tab indents for Forth code. Comments
+10 −6
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ variable @code{GFORTHPATH}; if this does not exist, in
@node Notation, Arithmetic, Words, Words
@section Notation

The Forth words are describes in this section in the glossary notation
The Forth words are described in this section in the glossary notation
that has become a de-facto standard for Forth texts, i.e.

@quotation
@@ -320,10 +320,10 @@ theoretically keep floating point numbers on the data stack. As an
additional difficulty, you don't know how many cells a floating point
numkber takes. It is reportedly possible to write words in a way that
they work also for a unified stack model, but we do not recommend trying
it. Also, a Forth system to keep the local variables on the return
stack. This is reasonable, as local variables usually eliminate the need
to use the return stack explicitely. So, if you want to produce a
standard complying program and if you are using local variables in a
it. Also, a Forth system is allowed to keep the local variables on the
return stack. This is reasonable, as local variables usually eliminate
the need to use the return stack explicitely. So, if you want to produce
a standard complying program and if you are using local variables in a
word, forget about return stack manipulations in that word (see the
standard document for the exact rules).

@@ -417,7 +417,7 @@ IF
  @var{code}
ENDIF
@end example

or
@example
@var{flag}
IF
@@ -527,11 +527,13 @@ index by @var{n} instead of by 1. The loop is terminated when the border
between @var{limit-1} and @var{limit} is crossed. E.g.:

4 0 ?DO  i .  2 +LOOP   prints 0 2

4 1 ?DO  i .  2 +LOOP   prints 1 3

The behaviour of @code{@var{n} +LOOP} is peculiar when @var{n} is negative:

-1 0 ?DO  i .  -1 +LOOP  prints 0 -1

 0 0 ?DO  i .  -1 +LOOP  prints nothing

Therefore we recommend avoiding using @code{@var{n} +LOOP} with negative
@@ -539,7 +541,9 @@ Therefore we recommend avoiding using @code{@var{n} +LOOP} with negative
case behaves symmetrical to the positive case:

-2 0 ?DO  i .  -1 +LOOP  prints 0 -1

-1 0 ?DO  i .  -1 +LOOP  prints 0

 0 0 ?DO  i .  -1 +LOOP  prints nothing

The loop is terminated when the border between @var{limit-sgn(n)} and
Loading