Digital C SE Foibles on QPC2

Anything QL Software or Programming Related.
User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Digital C SE Foibles on QPC2

Post by NormanDunbar »

And another one.

It seems that "fopen()" in Digital C returns a file descriptor, which is an int, not a FILE *. :( :o :? :x :cry: :evil: :!: :!: :!:
Where a file descriptor fd is mentioned, this is the value of the integer returned by fopen when the file is opened.
This will make porting a program from Digital C to some other C compiler somewhat difficult. Sigh.

I give up!


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Digital C SE Foibles on QPC2

Post by Derek_Stewart »

Hi

I had a look at Digital C SE, which is a Small C compiler, not quite a full C implementation an d is an integer compiler.

The SPC manual states that the Small C Hand book by JE Hendrix, can be downloaded from Dr Dobbs:

https://www.drdobbs.com/developer-netwo ... /184415519

Which is a CDROM or ISO file, the handbook is in digital format.

I could not get Digitial C SE to compile any of the examples on SMSQ/E v3.35 on QPC2 or SMSQmulator.

But using Qemulator v3.3 with Minerva v1.98, all the source code examples compiled as described in the manual.

I guess Digitial C is not a well written piece of software, I did not try it with the Minerva Second Screen enabled. Which would test if the software writer of Digitial C are using the correct QDOS Management Trap to find the System Variables. This was a constant fault with Digitial Precision software.

I will stick to C68, which is a better compiler and supports all QDOS/SMSQE versions.


Regards,

Derek
User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: Digital C SE Foibles on QPC2

Post by RalfR »

Derek_Stewart wrote:I guess Digitial C is not a well written piece of software,
In which language is it written? Wasn't Gerry Jackson not also involved in Turbo?


4E75 7000
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: Digital C SE Foibles on QPC2

Post by tcat »

Hi,

I have not used `DC' compiler on QL yet. I was once toying with `GST C' (integer compiler too) but not beyond examples. How do these two compare?

I regularly use `qdos-gcc' though on linux. There is also `EasyC' found on `QPTR COMPANION` disk, that I have not tried either.

Tomas


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Digital C SE Foibles on QPC2

Post by bwinkel67 »

I've had lots of experience with Digital 'C' SE. It has its flaws and isn't as efficient as it could be. It does support floating point but through libraries and not natively. I do own the Hendrix text "A Small C Compiler: Language, Usage, Theory, and Design" which covers Small C and even gives source code. I'm guessing Digital based their implementation on it.

I've been posting about Digital 'C' SE's idiosyncrasies while building ZXSimulator so you can read about it here more (the lat few recent posts):

viewtopic.php?f=3&t=3193&start=60

What's cool about Digital 'C' SE is that it works pretty seamlessly on an unexpanded QL, requiring no toolkits, no extra memory and no speed. So that's a pretty nice implementation.


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

Re: Digital C SE Foibles on QPC2

Post by Derek_Stewart »

RalfR wrote:
Derek_Stewart wrote:I guess Digitial C is not a well written piece of software,
In which language is it written? Wasn't Gerry Jackson not also involved in Turbo?
Hi,

Maybe I was incorrect in says it was not well written, I would say Digital C SE is compiled from the Small C sources. Which quite remarkable to get a C compiler running on a basic QL with only micro drive storage.

If we had the source code, it could be recompiled on modern QL systems. But running under Minerva is still quite good.

I will see if it works with the second screen enabled.

I can not seem to get it running on SMSQ/E.


Regards,

Derek
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Digital C SE Foibles on QPC2

Post by swensont »

Digital C was based on the Small-C that Gerry Jackson did. There is very little difference between the two compilers. I used Small-C for a number of years and the that code compiles fine with Digital C.

QC is also Small-C based, but there are some differences between QC and Digital C, but porting from one to the other is fairly simple. I think in an early issue of SMSQzine I talked about both compilers. They are both good for getting your feet wet in the C world. Then one could later move up to C68 when needed.

Tim


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

Re: Digital C SE Foibles on QPC2

Post by Derek_Stewart »

Hi,

I just noticed that the sourcd codd to Digitial C SE is available for download on QL Homepage, in the C section: dcsource.zip

The readme.html file is quite interesting.


Regards,

Derek
Post Reply