C compiler

PM development, programming, hacking and all that fun stuff.
User avatar
YasaSheep
Posts: 205
Joined: November 20th, 2005, 04:04
Location: Portland (Also the discord)
Contact:

Re: C compiler

Post by YasaSheep »

Looks great! Seems like a pretty complex test too. :]
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

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 1143 times
User avatar
Agilo
PM.net Staff
Posts: 34
Joined: October 1st, 2008, 01:38
Location: The Netherlands
Contact:

Re: C compiler

Post by Agilo »

Very nice, Zoranc!
This will probably lower the threshold for people to starting deving on PM. :)
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

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 1149 times
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

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: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

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 1107 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

fixed bug in the inline assembler handling. now frame pointer is unwinded by the compiler.
Attachments
vbccpm_0008.zip
(288.02 KiB) Downloaded 1101 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

added interrupt support with a small demo how to use it.
Attachments
vbccpm_0009.zip
(289.14 KiB) Downloaded 1139 times
Lupin
Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Re: C compiler

Post by Lupin »

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: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: C compiler

Post by zoranc »

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.
Post Reply