Author |
Topic: BB4W FORTH Thoughts... (Read 1219 times) |
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BB4W FORTH Thoughts...
« Reply #30 on: Oct 1st, 2009, 08:19am » |
|
I've updated BB4Wforth to version 0.30:
http://groups.yahoo.com/group/bb4w/files/BB4Wforth/bb4wforth.zip
This version has the LEAVE bug corrected, and also implements the following new Forth words: M* */ */MOD U< U> S>D 2* 2/ U2/ SOURCE >IN UM/MOD SM/REM FM/MOD R@ D+ D- [CHAR] 2OVER CELL+ CHARS CHAR+ 2! LSHIFT RSHIFT COUNT DIGIT >NUMBER
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BB4W FORTH Thoughts...
« Reply #31 on: Oct 2nd, 2009, 10:16pm » |
|
How about this then....
Code:BB4Wforth version 0.33 adapted from Jonesforth version 45
Corrections and additions by R.T. Russell, September 2009
244681 cells remaining
OK
S" tester.fr" INCLUDED
S" core.fr" INCLUDED
TESTING CORE WORDS
TESTING BASIC ASSUMPTIONS
TESTING BOOLEANS: INVERT AND OR XOR
TESTING 2* 2/ LSHIFT RSHIFT
TESTING COMPARISONS: 0= = 0< < > U< MIN MAX
TESTING STACK OPS: 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP
TESTING >R R> R@
TESTING ADD/SUBTRACT: + - 1+ 1- ABS NEGATE
TESTING MULTIPLY: S>D * M* UM*
TESTING DIVIDE: FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD
TESTING HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT
TESTING CHAR [CHAR] [ ] BL S"
TESTING ' ['] FIND EXECUTE IMMEDIATE COUNT LITERAL POSTPONE STATE
TESTING IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE
TESTING DO LOOP +LOOP I J UNLOOP LEAVE EXIT
TESTING DEFINING WORDS: : ; CONSTANT VARIABLE CREATE DOES> >BODY
TESTING EVALUATE
TESTING SOURCE >IN WORD
TESTING <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL
TESTING FILL MOVE
TESTING OUTPUT: . ." CR EMIT SPACE SPACES TYPE U.
YOU SHOULD SEE THE STANDARD GRAPHIC CHARACTERS:
!"#$%&'()*+,-./0123456789:;<=>?@
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`
abcdefghijklmnopqrstuvwxyz{|}~
YOU SHOULD SEE 0-9 SEPARATED BY A SPACE:
0 1 2 3 4 5 6 7 8 9
YOU SHOULD SEE 0-9 (WITH NO SPACES):
0123456789
YOU SHOULD SEE A-G SEPARATED BY A SPACE:
A B C D E F G
YOU SHOULD SEE 0-5 SEPARATED BY TWO SPACES:
0 1 2 3 4 5
YOU SHOULD SEE TWO SEPARATE LINES:
LINE 1
LINE 2
YOU SHOULD SEE THE NUMBER RANGES OF SIGNED AND UNSIGNED NUMBERS:
SIGNED: -80000000 7FFFFFFF
UNSIGNED: 0 FFFFFFFF
TESTING INPUT: ACCEPT
PLEASE TYPE UP TO 80 CHARACTERS:
The quick brown fox jumps over the lazy dog.
RECEIVED: "The quick brown fox jumps over the lazy dog."
TESTING DICTIONARY SEARCH RULES
End of Core word set tests
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BB4W FORTH Thoughts...
« Reply #33 on: Oct 4th, 2009, 4:13pm » |
|
I'm pleased to announce the release of BB4Wforth version 0.35:
http://groups.yahoo.com/group/bb4w/files/BB4Wforth/bb4wforth.zip
This version runs somewhat more quickly than version 0.33 (but is otherwise functionally equivalent).
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BB4W FORTH Thoughts...
« Reply #34 on: Oct 7th, 2009, 10:05am » |
|
I've updated BB4Wforth to version 0.36:
http://groups.yahoo.com/group/bb4w/files/BB4Wforth/bb4wforth.zip
This version fixes a couple of minor bugs:
1. The conditions for terminating a DO...LOOP were subtly incorrect.
2. EVALUATE locked up if passed an empty string.
The following additional CORE EXT words are implemented: C" 2>R 2R> CONVERT.
Version 0.36 passes both the Hayes CORE test and the (non-Hayes) COREPLUS test. It also passes CORE EXT tests of words which are implemented.
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BB4W FORTH Thoughts...
« Reply #35 on: Oct 10th, 2009, 1:33pm » |
|
I'm pleased to announce the release of BB4Wforth version 0.37:
http://groups.yahoo.com/group/bb4w/files/BB4Wforth/bb4wforth.zip
There is now support for handling Windows events (equivalent to ON CLOSE, ON MOUSE, ON MOVE, ON SYS and ON TIME in BB4W). Rather than allowing genuinely asynchronous interrupts, which could have had an adverse effect on execution time, Windows events are made synchronous by means of the POLL word.
For example, to incorporate an ON TIME handler you would write a Forth word called ONTIME containing the code you wish to execute. Then, within your 'main' program, you would put POLL wherever you want a pending event to be processed:
Code:: ONTIME ." ON TIME!" CR ;
: TEST BEGIN POLL 0 MS AGAIN ;
TEST (here 0 MS avoids 'burning' the processor).
Additionally, v0.37 allows you to specify the name of a Forth program in the command line (or via a shortcut), causing it to be executed directly:
Code: Richard.
|
|
Logged
|
|
|
|
knudvaneeden
Developer
member is offline


Posts: 32
|
 |
Re: BB4W FORTH Thoughts...
« Reply #36 on: Oct 20th, 2009, 5:21pm » |
|
To learn Forth:
Leo Brodie 'Starting Forth' book (a classic) online:
http://forth.com/starting-forth/
(source: magazine 'Dr. Dobb's journal')
with friendly greetings, Knud van Eeden
|
|
Logged
|
|
|
|
|