Page 2 of 2

Re: Digital C SE Foibles on QPC2

Posted: Thu Mar 26, 2020 3:24 pm
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.

Re: Digital C SE Foibles on QPC2

Posted: Tue Apr 07, 2020 4:21 pm
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.

Re: Digital C SE Foibles on QPC2

Posted: Tue Apr 07, 2020 4:29 pm
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?

Re: Digital C SE Foibles on QPC2

Posted: Wed Apr 08, 2020 7:07 am
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

Re: Digital C SE Foibles on QPC2

Posted: Wed Apr 08, 2020 8:23 pm
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.

Re: Digital C SE Foibles on QPC2

Posted: Wed Apr 08, 2020 9:33 pm
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.

Re: Digital C SE Foibles on QPC2

Posted: Wed Apr 08, 2020 10:11 pm
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

Re: Digital C SE Foibles on QPC2

Posted: Thu Aug 20, 2020 5:57 pm
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.