version 1.14, 1997/02/08 22:58:10
|
version 1.15, 1997/02/09 21:51:39
|
Line 24 HEX
|
Line 24 HEX
|
|
|
\ labels for some code addresses |
\ labels for some code addresses |
|
|
|
doer? :docon [IF] |
: docon: ( -- addr ) \ gforth |
: docon: ( -- addr ) \ gforth |
\G the code address of a @code{CONSTANT} |
\G the code address of a @code{CONSTANT} |
['] bl >code-address ; |
['] bl >code-address ; |
|
[THEN] |
|
|
: docol: ( -- addr ) \ gforth |
: docol: ( -- addr ) \ gforth |
\G the code address of a colon definition |
\G the code address of a colon definition |
['] docon: >code-address ; |
['] docol: >code-address ; |
|
|
|
doer? :dovar [IF] |
: dovar: ( -- addr ) \ gforth |
: dovar: ( -- addr ) \ gforth |
\G the code address of a @code{CREATE}d word |
\G the code address of a @code{CREATE}d word |
['] udp >code-address ; |
['] udp >code-address ; |
|
[THEN] |
|
|
|
doer? :douser [IF] |
: douser: ( -- addr ) \ gforth |
: douser: ( -- addr ) \ gforth |
\G the code address of a @code{USER} variable |
\G the code address of a @code{USER} variable |
['] s0 >code-address ; |
['] s0 >code-address ; |
|
[THEN] |
|
|
|
doer? :dodefer [IF] |
: dodefer: ( -- addr ) \ gforth |
: dodefer: ( -- addr ) \ gforth |
\G the code address of a @code{defer}ed word |
\G the code address of a @code{defer}ed word |
['] source >code-address ; |
['] source >code-address ; |
|
[THEN] |
|
|
|
doer? :dofield [IF] |
: dofield: ( -- addr ) \ gforth |
: dofield: ( -- addr ) \ gforth |
\G the code address of a @code{field} |
\G the code address of a @code{field} |
['] reveal-method >code-address ; |
['] reveal-method >code-address ; |
|
[THEN] |
|
|
|
has-prims 0= [IF] |
|
: dodoes: ( -- addr ) \ gforth |
|
\G the code address of a @code{field} |
|
['] spaces >code-address ; |
|
[THEN] |
|
|
NIL AConstant NIL \ gforth |
NIL AConstant NIL \ gforth |
|
|
Line 735 Create ??? 0 , 3 c, char ? c, char ? c,
|
Line 751 Create ??? 0 , 3 c, char ? c, char ? c,
|
: dodoes, ( -- ) |
: dodoes, ( -- ) |
here /does-handler allot does-handler! ; |
here /does-handler allot does-handler! ; |
|
|
|
doer? :dovar [IF] |
: Create ( "name" -- ) \ core |
: Create ( "name" -- ) \ core |
Header reveal dovar: cfa, ; |
Header reveal dovar: cfa, ; |
|
[ELSE] |
|
: Create ( "name" -- ) \ core |
|
Header reveal here lastcfa ! 0 A, 0 , DOES> ; |
|
[THEN] |
|
|
\ Create Variable User Constant 17mar93py |
\ Create Variable User Constant 17mar93py |
|
|
Line 744 Create ??? 0 , 3 c, char ? c, char ? c,
|
Line 765 Create ??? 0 , 3 c, char ? c, char ? c,
|
Create 0 , ; |
Create 0 , ; |
: AVariable ( "name" -- ) \ gforth |
: AVariable ( "name" -- ) \ gforth |
Create 0 A, ; |
Create 0 A, ; |
: 2VARIABLE ( "name" -- ) \ double |
: 2Variable ( "name" -- ) \ double |
create 0 , 0 , ; |
create 0 , 0 , ; |
|
|
|
: uallot ( n -- ) udp @ swap udp +! ; |
|
|
|
doer? :douser [IF] |
: User ( "name" -- ) \ gforth |
: User ( "name" -- ) \ gforth |
Variable ; |
Header reveal douser: cfa, cell uallot , ; |
: AUser ( "name" -- ) \ gforth |
: AUser ( "name" -- ) \ gforth |
AVariable ; |
User ; |
|
[ELSE] |
|
: User Create uallot , DOES> @ up @ + ; |
|
: AUser User ; |
|
[THEN] |
|
|
: (Constant) Header reveal docon: cfa, ; |
doer? :docon [IF] |
|
: (Constant) Header reveal docon: cfa, ; |
|
[ELSE] |
|
: (Constant) Create DOES> @ ; |
|
[THEN] |
: Constant ( w "name" -- ) \ core |
: Constant ( w "name" -- ) \ core |
\G Defines constant @var{name} |
\G Defines constant @var{name} |
\G |
\G |
Line 760 Create ??? 0 , 3 c, char ? c, char ? c,
|
Line 792 Create ??? 0 , 3 c, char ? c, char ? c,
|
(Constant) , ; |
(Constant) , ; |
: AConstant ( addr "name" -- ) \ gforth |
: AConstant ( addr "name" -- ) \ gforth |
(Constant) A, ; |
(Constant) A, ; |
|
: Value ( w "name" -- ) \ core-ext |
|
(Constant) , ; |
|
|
: 2Constant ( w1 w2 "name" -- ) \ double |
: 2Constant ( w1 w2 "name" -- ) \ double |
Create ( w1 w2 "name" -- ) |
Create ( w1 w2 "name" -- ) |
Line 767 Create ??? 0 , 3 c, char ? c, char ? c,
|
Line 801 Create ??? 0 , 3 c, char ? c, char ? c,
|
DOES> ( -- w1 w2 ) |
DOES> ( -- w1 w2 ) |
2@ ; |
2@ ; |
|
|
|
doer? :dofield [IF] |
|
: (Field) Header reveal dofield: cfa, ; |
|
[ELSE] |
|
: (Field) Create DOES> @ + ; |
|
[THEN] |
\ IS Defer What's Defers TO 24feb93py |
\ IS Defer What's Defers TO 24feb93py |
|
|
|
doer? :dodefer [IF] |
: Defer ( "name" -- ) \ gforth |
: Defer ( "name" -- ) \ gforth |
\ !! shouldn't it be initialized with abort or something similar? |
\ !! shouldn't it be initialized with abort or something similar? |
Header Reveal dodefer: cfa, |
Header Reveal dodefer: cfa, |
['] noop A, ; |
['] noop A, ; |
\ Create ( -- ) |
[ELSE] |
\ ['] noop A, |
: Defer ( "name" -- ) \ gforth |
\ DOES> ( ??? ) |
Create ['] noop A, |
\ perform ; |
DOES> @ execute ; |
|
[THEN] |
|
|
: Defers ( "name" -- ) \ gforth |
: Defers ( "name" -- ) \ gforth |
' >body @ compile, ; immediate |
' >body @ compile, ; immediate |
Line 1263 DEFER DOERROR
|
Line 1304 DEFER DOERROR
|
Defer 'cold ' noop IS 'cold |
Defer 'cold ' noop IS 'cold |
|
|
: cold ( -- ) \ gforth |
: cold ( -- ) \ gforth |
[ has-os [IF] ] |
|
stdout TO outfile-id |
|
[ [THEN] ] |
|
[ has-files [IF] ] |
[ has-files [IF] ] |
pathstring 2@ process-path pathdirs 2! |
pathstring 2@ process-path pathdirs 2! |
init-included-files |
init-included-files |
Line 1305 Defer 'cold ' noop IS 'cold
|
Line 1343 Defer 'cold ' noop IS 'cold
|
." Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." cr ; |
." Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." cr ; |
|
|
: boot ( path **argv argc -- ) |
: boot ( path **argv argc -- ) |
|
main-task up! |
|
[ has-os [IF] ] |
|
stdout TO outfile-id |
|
[ [THEN] ] |
[ has-files [IF] ] |
[ has-files [IF] ] |
argc ! argv ! pathstring 2! |
argc ! argv ! pathstring 2! |
[ [THEN] ] |
[ [THEN] ] |
main-task up! |
|
sp@ s0 ! |
sp@ s0 ! |
[ has-locals [IF] ] |
[ has-locals [IF] ] |
lp@ forthstart 7 cells + @ - |
lp@ forthstart 7 cells + @ - |