C compiler

PM development, programming, hacking and all that fun stuff.
Wa
Posts: 165
Joined: November 20th, 2005, 04:04
Location: New York (Also #pmdev)
Contact:

Re: C compiler

Postby Wa » May 23rd, 2011, 06:31

Looks great! Seems like a pretty complex test too. :]

zoranc
Posts: 178
Joined: August 13th, 2010, 18:13

Re: C compiler

Postby zoranc » May 24th, 2011, 18:43

The very first pre-pre alpha version (V0.004) is here for your viewing pleasure. There are many things missing (take a look at the TODO.txt) and most likely there are many bugs too. I believe there are no viruses inside, but to be sure please check it yourself. ;)

Enjoy! :D
Attachments
vbccpm_0004.zip
Version 0.004 of the vbccpm C compiler
(287.28 KiB) Downloaded 107 times

User avatar
Agilo
PM.net Staff
Posts: 32
Joined: October 1st, 2008, 01:38
Location: The Netherlands
Contact:

Re: C compiler

Postby Agilo » May 24th, 2011, 21:15

Very nice, Zoranc!
This will probably lower the threshold for people to starting deving on PM. :)

zoranc
Posts: 178
Joined: August 13th, 2010, 18:13

Re: C compiler

Postby zoranc » May 25th, 2011, 01:19

I hope so, Agilo, I hope so. Such a nice device deserves bigger audience.

Thanks to Lupin we got now div/mod and slightly improved mul routines. One Item from the TO-DO list is removed. ;-)

As before no guaranties, hope you like it... etc. etc. Ver. 0.006 of the vbccpm C compiler freshly baked and served. :D
Attachments
vbccpm_0006.zip
Version 0.006 of the vbccpm C compiler
(287.99 KiB) Downloaded 107 times

Lupin
Team Pokémé
Posts: 93
Joined: January 10th, 2005, 13:06

Re: C compiler

Postby Lupin » May 25th, 2011, 02:03

really nice progress... First thing on my personal wishlist is interrupt support and support for linking (vasm and vlink) to have external function libraries.

zoranc
Posts: 178
Joined: August 13th, 2010, 18:13

Re: C compiler

Postby zoranc » May 25th, 2011, 04:45

inline assembly supported now. look at the demo inside for an example how to do it.

interrupts should be rather easy i'd be able to do it in a few hours, but now i'm dead tired.

vasm/vlink that's another story any volunteers for that one?

@lupin: i hope you are motivated enough to finish my carts, thought soldering and testing is probably less fun than writing libraries in C.
Attachments
vbccpm_0007.zip
(287.86 KiB) Downloaded 96 times

zoranc
Posts: 178
Joined: August 13th, 2010, 18:13

Re: C compiler

Postby zoranc » May 25th, 2011, 21:44

fixed bug in the inline assembler handling. now frame pointer is unwinded by the compiler.
Attachments
vbccpm_0008.zip
(288.02 KiB) Downloaded 105 times

zoranc
Posts: 178
Joined: August 13th, 2010, 18:13

Re: C compiler

Postby zoranc » May 26th, 2011, 04:03

added interrupt support with a small demo how to use it.
Attachments
vbccpm_0009.zip
(289.14 KiB) Downloaded 119 times

Lupin
Team Pokémé
Posts: 93
Joined: January 10th, 2005, 13:06

Re: C compiler

Postby Lupin » May 26th, 2011, 15:23

Hey zoranc,

Code: Select all

// Comment does not work
/* Comment does work */

Will you add // comments?

Code: Select all

*((char *)(0x2029)) = 0x01;

compiles to:

Code: Select all

   mov   a,1
   mov   hl,8233
   mov   8233,a


... interesting, isn't it? :)

zoranc
Posts: 178
Joined: August 13th, 2010, 18:13

Re: C compiler

Postby zoranc » May 26th, 2011, 16:59

comments // you can use through partial iso1999 support (switch -c99).

concerning read/writes to non-local variables only way that works at the moment is access through a pointer stored in a local variable. for an example you can look into a demo.c file which is in the archive.

that is the "serious bug" about which i was talking yesterday, and it's on the very top of my TODO list but i have to rework the whole code generation infrastructure and is not so trivial. unfortunately i got too much away from my regular job, so i'll have to postpone this for a later time.


Return to “PM Development Forum”

Who is online

Users browsing this forum: No registered users and 1 guest

cron