http://www.rtr.myzen.co.uk/bb4wforth.zip
The additions to the Forth code are at the end of the file
'bb4wforth.f' and the assembly language modifications may be found in
the file 'forth.bas'. The program itself (forth.exe) should run on
any version of MS Windows from Win95 to Windows 7 (except early
versions of WinNT).
Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.
http://www.rtr.myzen.co.uk/bb4wforth.zip
This version passes the Hayes CORE tests, Gerry Jackson's COREPLUS
tests, and those CORE EXT tests that are relevant (i.e. for words
which are implemented); no modifications of any kind to the test suite
are required.
I have also added support for Windows events (equivalent to ON CLOSE,
ON MOUSE, ON MOVE, ON SYS and ON TIME in BBC BASIC) and you can now
specify a Forth program in the command line, which will be executed
immediately.
Richard,
This is very nice work you have done. Can you expand on how you see
this new Forth working for users of BBC BASIC?
Why is it needed? I don't think I have ever heard of a BASIC system
that had a Forth compiler inside.
I can imagine stuff, but I am interested in your vision of this.
Brian
That is hard to answer. I'm sure the great majority of BBC BASIC
users have little or no interest in Forth as a language, so as far as
they are concerned this is just another application which demonstrates
the breadth of capabilities of BBC BASIC for Windows. I suspect many
users will not have appreciated that the I/O subsystem of BBC BASIC
(particularly graphics output) is accessible to a program written
almost entirely in assembly language rather than BASIC.
> Why is it needed?
Well, I wouldn't say it's actually "needed". A few BBC BASIC users
are also quite interested in Forth, and BB4Wforth provides for them
the opportunity to use a 'hybrid' language, whereby they can write
their programs in Forth but also take advantage of (for example)
graphics capabilities with which they are already familiar. In its
latest incarnation BB4Wforth provides an interface to Windows
'events' (usually originating as 'messages' sent to the Window
Procedure) which is very similar to that provided in BBC BASIC, so has
a gentle learning curve.
I don't know how common it is for (free) Windows Forths to provide
such a convenient access to graphical output, and support for handling
asynchronous Windows events. I would like to think that BB4Wforth has
some application outside the BBC BASIC community because of those (and
other) features.
> I don't think I have ever heard of a BASIC system
> that had a Forth compiler inside.
I doubt that any other interpreted BASIC has that capability (other
than a Forth written *in* BASIC, of course). BBC BASIC for Windows
incorporates a full IA-32 assembler, making it possible to write
programs which are partly BASIC and partly assembly language code - a
very powerful combination. There are of course compilers which allow
you to use inline assembler code, but as far as I know BBC BASIC is
unique in being an interpreter which can assemble source code *at run
time* (in that respect not dissimilar from some Forths!).
> I can imagine stuff, but I am interested in your vision of this.
The motivation to create BB4Wforth didn't stem from a "vision", but
from the programming challenge it presented. Having been associated
with, and programming in, BBC BASIC for about 28 years it's difficult
to find something original to do! BB4Wforth was certainly that.
Richard.
Thanks for the explanation Richard. It is much appreciated.
I took a moment to look over the BBC Basic page. I particularly
enjoyed the history.
You played a significant role in the early micro-computer revolution.
Nice to see that you continue to create.
Great looking BBC BASIC demos!
Regards
Brian
I believe there was a Forth for the Sinclair computers that worked
like that, Artic Forth. As I recall, from the point of view of the
native Basic it was a Basic wrapper program with lots of data built
in, providing machine code for the Forth which the wrapper simply ran.
P.M.Lawrence.
Richard,
You are probably already aware, but just in case: BBC4 are running a
lovely dramatisation at the moment, called Micro Men. It charts the
rise and fall of the UK home computer boom from the perspective of
Clive Sinclair, and Chris Curry. If you haven't seen the programme,
I'm sure it will be a lovely trip down memory lane for you. Messers
Wilson et al are all there!
The programme is repeated (at the moment) on BBC4, and is also
available on the BBC iPlayer.
More information at: http://www.bbc.co.uk/bbc4
Regards
Mark.
Indeed, I have been aware of it for quite some time. An excellent
programme!
> If you haven't seen the programme, I'm sure it will be a lovely
> trip down memory lane for you. Messers Wilson et al are all there!
Did you notice that there's a cameo appearance by Sophie Wilson
herself?
> The programme is repeated (at the moment) on BBC4, and is also
> available on the BBC iPlayer.
Sadly not viewable from outside the UK.
Richard.
Indeed. I'm in Uzbekistan, however, I have the program, by, er, other
means!
I didn't notice the cameo, no. Darn it, now I will have to watch it
again. I'll let you where I think she is!
Regards
Mark
On my Spectrum I also had a Forth, but I don't remember the origin.
Later, in 1983-84 I wrote my own with help of my knowledge of Figforth
on my Elf II (1802) and a series of a Metaforth in the Vijgeblad, the
magazine of the Forth Users Group of the Dutch Hobby Computer Club. It
used BASIC to start and as an interface with cassette and microdrives.
The whole metacompilation and generating a new instance took 12
minutes. That must have been from and to a cassette tape, I think.
Regarding the BBC, a few years later I had cable and could view
Teletext pages of BBC 2 that contained Forth blocks. If you had a BBC
computer, you could downloads directly from the television. In the
early '80 I downloaded software from the Dutch radio. These services
dissappeared, but RAI Uno TV (Italy) showed Teletext till the end of
the decade.
--
Coos
CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html
http://www.rtr.myzen.co.uk/bb4wforth.zip
This has allowed me to remove the code I added to swap ROT and -ROT,
but of course all my other corrections/additions remain (including the
fix to /MOD).