Maker Pro
Maker Pro

Forth for PIC?

E

Ed Laughery

Jan 1, 1970
0
Hi

PicForth appears to run under Unix. Original post wanted a Windows
platform, however, has anyone ran PicFoth on Linux and if so, which
distribution(s)?

Regards
Ed
 
A

Alex Gibson

Jan 1, 1970
0
Ed Laughery said:
Hi

PicForth appears to run under Unix. Original post wanted a Windows
platform, however, has anyone ran PicFoth on Linux and if so, which
distribution(s)?

Regards
Ed

PicForth works fine with windows, linux and macosx.

PicForth is an optimizing Forth cross compiler hosted on gForth
so as long as gforth is available.

Sources for gforth are available so as long as there is a
reasonably recent version of gcc you can have picforth.

http://wiki.enst.fr/bin/view/Picforth/WebHome

nice tutorial
http://tutor.al-williams.com/picforth1.htm

Alex
 
E

Ed Laughery

Jan 1, 1970
0
Hi Alex

Thank you for the heads up on gForth -

Has there been any work done on extending PICForth to support other PIC
chips?

Regards
Ed
 
A

Alex Gibson

Jan 1, 1970
0
Ed Laughery said:
Hi Alex

Thank you for the heads up on gForth -

Has there been any work done on extending PICForth to support other PIC
chips?

Not similar at all(writen from scratch)
and for 18f only
http://www.freenet.org.nz/pic18forth

pre-pre-alpha version, Pic18Forth-0.0.0
just been announced (on sunday)
writen in python

From the announcement by David McNab
Subject: pre-announcing Forth for PIC18F chips


Hi gnupic and picforth people,

This is a pre-announcement of a coming Forth compiler for the PIC18Fxxx
chips. I've tentatively called it 'PIC18forth', but am open to suggestions
for a better name.

PIC18forth is radically different from the PIC16Fxxx-only PicForth compiler.
Almost nothing in common, since I've written PIC18forth from scratch.

Quick summary of features - love them and loathe them:

* signed/unsigned 16-bit data cells and operators
* software return stack
* data stack grows up (increasing addresses), while
return stack grows down (decreasing addresses)
* total allocated size of data+return stacks can
be set to anything between 16 and 1024 bytes
* compiler is written in Python, and is very approachable
and extensible, even for people new to the code
* integrated into gputils
* forth sources get compiled to relocatable assembly (.asm)
sources, ready for gpasm and gplink
* the generated code embeds a 16-bit forth vm (token threaded
execution model) which executes bytecodes
* the generated code is self-contained, and once assembled
and linked, can be downloaded/flashed as a standalone program
* FSR0 is usually used for data stack ptr, FSR1 usually
used as return stack ptr, FSR2 used as general purpose
pointer
* full support for locals (John Hopkins syntax, data
gets transferred from data stack to a frame on return stack
* vm design favours code density over execution speed
* contents of 'code .. end-code' definitions are included
verbatim in generated assembly source (with '\' comments
changed to ';')
* the defining-words 'primitive .. end-primitive' can be
used in place of 'code .. end-code', to define a word
in assembler which will be available as a single-byte
vm instruction - easy to add/remove primitives at will
* maps to von Neumann memory model, with addresses <8000H
treated as RAM addresses, and addresses>=8000H treated
as program ROM addresses
 
Top