Vbcc (C compiler) proof-of-concept

Anything QL Software or Programming Related.
Post Reply
User avatar
Marq
ROM Dongle
Posts: 28
Joined: Sun Jan 22, 2012 11:48 pm
Location: Helsinki, Finland
Contact:

Vbcc (C compiler) proof-of-concept

Post by Marq »

Hi,

I tried to find a working cross-compiler for my QL, but couldn't really find anything except a non-working GCC hack. GCC is so convoluted that I didn't want to spend the rest of my days porting it, but vbcc (http://www.compilers.de/vbcc.html) seemed to be a lot easier to tweak, and still a real optimizing modern compiler.

My findings can be found here: http://www.kameli.net/marq/?p=1251. To make a long story short, it works. My solution, done in a day or so, is full of kludges, but with a little more attention, plus QL-specificl libs and headers, it could definitely become a very useful tool. The current hack works enough for me, but I'd be glad if someone took the porting over, eventually even turning it into a real vbcc frontend.


User avatar
robheaton
Site Admin
Posts: 375
Joined: Fri Nov 19, 2010 5:50 pm
Location: Ormskirk, UK

Re: Vbcc (C compiler) proof-of-concept

Post by robheaton »

Nice work there Marq!
Hopefully I'll get some free time during the next week and I'll try out your compiler!

Looks good though!


--
If vanpeebles parps in the woods and there is nobody around, does it make a sound?
RWAP
RWAP Master
Posts: 2837
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Vbcc (C compiler) proof-of-concept

Post by RWAP »

A Vbcc cross-compiler sounds interesting.

I guess the QDOS-GCC version was a one shot which did not get updated as Linux was improved over the years which is a shame - I wonder if Richard Zidlicky is still lurking somewhere out there...

The other option is surely to use C68 running on a QL emulator, so you only need get the source files across - I guess people prefer the development tools on a Linux or Windows platform nowadays, rather than just using a text editor on a QL ;)


User avatar
Marq
ROM Dongle
Posts: 28
Joined: Sun Jan 22, 2012 11:48 pm
Location: Helsinki, Finland
Contact:

Re: Vbcc (C compiler) proof-of-concept

Post by Marq »

RWAP wrote: The other option is surely to use C68 running on a QL emulator, so you only need get the source files across - I guess people prefer the development tools on a Linux or Windows platform nowadays, rather than just using a text editor on a QL ;)
I have to admit that cross-compiling is productive. Being a Linux user, I've yet to find a good emulator, so my setup consists of a cross-compiler, Arduino, and self-built transfer software for the host, Arduino and the QL. Normal serial transfer should be fine otherwise, but on my configuration it seems really unreliable. Tips on working Linux emus would be most welcome - the old sources I've found can't even be compiled.


RWAP
RWAP Master
Posts: 2837
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Vbcc (C compiler) proof-of-concept

Post by RWAP »

I can't say that I have any experience of using emulators under Linux - I guess it is one of the problems which face any programs released for Linux - basically the authors tend to release them on the GPL license, complete with sources, and then lose interest, leaving it up to someone else to try and pick up the pieces and understand (a) the code and (b) why it doesn't compile on later versions of Linux.

That is why I support commercial software moreso than free software - especially Q-emuLator (for Mac and Windows) and QPC2.

As for serial communication with the QL - this tends to be unreliable at anything more than 4800 baud unless you exchange the 8040 processor for a SuperHERMES which has high speed serial ports.


User avatar
ppe
Trump Card
Posts: 171
Joined: Tue Dec 14, 2010 10:48 am
Location: Espoo, Finland

Re: Vbcc (C compiler) proof-of-concept

Post by ppe »

Whee, another QLer from Finland, I thought I was the only one left :) Great job with the cross compiler!


User avatar
Marq
ROM Dongle
Posts: 28
Joined: Sun Jan 22, 2012 11:48 pm
Location: Helsinki, Finland
Contact:

Re: Vbcc (C compiler) proof-of-concept

Post by Marq »

ppe wrote:Whee, another QLer from Finland, I thought I was the only one left :) Great job with the cross compiler!
Heh, I'm more of a newbie, but I know a couple of other Finnish guys who have a QL, too, and who might even do something with it.


Derek_Stewart
Font of All Knowledge
Posts: 3957
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Vbcc (C compiler) proof-of-concept

Post by Derek_Stewart »

Hi,

Just looking to revive this thread.

I was reading up about VBCC, and did realise that VASM and VLINK are part of the same package.

VASM and VLINK have been updated to have the QL as a target, as part of the FreePascal project.

Would a VBCC output feed straight into the VASM_QL ?


Regards,

Derek
Post Reply