Searching \ for 'C compiler in java' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/language/index.htm?key=c
Search entire site for: 'C compiler in java'.

Truncated match.
PICList Thread
'C compiler in java'
1998\01\22@124317 by Giorgio Alboni

flavicon
face
I'm writing a C compiler fo microchip 16C84. The output is a full commented
MPLAB assembler file. I just made the parser and a part of compiler.
Give a look at this code (c -> asm) and tell me what do you think.
(This is a very stupid program).

byte PORTA,PORTB;

void interrupt ()
{}

void incPortA (byte a,byte b)
{
 PORTA+=a;
 if (PORTA)
     PORTA++;
   else
     PORTA+=10;
}

void main ()
{
 byte c1,c2;
 PORTA=12;
 PORTB=12;
 c1=0;
 c2=0;
 c1=c2+3+(c1-1);
 incPortA(c2,c1);
}

Output of compiler:
upt


interrupt:                                      ; Function definition
               retfie                  ; End Function definition: interrupt



incPortA:                                       ; Function definition
; Expression: PORTA+=a;
               movf    incPortA_a,0
               addwf   PORTA,0         ; Make: PORTA+=a
               movwf   PORTA
ifSt0:                                  ; if (PORTA)
               movf    PORTA,0
               sublw   d'0'            ; Test if condition
               btfsc   _z
               goto    ifSt0else
; Expression: PORTA++;
               movf    PORTA,0
               incf    PORTA,1         ; Make: PORTA++
               goto    ifSt0end
ifSt0else:
; Expression: PORTA+=10;
               movlw   d'10'
               addwf   PORTA,0         ; Make: PORTA+=10
               movwf   PORTA
ifSt0end:
               return                  ; End Function definition: incPortA



main:                                   ; Function definition
; Expression: PORTA=12;
               movlw   d'12'
               movwf   PORTA           ; Save result of: PORTA=12
; Expression: PORTB=12;
               movlw   d'12'
               movwf   PORTB           ; Save result of: PORTB=12
; Expression: c1=0;
               movlw   d'0'
               movwf   main_c1         ; Save result of: c1=0
; Expression: c2=0;
               movlw   d'0'
               movwf   main_c2         ; Save result of: c2=0
; Expression: c1=c2+3+(c1-1);
               movlw   d'3'
               addwf   main_c2,0               ; Make: c2+3
               movwf   __CCTemp1               ; Save result of: c2+3
               movlw   d'1'
               subwf   main_c1,0               ; Make: c1-1
               addwf   __CCTemp1,0             ; Make: c2+3+(c1-1)
               movwf   main_c1         ; Save result of: c1=c2+3+(c1-1)
; Expression: incPortA(c2,c1);
               movf    main_c2,0
               mowf    main_a
               movf    main_c1,0
               mowf    main_b
               call    incPortA                ; Make function call: incPortA(c
2,c1)
_endPrg         goto    _endPrg         ; End Function definition: main


If there is someone interested at this program, please contact me. It's free.
Thank's for your time.



===================================================
Alboni Giorgio
Faenza (Ra) ITALY
E-Mail: spam_OUTrac1337TakeThisOuTspamracine.ravenna.it

www.geocities.com/SiliconValley/Heights/5444
(Last Update: 29/09/97)
===================================================

1998\01\22@163713 by Harold Hallikainen

picon face
On Thu, 22 Jan 1998 18:02:20 +0100 Giorgio Alboni
<.....rac1337KILLspamspam@spam@PROVINCIA.RA.IT> writes:
>I'm writing a C compiler fo microchip 16C84. The output is a full
>commented
>MPLAB assembler file. I just made the parser and a part of compiler.
>Give a look at this code (c -> asm) and tell me what do you think.


       That looks pretty neat!  The case where you're setting a variable
to zero could be a special case.  Instead of using movlw 0, movwf
variable, you could just do clrf variable.  Also, where is the variable
memory allocation being done?  In writing asm code, I tend to do it
inside the subroutine using cbank and endc.  If no address is given for
the cbank, it uses the next available address.  Then there's the issue of
ram re-use.  I generally haven't dealt with it, but local automatic
variables could be released from ram on exit of the subroutine (easy with
a stack... but we don't have one unless you want to build one using FSR).
       I'd like to see the compiler.  Is it available on the web?  If
not, you can email it to me at haroldspamKILLspamhallikainen.com  .

Thanks!

Harold

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\01\23@090643 by Giorgio Alboni

flavicon
face
At 16.35 22/01/98 EST, you wrote:
>
>On Thu, 22 Jan 1998 18:02:20 +0100 Giorgio Alboni
><.....rac1337KILLspamspam.....PROVINCIA.RA.IT> writes:
>>I'm writing a C compiler fo microchip 16C84. The output is a full
>>commented
>>MPLAB assembler file. I just made the parser and a part of compiler.
>>Give a look at this code (c -> asm) and tell me what do you think.
>
>
>       That looks pretty neat!  The case where you're setting a variable
>to zero could be a special case.  Instead of using movlw 0, movwf
>variable, you could just do clrf variable.

This can be made in a optimization fase.

>  Also, where is the variable
>memory allocation being done?  In writing asm code, I tend to do it
>inside the subroutine using cbank and endc.  If no address is given for
>the cbank, it uses the next available address.

Your right, I don't now how but in my letter I forget the begin of asm
file, it's:

LIST   P=PIC16C84
       include <p16c84.inc>
       include "16Cxx.h"

CBLOCK  0x0C
               incPortA_b
               incPortA_a
               main_c2
               main_c1
               __CCTemp1
               main_c2
               main_c1
               PORTB
               PORTA
ENDC
               ORG     0
               goto    main
               nop
               nop
               nop
               goto    interrupt


> Then there's the issue of
>ram re-use.  I generally haven't dealt with it, but local automatic
>variables could be released from ram on exit of the subroutine (easy with
>a stack... but we don't have one unless you want to build one using FSR).

This is a big problem. I think that PIc have a lot of ram location. I want
to make a C compiler thats help in writing asm code. The pic programmer
must know what the C compiler do so he can write a simple mix of C and asm
code (with asm {} primitive).
The pics are too small for support a run time C support and in the most
case it's no necessary.

>       I'd like to see the compiler.  Is it available on the web?  If
>not, you can email it to me at EraseMEharoldspam_OUTspamTakeThisOuThallikainen.com  .
>

For now no, in the next day (i think 26-1).
Bye.
Giorgio Alboni.


===================================================
Alboni Giorgio
Faenza (Ra) ITALY
E-Mail: rac1337spamspam_OUTracine.ravenna.it

www.geocities.com/SiliconValley/Heights/5444
(Last Update: 29/09/97)
===================================================

1998\01\27@033735 by Giorgio Alboni

flavicon
face
The C compiler is now avalible on the web at:

http://www.geocities.com/SiliconValley/Heights/5444/Compiler.zip

Please try it and tell me something. Any suggestion is welcome.
bye.


===================================================
Alboni Giorgio
Faenza (Ra) ITALY
E-Mail: @spam@rac1337KILLspamspamracine.ravenna.it

www.geocities.com/SiliconValley/Heights/5444
(Last Update: 29/09/97)
===================================================

1998\01\28@103841 by Jack Raats

flavicon
face
Giorgio Alboni wrote in a message to All:

GA> The C compiler is now avalible on the web at:

GA> http://www.geocities.com/SiliconValley/Heights/5444/Compiler.zip

GA> Please try it and tell me something. Any suggestion is welcome.
GA> bye.

Thee archive olny contains the classes. Is it possible to compile it to an
executable and include it in the archive?

With greetings ... Jack Raats

1998\01\28@111055 by Martin R. Green

flavicon
face
Jack, this is a Java application.  You can run it from your browser by
loading Compile.html into the browser.  The classes will be loaded as
needed.  I haven't actually tried the compiler yet, but I noticed all
the classes too, then I remebered Giorgio's earliest messages stated
he was developing this in Java.

CIAO - Martin.

On Wed, 28 Jan 1998 13:46:00 +0100, Jack Raats
<KILLspamjackKILLspamspamJARASOFT.XS4ALL.NL> wrote:

{Quote hidden}

Martin R. Green
RemoveMEelimarTakeThisOuTspamNOSPAMbigfoot.com

To reply, remove the NOSPAM from the return address.
Stamp out SPAM everywhere!!!

1998\01\28@204740 by PHILIP RESTUCCIA

flavicon
face
> >Giorgio Alboni wrote in a message to All:
> >
> > GA> The C compiler is now avalible on the web at:
> >
> > GA> www.geocities.com/SiliconValley/Heights/5444/Compiler.zip
> >
> > GA> Please try it and tell me something. Any suggestion is welcome.
> > GA> bye.
> >

I tried running this (unfortunately, I'm not at all familiar with
running Java
apps) ... I unzipped it into its own directory and then double-clicked
on the
Compiler.html file.  Netscape started up and loaded some files, said
"Starting Java..."
in the status line, then I get the message:
"Applet Compiler can't start: error: java.lang.ClassFormatError: Class
already loaded"
also in the status line.  What am I doing wrong?

Thanks in advance for any insight.

       Philip Restuccia

1998\01\28@212656 by Martin Darwin

flavicon
face
At 11:50 AM 1/28/98 -0500, you wrote:
{Quote hidden}

Nothing. Netscape (4.04) can't run it for some reason. If the author used
Java 1.1 to write his applet Netscape can't perfectly handle it yet. I ran
it sucsessfully using appletviewer (you need to download it from
java.sun.com - it is included in the JDK)

MD

--
Martin Darwin    a.k.a Rambo [CtF]  -- Play QUAKE!!
spamBeGonemartinspamBeGonespamdavin.ottawa.on.ca       -  4th year Computer Engineering
http://www.davin.ottawa.on.ca/~martin  University of Ottawa
Clan CtF - http://ctf.clanworld.com

1998\01\28@214308 by Peter Shoebridge

flavicon
face
Works perfectly well under IE4.01


-----Original Message-----
From: Martin Darwin <TakeThisOuTmartinEraseMEspamspam_OUTDAVIN.OTTAWA.ON.CA>
To: RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU <PICLISTEraseMEspam.....MITVMA.MIT.EDU>
Date: Wednesday, January 28, 1998 7:35 PM
Subject: Re: C compiler in java


{Quote hidden}

1998\01\28@223552 by Herbert Graf

picon face
> -----Original Message-----
> From: pic microcontroller discussion list
> [RemoveMEPICLISTEraseMEspamEraseMEMITVMA.MIT.EDU]On Behalf Of Peter Shoebridge
> Sent: January 28, 1998 21:32
> To: RemoveMEPICLISTspam_OUTspamKILLspamMITVMA.MIT.EDU
> Subject: Re: C compiler in java
>
>
> Works perfectly well under IE4.01

       Here to with the same, except of course file operations don't work. For
that you have to download the Java from SUN. TTYL

1998\01\29@031536 by Alboni Giorgio

flavicon
face
At 11:50 AM 1/28/98 -0500, you wrote:
>I tried running this (unfortunately, I'm not at all familiar with
>running Java
>apps) ... I unzipped it into its own directory and then double-clicked
>on the
>Compiler.html file.  Netscape started up and loaded some files, said
>"Starting Java..."
>in the status line, then I get the message:
>"Applet Compiler can't start: error: java.lang.ClassFormatError: Class
>already loaded"
>also in the status line.  What am I doing wrong?
>
>Thanks in advance for any insight.
>
>        Philip Restuccia

I tested the compiler under IE 4.0 , appletviewer and java (run time
application). Some friends of my tell me that Netscape 4.04 can run Java 1.1 .
Now I can think that is no true. I suggest to use the compiler with Sun
java run time module. With this program the compiler cand read and write file.
Use cut and paste function to import and esport program from compiler
running under IE 4.0.
To all: What do you think of C Compiler????
Bye.


===================================================
Alboni Giorgio
Faenza (Ra) ITALY
E-Mail: RemoveMErac1337TakeThisOuTspamspamracine.ravenna.it

www.geocities.com/SiliconValley/Heights/5444
(Last Update: 19/06/97)
===================================================

1998\01\29@052639 by Clyde Smith-Stubbs

flavicon
face
On Wed, Jan 28, 1998 at 10:26:45PM -0500, Herbert Graf wrote:
>         Here to with the same, except of course file operations don't work.
For
> that you have to download the Java from SUN. TTYL

Actually, you only need the JRE (Java Runtime Environment) not the whole
JDK. The JRE 1.1.4 is about 2.5MB as a download.

--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: EraseMEclydespamspamspamBeGonehtsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger RemoveMEclydeKILLspamspamhtsoft.com   | AUS: +61 7 3354 2411 +61 7 3354 2422
---------------------------------------------------------------------------
ANSI C for the PIC! Now shipping! See http://www.htsoft.com for more info.

1998\01\29@070236 by Alboni Giorgio

flavicon
face
Can someone send me a C program for PIC?
I'd like to extend my C compiler to a standard PIC C so I need some example
for implement all the grammar production.
For example: wich is the instruction for bit manipolation? EX. PORTA[2]=1;
for implement:  bsf PORTA,2
Thanks.


===================================================
Alboni Giorgio
Faenza (Ra) ITALY
E-Mail: rac1337STOPspamspamspam_OUTracine.ravenna.it

www.geocities.com/SiliconValley/Heights/5444
===================================================

1998\01\29@074029 by Walter Banks

picon face
----------
> From: Alboni Giorgio <spamBeGonerac1337STOPspamspamEraseMERACINE.RA.IT>
> To: KILLspamPICLISTspamBeGonespamMITVMA.MIT.EDU
> Subject: C compiler in java
> Date: Thursday, January 29, 1998 6:46 AM
>
> Can someone send me a C program for PIC?
> I'd like to extend my C compiler to a standard PIC C so I need some
example
> for implement all the grammar production.
> For example: wich is the instruction for bit manipolation? EX.
PORTA[2]=1;
> for implement:  bsf PORTA,2


all of the following will do a bsf PORTA.2 in MPC

#pragma portrw PORTA @ 1;
PORTA.2 = 1;                // This will set bit 2

PORTA = PORTA | 4;     // This will set bit 2



struct {
            int bit0 : 1;
            int bit1 : 1;
            int bit2 : 1;
            int bit3 : 1;
            int bit4 : 1;
            int bit5 : 1;
            int bit6 : 1;
            int bit7 : 1;
       } porta @ &PORTA;

porta.bit2 = 1;               // This will set bit 2


bit  porta2 = &PORTA,2;
porta2 = 1;                   // This will set bit 2


Walter Banks


'C compiler in java'
1998\02\02@092601 by Giorgio Alboni
flavicon
face
part 0 323 bytes


Attachment converted: wonderland:Compiler.java (TEXT/ttxt) (00011C3A)


===================================================
Alboni Giorgio
Faenza (Ra) ITALY
E-Mail: EraseMErac1337spamEraseMEracine.ravenna.it

www.geocities.com/SiliconValley/Heights/5444
(Last Update: 29/09/97)
===================================================

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