gnupic: Optimiziing Forth compiler for mid-range PICs


Previous by date: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles
Next by date: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles
Previous in thread: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles
Next in thread: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles

Subject: Re: Optimiziing Forth compiler for mid-range PICs
From: Francisco Rodrigo Escobedo Robles ####@####.####
Date: 7 Mar 2000 02:46:26 -0000
Message-Id: <200003070141.BAA02037@xinef.pepix.net>

Hello.

First, thanks for your interest. As for 16F877 support, I am currently very 
busy, but it's not difficult to support new PICs in the mid-range, as long as 
one only use 2 (of 4 possible) RAM banks. I'll take a look and try to support 
it or give guidelines for that purpose.

It's my intention to support all PIC models in the mid-range, and try to move 
to high-range, but be patient, please :)

> I've just printed the mary's manual and took a more thorough look at your
> compiler. Let me ask you a few questions:
> 
> 1) You wrote:
> 
> mary is part of the Glazz project, whose original aim was world
> domination, later changed to the creation of a native code Forth system with
> multiple targets.  
> 
> Does it mean that you are considering the 8051 support?
> There is no good GPL'd Forth for those microcontrollers...

Right now, the main target is PIC, as they are the ones I know better and have 
hardware tools for. In the future, I intend to support mainstream processors 
(x86, 68k, maybe Z80), but 8051 et al is not planned nor discarded. Simply, I 
don't have right now the needed tools.

The idea is to make the compiler general enough to make as easy as practical 
support for other targets, so any help for supporting 8051, 6805 or any other 
family is welcome.

> 2) I'd like to add the 16F84 support. It seems to me, that it should be enough
>    to change the MAXPICRAM0 definition from 2F to 4F in the 16c84-data.fs file.
>    Am I right?

Yes, AFAIK, the only difference from the programming standpoint 
between the 16C84 and the 16F84 is the RAM amount. So your proposed change 
will do the trick. I will include that change in a new file for next version.

> 3) mary is GPL'd, so what license applies to the code compiled with it?
>    If I use the code generated with mary in a commercial application, am I
>    obliged to provide the end user with the sources of my code?
>    Could you please state it explicitly in your documentation?

A good question... As you have seen, docs are in alpha state, too :) My idea 
is to promote Forth and PIC programming with a useful tool. The way I envision 
this is making a good compiler and a good library, freely available for anybody.
If GPL is not free enough, I will move to a "better" licensing scheme.

The answer is: you can distribute your application without to give the source. 
The only case in which you must give sources to anything is when you modify 
the code for the compiler, and then I ask for patches or libraries or 
additions, in order to centralize and coordinate the distribution of the whole 
package. This way, everybody can benefit from the effort, and we all win.

> 4) How could I implement the interrupt service routine in mary?

This is one of the things I intend to cover in a forthcoming examples suite. 
But I think (not tested, sorry) this example can be usefule. Bear in mind that 
no "easy" support is implemented, but this will do:

----8<----
( AN EXAMPLE OF AN ISR )
( NO WORDS ARE DEFINED )


PICFORTH

INIT-PICFORTH   ( CLEAR ALL, THE PROGRAM IS SELF-CONTAINED )
INIT-PIC


VARIABLE MYVAR  ( INITIALIZED TO 0   )

4 ORG           ( INTERRUPT VECTOR   )
FLABEL ISR GOTO ( INCONDITIONAL JUMP )


( HERE COMES MAIN PROGRAM CODE )

BEGIN
    PORTB @ INVERT MYVAR !
AGAIN


( INTERRUPT SERVICE ROUTINE )

ISR
MYVAR @ PORTA !
RETFIE
----8<----

No words are defined in this example. Not the best code, but it shows another 
feature of mary: you can use it as a high-level assembler.

For all interested in Forth, the meaning of the example is: a main program 
continually reads port B and inverts every bit, storing result in variable 
MYVAR. An ISR takes the current value of MYVAR and outs to port A.

Of course, code for initializing peripherals, interrupt sources, etc, is 
missing. But you get the point.

> 5) I'm sorry, but by mistake I've Cc'ed the first reply for your message
>    to the ####@####.#### instead of gnupic list - so in result
>    I've forwarded your message to that list :-(. However I hope you have
>    no objections to announcing of mary there... 

Great, I'm glad to know more people is aware of mary. I announced at 
freshmeat.net, a software news site. So, any proper way is welcome.

> Finally: you've done a wonderful work!

Thanks, it's just my way of contributing and thanking all the people that make 
the wonderful tools I use daily.

Regards.


---
Francisco Rodrigo Escobedo Robles - ####@####.####
El surrealismo vive en Pepix Labs - http://www.pepix.net/
Este mensaje expresa unicamente mi opinion en este momento



Previous by date: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles
Next by date: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles
Previous in thread: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles
Next in thread: 7 Mar 2000 02:46:26 -0000 Re: Optimiziing Forth compiler for mid-range PICs, Francisco Rodrigo Escobedo Robles


Powered by ezmlm-browse 0.20.