In article <
39a98c80-7d90-4281...@googlegroups.com>,
<
foxaudio...@gmail.com> wrote:
>On Monday, August 22, 2016 at 11:42:53 PM UTC-4, Chris Curl wrote:
>> On Saturday, August 20, 2016 at 1:28:10 PM UTC-4, Hannu Vuolasaho wrote:
>> > Hello!
>> >=20
>> > I have VS1005 developer board from VLSI Solution in front of me and I'm=
>=20
>> > curious if I could write some kind of forth for it.
>> >=20
>> > I'm targeting hobby toy forth which could do something useful. Still=20
>> > something more elegant than bunch of C function pointers in a struct.
>> >=20
>> > Environment has C compiler, assembler and there is even OS available.
>> >=20
>> > The HW has some nice features like two memories and looping hardware.=
>=20
>> > Also some parallel execution is provided by the hardware. OS has=20
>> > dynamical loading and many neat features.
>> >=20
>> > However there isn't that much memory available. 32kWord I, X and Y ram =
>each.
>> >=20
>> > And as usual, googling for forth is rather hard task so getting good=20
>> > references or ideas isn't really easy.
>> >=20
>> > So far I've thought about only memory configuration and calling=20
>> > convention. The stacks and other data should go to X memory and=20
>> > dictionary to Y. When the forth starts, it saves context to C stack=20
>> > pointer and after that it can run nicely. Two I registers goes to D and=
>=20
>> > R stack. Somewhere there has to be input buffer an the position of it.
>> >=20
>> > Also I've given some though to build binary image file to run with the=
>=20
>> > forth system so that the memory wouldn't be an issue but that isn't yet=
>=20
>> > a really important thing. And it would require some operating system=20
>> > interfacing.
>> >=20
>> > So what should I read next? What should I think more before I start to=
>=20
>> > hacking something together and make the grand design mistake?
>> >=20
>> > Hannu Vuolasaho
>>=20
>> You might consider building a Forth VM using the C compiler and loading=
>=20
>> it with a pre-built Forth dictionary, similar to what I am working on=20
>> here ...
>>=20
>>
https://github.com/CCurl/Forth_C
>>=20
>> For reference, when I build it as a 16-bit system, it easily fits in 8K=
>=20
>> bytes. And it has more than a few words in it that you wouldn't need in a=
>n
>> embedded implementation.
>>=20
>> Just a thought ...
>
>Since you have an Assembler, you could look at Your Forth by Albert Van Der=
> Horst. It provides you with a source code example, albeit Intel, but also=
> running commentary on what it means. Would take some time to translate, bu=
I was on holiday. Anyway for a project like yours I see the following
advantages in yourforth. (Actually I design it with your kind of
project in mind).
1. avoiding c libraries make for a simple build mechamism
just assembling saves time (more than you think).
2. it is assembler yes, but you can't avoid writing + in
assembler anyway.
3. Headers and the lookup mechanism are brutally simple.
4. Nothing is written in assembler for the heck of it, or
for speed obsession. Each assembler word is basic and useful
in more than a single context.
5. Number output is single precision only. An excursion via
double precision for all words (or a duplication) makes
no sense for you.
It is improbable that sophistication present in an
example Forth makes sense for your DSP. You're one step ahead
with yourforth, if you want to add sophistication because
you don't have to delete the sophistication that is there.
If any words missing are important for you, you may find them
in the ciforth source library. (lina wina).
All Forth legacy burdens have been cut. The resulting
ISO Forth incompatiblities will be inconsequential for
you (hopefully).
>
>BF
Groetjes Albert
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&
c.xs4all.nl &=n
http://home.hccnet.nl/a.w.m.van.der.horst