C Compiler and % in filenames

Discuss all aspects of programming here. From 8-bit through to modern architectures.
Coeus
Posts: 552
Joined: Mon Jul 25, 2016 11:05 am

C Compiler and % in filenames

Postby Coeus » Tue Jan 02, 2018 9:14 pm

With mdfs.net now back I noticed a section on C compilers and thought I'd have at look at the possibilities.

The choice seemed to be between cc65 and Small-C. cc65 seemed to have broken links or a page saying it is no maintained so I had a look at Small-C. In the build instructions it mentioned % in filenames. Anyone know what this represents? There is no mention of this in the ADFS user guide that I can see. Is it NFS-related or something that arrived with RiscOS?

Also, who else has experimented with small C compilers? What did you find to be the best?

User avatar
BigEd
Posts: 1549
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: C Compiler and % in filenames

Postby BigEd » Tue Jan 02, 2018 10:15 pm

cc65 is still actively developed - the link on mdfs.net is to the previous maintainer's notice of quitting. See here instead:
https://github.com/cc65/cc65

Another collection of pointers can be found here:
http://6502.org/tools/lang/

User avatar
BigEd
Posts: 1549
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: C Compiler and % in filenames

Postby BigEd » Tue Jan 02, 2018 10:17 pm

(See also this thread and this one.)

User avatar
jgharston
Posts: 2834
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: C Compiler and % in filenames

Postby jgharston » Wed Jan 03, 2018 8:08 am

Coeus wrote:With mdfs.net now back I noticed a section on C compilers and thought I'd have at look at the possibilities.
The choice seemed to be between cc65 and Small-C. cc65 seemed to have broken links or a page saying it is no maintained so I had a look at Small-C. In the build instructions it mentioned % in filenames.

where?

Coeus wrote:Anyone know what this represents?

% means LIB = the currently-select library, just as $ means root, @ means CSD = currently selected directory, ^ means up = parent directory and & means URD = user root directory.

Some versions of ADFS do not implement it, and with DFS you can "fake" it by using *LIB %.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Coeus
Posts: 552
Joined: Mon Jul 25, 2016 11:05 am

Re: C Compiler and % in filenames

Postby Coeus » Wed Jan 03, 2018 11:06 am

BigEd wrote:(See also this thread and this one.)


Thanks, that's very helpful.

Coeus
Posts: 552
Joined: Mon Jul 25, 2016 11:05 am

Re: C Compiler and % in filenames

Postby Coeus » Wed Jan 03, 2018 11:32 am

jgharston wrote:
Coeus wrote:......In the build instructions it mentioned % in filenames.

where?

Sorry, not in the those instructions but embedded in the local.h file where it says:

Code: Select all

/* tcc commands */
/* Suggested value:
 * DFS:
 *   TCPP   "tcpp"
 *   TCCOM   "tccom"
 *   TCCOMC   "tccom -C"
 *   AS65   "as65 -o"
 *   RM   "rm -f"
 *   LD   "ld -o"
 *   SWLD   "ld -R -o"
 * If "%" is available:
 *   TCPP   "%.CLib.tcpp"
 *   TCCOM   "%.CLib.tccom"
 *   TCCOMC   "%.CLib.tccom -C"
 *   AS65   "%.CLib.as65 -o"
 *   RM   "%.CLib.rm -f"
 *   LD   "%.CLib.ld -o"
 *   SWLD   "%.CLib.ld -R -o"
 * If "%" is not available
 *   TCPP   ":<drive>.Library.CLib.tcpp"
 *   TCCOM   ":<drive>.Library.CLib.tccom"
 *   TCCOMC   ":<drive>.Library.CLib.tccom -C"
 *   AS65   ":<drive>.Library.CLib.as65 -o"
 *   RM   ":<drive>.Library.CLib.rm -f"
 *   LD   ":<drive>.Library.CLib.ld -o"
 *   SWLD   ":<drive>.Library.CLib.ld -R -o"
 */


jgharston wrote:% means LIB = the currently-select library, just as $ means root, @ means CSD = currently selected directory, ^ means up = parent directory and & means URD = user root directory.


Thanks. That's what I would have guessed at from the context in that local.h file but great to hear from an expert,

jgharston wrote:Some versions of ADFS do not implement it, and with DFS you can "fake" it by using *LIB %


I admit I did not try it for real on ADFS on the BBC. & looks like it comes from NFS and is accepted by ADFS for compatibility.

Some versions of ADFS do not implement it, and with DFS you can "fake" it by using *LIB %.[/quote]

BTW, I also struggled with getting the ADFS ZIP file for v072 to install with the correct load an exec addresses. The setup I was using was a B-Em on Linux with Virtual DFS so unpacking on either the Linux host of the BBC guest could work in theory with the right tool. In practice the Linux (InfoZIP) version of unzip does not seem to have a way of creating the .inf files from the Acorn attributes and the archivers I tried running within the BBC don't seem to cope with compressed ZIP files. I even looked at running ZipToInf even if that meant running just that bit in a Windows VM but the links I tried to that are broken.

So, links that are broken or don't go somewhere useful....

On C compilers:On http://mdfs.net/Apps/Archivers/ the links to ZiptoInf in "Files" column of the table - each gives document not found. I have since discovered that ZipToInf in the title column goes to a page from which the files can be downloaded.

On the subject of ZipToInf, as what appears to be a command-line tool, might this be easy to compile on/port to Linux? Would you be prepared to release the source to enable that, please? Also, what's the .bin version?

User avatar
jgharston
Posts: 2834
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: C Compiler and % in filenames

Postby jgharston » Thu Jan 04, 2018 11:13 pm

Coeus wrote:* If "%" is available:
Ah, other files say things like "If the % path is available pointing to the current library"

Coeus wrote:BTW, I also struggled with getting the ADFS ZIP file for v072 to install with the correct load an exec addresses. The setup I was using was a B-Em on Linux with Virtual DFS so unpacking on either the Linux host of the BBC guest could work in theory with the right tool. In practice the Linux (InfoZIP) version of unzip does not seem to have a way of creating the .inf files from the Acorn attributes and the archivers I tried running within the BBC don't seem to cope with compressed ZIP files.
At the moment, the only compressed unzipper for the BBC/Master platform is DSUnZip which can't cope with subdirectories. I had thought that I'd zipped up the Small-C archives as uncompressed archives as they are targetted at the Beeb, though you can unzip them on RISC OS and then copy them over.

Coeus wrote:I even looked at running ZipToInf even if that meant running just that bit in a Windows VM but the links I tried to that are broken.
I've just checked and everything's there. Maybe something transient from mdfs.net being offline over the weekend. I'll rewind my site-update program a couple of weeks and re-refresh the files.

Coeus wrote:On the subject of ZipToInf, as what appears to be a command-line tool, might this be easy to compile on/port to Linux? Would you be prepared to release the source to enable that, please?
The source is there where you got it from. If you have BBC BASIC for Linux you can create a native executable, or you can use WinE to provide the Windows API on i86 Linux. I checked it on Puppy Linux + WinE a few years ago and it worked ok.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Coeus
Posts: 552
Joined: Mon Jul 25, 2016 11:05 am

Re: C Compiler and % in filenames

Postby Coeus » Fri Jan 05, 2018 11:42 am

jgharston wrote:The source is there where you got it from. If you have BBC BASIC for Linux you can create a native executable, or you can use WinE to provide the Windows API on i86 Linux. I checked it on Puppy Linux + WinE a few years ago and it worked ok.


Thanks. When I saw the .exe file it didn't occur to me that the source would be in BBC BASIC.

User avatar
jgharston
Posts: 2834
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: C Compiler and % in filenames

Postby jgharston » Sat Jan 06, 2018 12:09 pm

Ah, the index pages usually say, eg:

Code: Select all

PDPTube.zip   51K  RISC OS App
PDP11Em       52K  BBC BASIC
PDP11Em.bbc   52K  BBFW
PDP11Em.exe  148K  Windows binary
PDPTubeDoc    48K  Documentation

I'll make a note to tidy them up a bit.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_


Return to “programming”

Who is online

Users browsing this forum: No registered users and 1 guest