Skip to content

Commit

Permalink
Changed WANT to accept more than one name on the same line.
Browse files Browse the repository at this point in the history
  • Loading branch information
albert committed Jan 26, 2016
1 parent 1e54d66 commit 5f1332c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 26 deletions.
28 changes: 14 additions & 14 deletions ci86.gnr
Original file line number Diff line number Diff line change
Expand Up @@ -1315,16 +1315,16 @@ _COMMENT
THIS ROUTINE WILL ALLOW YOU TO STEP THRU FORTH PROGRAMS
EVERY TIME 'NEXT' IS EXECUTED.

IN ORDER TO USE THE STEP FEATURE YOU MUST DO THE FOLLOWING:
In order to use the step feature you must do the following:

1. PATCH THE INSTRUCTION IN 'NEXT' WITH A JUMP
TO 'TNEXT'
1. patch the instruction in 'next' with a jump
to 'TNEXT'

2. PATCH YOUR BREAKPOINT ROUTINE AT
LABEL 'BREAK'
2. patch your breakpoint routine at
label 'BREAK'

3. SET VARIABLES, `BIP' & `BIPE' TO THE
ADDRESSES YOU WANT TO STEP THRU.
3. set variables, `BIP' & `BIPE' to the
addresses you want to step thru.

THE CONTENTS OF THE 2 VARIABLES 'BIP` AND `BIPE'
ARE INTERPRETED AS FOLLOWS:
Expand Down Expand Up @@ -2249,7 +2249,7 @@ forthcode({>IN}) is not actually a variable:
its content must be fetched immediately, and changing it has no effect.
},
{{(>IN)},{IN}},
dnl this test to be moved to library test (after WANT legacy.)
dnl this test to be moved to library test (after "-legacy-" WANTED .)
dnl {{: GS1 >IN @ ; QUIT
dnl GS1 .},{4}},
{},
Expand Down Expand Up @@ -3226,7 +3226,7 @@ forthvar({addr}), i.e. it can be fetched with
forthcode({COUNT}). _VERBOSE_({{ (Where would that BD come
from?)}})},
{{COUNT},{$!}},
{{ 1 LOAD WANT $!-BD "A9" PAD $!-BD PAD COUNT TYPE},{A9}}, enddoc)
{{ 1 LOAD "$!-BD" WANTED "A9" PAD $!-BD PAD COUNT TYPE},{A9}}, enddoc)
_SUPPRESSED({{
_HEADER({$!-BD},{SSTORBD},{DOCOL})
DC TDUP, CSTOR, ONEP, SWAP, LMOVE
Expand Down Expand Up @@ -3565,7 +3565,7 @@ _HEADER({PP},{PP},{DOUSE}, _CELLS(29))
_C
_LOAD_({
worddocsafe( {INPUT~},{(>IN)},{paren_iso_in},{--- addr},{},
{After forthsample({WANT -legacy-}) this is used by
{After forthsample({ "-legacy-" WANTED }) this is used by
the word forthcode({L_>IN}), to store
the offset from the start within the current input
text buffer (terminal or disc) from which the next text will be
Expand Down Expand Up @@ -4787,7 +4787,7 @@ forthcode({WORD}) leaves the character count in the first byte, the characters,
ends with two or more blanks.
},
{{NAME},{PARSE},{BLK} ,{IN}},
{{1 LOAD WANT WORD : GS1 BL WORD COUNT . C@ EMIT ; GS1 CELLO},{5 C},
{{1 LOAD "WORD" WANTED : GS1 BL WORD COUNT . C@ EMIT ; GS1 CELLO},{5 C},
{ : GS2 5A WORD COUNT DUP . TYPE ; GS2 QQZ},{2 QQ},
{ : GS3 5A WORD COUNT DUP . TYPE ; GS3 ZZZQQZ},{2 QQ}
},
Expand Down Expand Up @@ -5059,7 +5059,7 @@ that uses a regular string.
},
{{CONTEXT},{PRESENT},{(FIND)}},
{
{ 1 LOAD WANT FIND : FIND: BL WORD FIND ; dnl
{ 1 LOAD "FIND" WANTED : FIND: BL WORD FIND ; dnl
123 : BONOBO ; FIND: BONOBO . ' BONOBO = . .},{-1 _T_ 123},
{ IMMEDIATE 142 FIND: BONOBO . ' BONOBO = . .},{1 _T_ 142},
dnl don't find the next, though it is a denotation
Expand Down Expand Up @@ -6925,7 +6925,7 @@ saved like this. _VERBOSE_({{In practice the use of
of the same stream.
}}) },
{{SAVE},{RESTORE-INPUT}},
{{1 LOAD WANT SAVE-INPUT !CSP : GS1 SAVE-INPUT 0 PP ! RESTORE-INPUT ; dnl
{{1 LOAD "SAVE-INPUT" WANTED !CSP : GS1 SAVE-INPUT 0 PP ! RESTORE-INPUT ; dnl
34 GS1 . . ?CSP},{-1 34} },
enddoc)
_SUPPRESSED({{
Expand Down Expand Up @@ -8838,7 +8838,7 @@ worddoc( {OPERATINGSYSTEM},{BYE},{bye},{---},{ISO},
{Return to the host environment _OS_.
},{{COLD},{EXIT-CODE}},
{
{ 1 LOAD WANT GET-ENV },{},
{ 1 LOAD "GET-ENV" WANTED },{},
{ "COMSPEC" GET-ENV SHELL $!},{},
{"wina.exe -f 23 EXIT-CODE ! BYE >null:" SYSTEM ( No error!)}, { }
},
Expand Down
16 changes: 8 additions & 8 deletions ci86.lina.labtest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dnl $Id$
dnl Copyright(2013): Albert van der Horst, HCC FIG Holland by GNU Public License
divert(4)dnl
wordtest( {D0<},
{ {WANT D0<},{},
{ { "D0<" WANTED },{},
{ 0 0 D0< . },{0},
{ 1 0 D0< . },{0},
{ 0 1 D0< . },{0},
Expand All @@ -12,15 +12,15 @@ wordtest( {D0<},
{ 0 -1 D0< . },{-1}
})
wordtest( {D<},
{ {WANT D<},{},
{ { "D<" WANTED },{},
{ 0. 0. D< . },{0},
{ 1. 0. D< . },{0},
{ 0. 1. D< . },{-1},
{ -1. 0. D< . },{-1},
})

wordtest( {D<},
{ {WANT D<},{},
{ { "D<" WANTED },{},
{ -1. -1. D< . },{0},
{ 0. -1. D< . },{0},
{ 1. -1. D< . },{0},
Expand All @@ -29,32 +29,32 @@ wordtest( {D<},
{ -1. INVERT 1. INVERT D< . },{0}
})
wordtest( {<=},
{ {WANT <=},{},
{ { "<=" WANTED },{},
{1 2 <= .},{_T_},
{-1 -2 <= .},{0},
{0 -1 <= .},{0},
{1 1 <= .},{_T_} },
)
wordtest( {>=},
{ {WANT >=},{},
{ { ">=" WANTED },{},
{1 2 >= .},{0},
{-1 -2 >= .},{_T_},
{0 -1 >= .},{_T_},
{1 1 >= .},{_T_} },
})
wordtest( {ROLL},
{ {WANT ROLL},{},
{ { "ROLL" WANTED},{},
{2 1 1 ROLL . . },{2 1 },
{3 2 1 0 3 ROLL . . . . },{3 0 1 2 },
{4 3 2 1 0 4 ROLL . . . . . },{4 0 1 2 3 },
})
wordtest( {REFILL},
{ { WANT REFILL}, {SOURCE : ISN'T UNIQUE },
{ { "REFILL" WANTED}, {SOURCE : ISN'T UNIQUE },
{ : _G13 2DUP OVER + SWAP DO I C@ &| = IF ^J I C! THEN LOOP ;},{},
{ " 1 2 3 4 REFILL| 1 . 3 .| .| . . . . " _G13 EVALUATE },{1 3 -1 4 3 2 1 },
})
wordtest( {0>IN},
{ { WANT 0>IN}, {SOURCE : ISN'T UNIQUE },
{ { "0>IN" WANTED}, {SOURCE : ISN'T UNIQUE },
{: _G14 DUP IF 1- 0>IN THEN ;},{},
{ : _G13 2DUP OVER + SWAP DO I C@ &| = IF ^J I C! THEN LOOP ;},{},
{ " 4| DUP . _G14 | 9 + . " _G13 EVALUATE},{4 3 2 1 0 9},
Expand Down
7 changes: 7 additions & 0 deletions logforth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13902,6 +13902,13 @@ storing into X15 all is well.
blocks.frt 5.109 ci86.gnr 5.131 allow threading pet in 64 bit.
Tested manually with the test section of the last threadpet.frt
in tools/THREADS.
blocks.frt 5.109 multiple words names after WANT.

2016 jan 26
The update of 23 jan failed. The new version of WANT was not yet saved.
Furthermore the tests failed because WANT was used. Changed those to
used WANTED, blocks.frt was already changed to use WANTED.
blocks.frt 5.110 ci86.gnr 5.132 allow threading pet in 64 bit.

--------------------
officialdecompilation fails on SEE _pad.
Expand Down
2 changes: 2 additions & 0 deletions manual.mi
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ but thisforth does.

thisforth uses the forthdefi({blocks}) as a library
by addition of the word forthcode({WANTED}) and a convention.
More convenient is forthcode({WANT}) that adds all words that are on the
remainder of the line, so without quotes.
Starting with forthsamp({thisforth -w}) or most any option you have this
facility available. If you are already in thisforth, you can
type forthsamp({1 LOAD}).
Expand Down
8 changes: 4 additions & 4 deletions options.frt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ CREATE _pad 80 ALLOT \ Word surrounded by spaces
DUP 0= 24 AND THROW POSITION 0= WHILE 1+ REPEAT ;
: (WANTED) ( sc -- ) ERRSCR @ 4 + >R BEGIN 2DUP PRESENT 0=
WHILE 2DUP R> #LOCATED DUP 1+ >R LOAD REPEAT RDROP ;
\ Make sure WORD is present in the current namespace
: WANTED '(WANTED) CATCH DUP 24 = IF >R ETYPE R> MESSAGE
ELSE THROW 2DROP THEN ; : WANT ( "name" ) NAME WANTED ;
: CF: "CONFIG" WANTED ;
: WANTED ( Make WORD available. ) '(WANTED) CATCH DUP 24 = IF
>R ETYPE R> MESSAGE ELSE THROW 2DROP THEN ;
: WANT ^J PARSE SAVE SET-SRC BEGIN NAME DUP WHILE WANTED
REPEAT 2DROP RESTORE ; : CF: "CONFIG" WANTED ;
( -b :_This_option_is_available )


Expand Down

0 comments on commit 5f1332c

Please sign in to comment.