Searching \ for 'MediumC PIC-C compiler (beta version)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'MediumC PIC-C compiler (beta version)'.

Truncated match.
PICList Thread
'MediumC PIC-C compiler (beta version)'
1999\01\04@082722 by Janusz J. Mlodzianowski

flavicon
face
Free MediumC PIC-C compiler, version beta (source and documentation).

The MediumC PIC-C compiler is based on the original source of John Favata's
(spam_OUTfavataTakeThisOuTspamcs.buffalo.edu) port of SmallC (Ron Cain, Dr. Dobb's Journal of
Computer Calisthenics & Orthodontia, #45) compiler.
The code however is nearly in 90% rewriten from scratch.
New compiler features include some support for structs, unions, enums, ANSI
function calls and other data types. As it no more resembles SmallC I would
prefer to call it "MediumC".
As I do not have enough time to continue the development I am releasing the
source under GNU license in hope that there are somewhere people willing
to continue and test the design.
I have included in the package a list of things still needed to be done as
well as some technical documentation.

You are welcomed to evaluate the package which can be downloaded from
my web page:

       http://www.bg.univ.gda.pl/~janusz

Once on the page, follow "other software" link.
You can also have a look at my MPASM PIC preprocessor.
I would appreciate your comments.

Have fun,
Janusz J. Mlodziaowski
University of Gdansk, Gdansk, Poland
Institute of Experimental Physics

1999\01\04@201222 by James Cameron

flavicon
face
part 0 10743 bytes
If I continue with this, I'll produce a prettier patch removing the use
of non-standard C library functions and make it compile out of the box
on Linux.  Right now my patch just comments the non-standard functions
out.

The mnemonics it generates don't seem to be recognised by gpasm, I
suspect they are intended for the author's assembler, or there is a
macro definition file missing.

       mov _primary, #0
       add _primary, _stackptr
       call _indr_
       mov _portB, _primary

It looks very nice.

--
James Cameron                                      (.....cameronKILLspamspam@spam@stl.dec.com)

OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.
diff -c mediumc/error.c mediumc-patched/error.c
*** mediumc/error.c     Tue Jan  5 11:50:24 EST 1999
--- mediumc-patched/error.c     Tue Jan  5 11:51:33 EST 1999
***************
*** 37,43 ****
               comment();
               outstr("To many errors, aborting..");
               nl();
!               fcloseall();
               exit(4);
       }
 }
--- 37,43 ----
               comment();
               outstr("To many errors, aborting..");
               nl();
!               /* fcloseall(); */
               exit(4);
       }
 }
***************
*** 64,70 ****
 void fatal(char *err, int code)
 {
       fprintf(stderr, "Fatal error: %s\naborting..", err);
!       fcloseall();                                            /* close files *
/
       exit(code);                                                     /* exit
to OS */
 }

--- 64,70 ----
 void fatal(char *err, int code)
 {
       fprintf(stderr, "Fatal error: %s\naborting..", err);
!       /* fcloseall(); */                                              /* close
files */
       exit(code);                                                     /* exit
to OS */
 }

Only in mediumc-patched: error.o
diff -c mediumc/expr.c mediumc-patched/expr.c
*** mediumc/expr.c      Tue Jan  5 11:50:24 EST 1999
--- mediumc-patched/expr.c      Tue Jan  5 11:51:33 EST 1999
***************
*** 644,647 ****
               ptr->size=sptr->size;
/* new size */
       }
 }
-
--- 644,646 ----
Only in mediumc-patched: expr.o
Only in mediumc-patched: function.o
diff -c mediumc/gen.c mediumc-patched/gen.c
*** mediumc/gen.c       Tue Jan  5 11:50:24 EST 1999
--- mediumc-patched/gen.c       Tue Jan  5 11:51:33 EST 1999
***************
*** 27,33 ****
 char *makename(void)
 {
       static char name[NAMESIZE];
!       itoa(getlabel(),name,32);
       return(name);
 }

--- 27,34 ----
 char *makename(void)
 {
       static char name[NAMESIZE];
!       /* itoa(getlabel(),name,32);    */
!       sprintf(name,"%d",getlabel());
       return(name);
 }

Only in mediumc-patched: gen.o
Only in mediumc-patched: glbsym.o
Common subdirectories: mediumc/include and mediumc-patched/include
diff -c mediumc/io.c mediumc-patched/io.c
*** mediumc/io.c        Tue Jan  5 11:50:24 EST 1999
--- mediumc-patched/io.c        Tue Jan  5 11:51:33 EST 1999
***************
*** 7,13 ****
 * author: Janusz J. Mlodzianowski, fizjmspamKILLspamuniv.gda.pl
 **********************************************************/
 #include <stdio.h>
! #include <dir.h>
 #include "defs.h"
 #include "data.h"
 #include "externs.h"
--- 7,13 ----
 * author: Janusz J. Mlodzianowski, .....fizjmKILLspamspam.....univ.gda.pl
 **********************************************************/
 #include <stdio.h>
! /* #include <dir.h>*/
 #include "defs.h"
 #include "data.h"
 #include "externs.h"
Only in mediumc-patched: io.o
Only in mediumc-patched: lex.o
Only in mediumc-patched: listmng.o
Only in mediumc-patched: locsym.o
diff -c mediumc/main.c mediumc-patched/main.c
*** mediumc/main.c      Tue Jan  5 11:50:25 EST 1999
--- mediumc-patched/main.c      Tue Jan  5 11:51:34 EST 1999
***************
*** 7,13 ****
 * author: Janusz J. Mlodzianowski, EraseMEfizjmspam_OUTspamTakeThisOuTuniv.gda.pl
 **********************************************************/
 #include <stdio.h>
! #include <dir.h>
 #include "defs.h"
 #include "data.h"
 #include "externs.h"
--- 7,13 ----
 * author: Janusz J. Mlodzianowski, fizjmspamspam_OUTuniv.gda.pl
 **********************************************************/
 #include <stdio.h>
! /* #include <dir.h> */
 #include "defs.h"
 #include "data.h"
 #include "externs.h"
***************
*** 83,90 ****
       while(p){
 /* better allow one source file only.. */
               errfile=0;
!               if((input=fopen(p,"r"))==NULL) fatal("Open failure",1);
!               if((output=fopen(*bp? bp:foname(p),"w"))==NULL) fatal("Open fail
ure",2);


               glbtab=(list *)calloc(1,sizeof(list));
/* init global symbol table */
--- 83,94 ----
       while(p){
 /* better allow one source file only.. */
               errfile=0;
!               if((input=fopen(p,"r"))==NULL) {
!               perror(p);
!               perror("fopen input");
!               fatal("Open failure",1); }
!               if((output=fopen(*bp? bp:foname(p),"w"))==NULL) {
!               perror("fopen output"); fatal("Open failure",2);}


               glbtab=(list *)calloc(1,sizeof(list));
/* init global symbol table */
***************
*** 142,156 ****
 **********************************************************/
 char *foname(char *name)
 {
!       char fname[MAXPATH];
!       char drive[MAXDRIVE];
!       char dir[MAXDIR];
!       char ff[MAXFILE];
!       char ext[MAXEXT];
!
!       fnsplit(name,drive,dir,ff,ext);
!       fnmerge(fname,drive,dir,ff,".s");                               /* appen
d .s */
!       return(fname);
 }

 /**********************************************************
--- 146,152 ----
 **********************************************************/
 char *foname(char *name)
 {
!       return("tmp.s");
 }

 /**********************************************************
Only in mediumc-patched: main.o
diff -c mediumc/makefile mediumc-patched/makefile
*** mediumc/makefile    Sun Jan  3 15:33:38 EST 1999
--- mediumc-patched/makefile    Tue Jan  5 11:35:02 EST 1999
***************
*** 1,79 ****
! # MediumC. TurboC Makefile
!
! objfile = scrap\data.obj scrap\error.obj scrap\expr.obj\
!         scrap\function.obj scrap\gen.obj scrap\io.obj\
!         scrap\lex.obj scrap\main.obj scrap\preproc.obj\
!         scrap\primary.obj scrap\stmt.obj scrap\sym.obj\
!         scrap\glbsym.obj scrap\locsym.obj scrap\while.obj\
!         scrap\vm.obj scrap\code.obj scrap\listmng.obj
!
! #cc compiler:
! cc     = c:\tc\tcc                      #edit for compiler
! cflags = -N -y -c -O -Z -Ic:\tc\include -mm -oscrap\$&
!
! #linker
! lnkp    = c:\tasm\tlink                 #edit for linker
! tlib    = c:\tc\lib                     #edit for libraries
! lflags  = /m /c /d                      #linker options
! mapfile = scrap\mcc                     #map file
! init    = $(tlib)\c0m                   #startup
! libs    = $(tlib)\cm $(tlib)\emu        #libraries
!
! #link compiler to mcc.exe:
! mcc.exe: $(objfile)
!       $(lnkp) $(lflags) $(init) @linkfile,mcc,$(mapfile),$(libs)
!
! #all objects:
! scrap\data.obj: data.c defs.h data.h externs.h
!       $(cc) $(cflags) data.c
!
! scrap\error.obj: error.c defs.h data.h externs.h
!       $(cc) $(cflags) error.c
!
! scrap\expr.obj: expr.c defs.h data.h externs.h
!       $(cc) $(cflags) expr.c
!
! scrap\function.obj: function.c defs.h data.h externs.h
!       $(cc) $(cflags) function.c
!
! scrap\gen.obj: gen.c defs.h data.h externs.h
!       $(cc) $(cflags) gen.c
!
! scrap\io.obj: io.c defs.h data.h externs.h
!       $(cc) $(cflags) io.c
!
! scrap\lex.obj: lex.c defs.h data.h externs.h
!       $(cc) $(cflags) lex.c
!
! scrap\main.obj: main.c defs.h data.h externs.h
!       $(cc) $(cflags) main.c
!
! scrap\preproc.obj: preproc.c defs.h data.h externs.h
!       $(cc) $(cflags) preproc.c
!
! scrap\primary.obj: primary.c defs.h data.h externs.h
!       $(cc) $(cflags) primary.c
!
! scrap\stmt.obj: stmt.c defs.h data.h externs.h
!       $(cc) $(cflags) stmt.c
!
! scrap\sym.obj: sym.c defs.h data.h externs.h
!       $(cc) $(cflags) sym.c
!
! scrap\glbsym.obj: glbsym.c defs.h data.h externs.h
!       $(cc) $(cflags) glbsym.c
!
! scrap\locsym.obj: locsym.c defs.h data.h externs.h
!       $(cc) $(cflags) locsym.c
!
! scrap\while.obj: while.c defs.h data.h externs.h
!       $(cc) $(cflags) while.c
!
! scrap\vm.obj: vm.c defs.h data.h externs.h
!       $(cc) $(cflags) vm.c
!
! scrap\code.obj: code.c defs.h data.h externs.h
!       $(cc) $(cflags) code.c
!
! scrap\listmng.obj: listmng.c defs.h data.h externs.h
!       $(cc) $(cflags) listmng.c
--- 1,49 ----
! # MediumC. TurboC Makefile
!
! objfile = data.o error.o expr.o\
!         function.o gen.o io.o\
!         lex.o main.o preproc.o\
!         primary.o stmt.o sym.o\
!         glbsym.o locsym.o while.o\
!         vm.o code.o listmng.o
!
! CFLAGS = -g
!
! mcc : $(objfile)
!       cc $(CFLAGS) -o mcc $(objfile)
!
! data.o: data.c defs.h data.h externs.h
!
! error.o: error.c defs.h data.h externs.h
!
! expr.o: expr.c defs.h data.h externs.h
!
! function.o: function.c defs.h data.h externs.h
!
! gen.o: gen.c defs.h data.h externs.h
!
! io.o: io.c defs.h data.h externs.h
!
! lex.o: lex.c defs.h data.h externs.h
!
! main.o: main.c defs.h data.h externs.h
!
! preproc.o: preproc.c defs.h data.h externs.h
!
! primary.o: primary.c defs.h data.h externs.h
!
! stmt.o: stmt.c defs.h data.h externs.h
!
! sym.o: sym.c defs.h data.h externs.h
!
! glbsym.o: glbsym.c defs.h data.h externs.h
!
! locsym.o: locsym.c defs.h data.h externs.h
!
! while.o: while.c defs.h data.h externs.h
!
! vm.o: vm.c defs.h data.h externs.h
!
! code.o: code.c defs.h data.h externs.h
!
! listmng.o: listmng.c defs.h data.h externs.h
Only in mediumc-patched: makefile.orig
Only in mediumc-patched: makefile~
Only in mediumc-patched: mcc
Only in mediumc-patched: preproc.o
Only in mediumc-patched: primary.o
Common subdirectories: mediumc/scrap and mediumc-patched/scrap
Only in mediumc-patched: stmt.o
Only in mediumc-patched: sym.o
Only in mediumc-patched: test.c
Only in mediumc-patched: test.s
Only in mediumc: tmp.tmp
Only in mediumc-patched: vm.o
Only in mediumc-patched: while.o

1999\01\05@092202 by lilel

flavicon
face
James Cameron said:
> I've grabbed the MediumC PIC-C compiler beta, and patched it to
> compile and work on Digital UNIX.  A port to Linux should be trivial
> from this point.  The patch is attached for the Linux hackers to
> apply.


Keep us posted, James.  I tried to download Medium-C yeasterday but
no luck.  I'd sure like to see this project kept alive.


-- Lawrence Lile

=> Median Filter Source Code
=> AutoCad blocks for electrical drafting
=> Brownout tester plans
=> Amateurish pictures of my family

at:  http://home1.gte.net/llile/index.htm

1999\01\05@215140 by James Cameron

flavicon
face
Lawrence Lile wrote:
> Keep us posted, James.  I tried to download Medium-C yeasterday but
> no luck.  I'd sure like to see this project kept alive.

I've verified that Medium-C needs the MPP preprocessor by the same
author.  But the MPP source isn't available from the author's web site,
so I shan't be trying to hard beyond asking for the source to be placed
under GPL.

--
James Cameron                                      (@spam@cameronKILLspamspamstl.dec.com)

OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...