English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 21 November 2017, 20:50   #41
steve_mynott
Registered User
 
Join Date: Jul 2014
Location: london
Posts: 37
Quote:
Originally Posted by mark_k View Post
In makefile is this line:

.b.obj:; bcpl $*.b $*.obj opt '"%$$AMIDOS,$$AMIGA,$(BOPTS)"' obj A

Is the % symbol a typo? Also do the $$ get changed by make when invoking bcpl? (E.g. changing $$ to $ maybe??? Obviously I'm not an expert on this.)
I suspect the % does something although I'm not sure what!

A guess might be that "%" is something like the -D option to C?

Yes the doubled up $$ are basically escaped so they are passed to the UNIX shell by make correctly as a single $.

When I type "make" on a UNIX-type system I see something like

Code:
start.b start.obj opt '"%$AMIDOS,$AMIGA,$JUMPS,$MACRO,$EXT,$WORD,w30000"' obj A
So the $(BOPTS) gets evaluated out. The BCPL itself often uses $$ as well I notice.

I suspect the $AMIGA is used in the conditionals inside the BCPL which are like "$<AMIGA" (similar to C preprocessor?)

I've had a look online and can't find any docs.

There is a MMC QL BCPL kit (which might have full docs) on EBay but I was outbid!
steve_mynott is offline  
Old 21 November 2017, 23:28   #42
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,966
There's a PDF of the QL BCPL manual mentioned above. The book "BCPL: The Language and its Compiler" could perhaps contain some info, though of course it wouldn't be specific to the Metacomco compiler.
mark_k is offline  
Old 21 November 2017, 23:59   #43
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,966
It could be that % was a typo; it's Shift-5 for % vs Shift-4 for $ on the keyboard, and the corresponding UNIX opt line doesn't have a % in.

I don't know whether removing the % will make any difference, but I might try building the Amiga executable in NetBSD without it.

The BCPL manual has a section on conditional compilation on page 13 (p.21 of the PDF).
mark_k is offline  
Old 22 November 2017, 18:50   #44
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 51
Posts: 503
Thinking of ancient Unix variants and their shells; the %$AMIDOS part is probably an environment variable, maybe it's supposed to point to sys:c on Amiga? Just a thought...
modrobert is offline  
Old 22 November 2017, 19:31   #45
Locutus
Registered User

 
Join Date: Jul 2014
Location: Finland
Posts: 872
I cant imagine that the % has anything to do with the UNIX world side of things, in ancient UNIX shells the % was used as a indicator for job numbers.

Providing as a opt the job number stored in a variable (i'm not even sure bsh/csh/sh from back then would evaluate that) as an argument sounds extremely unlikely.

Also seeing its escaped in the make output i'm pretty sure its passed verbatim to the BCPL side and probably only evaluated and expanded there by a preprocessor or the compiler. I do think the hunch that its some directives and/or variables for that.
Locutus is online now  
Old 07 January 2018, 14:50   #46
asymetrix
Registered User

 
Join Date: Jul 2009
Location: UK
Posts: 93
Is BCPL useful today ? In this non Amiga post they chat about using a tiny FORTH program to 'bootstrap' other software. https://github.com/Fedjmike/mini-c/issues/2
asymetrix is offline  
Old 07 January 2018, 16:41   #47
Locutus
Registered User

 
Join Date: Jul 2014
Location: Finland
Posts: 872
There's not really any 'modern use' of BCPL, Forth has some extreme niche uses as its one of the simplest languages you can imagine to implement a interpreter for and thats why its mentioned in that discussion.
Locutus is online now  
Old 07 January 2018, 19:07   #48
nogginthenog
Amigan

 
Join Date: Feb 2012
Location: London
Posts: 677
The obvious use would be to compile the TripOS bits of AmigaOS when it is eventually open sourced
(assuming there's any left in OS3.x)
nogginthenog is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to write native code? arodgers support.FS-UAE 4 02 September 2016 20:53
FS-UAE Native Code? jdog320 support.FS-UAE 2 26 July 2016 12:03
amiga c/c++ compiler Fissuras request.Apps 41 18 June 2012 21:50
native x86 code in WinUAE? Falk support.WinUAE 15 14 June 2008 13:58
Best C Compiler for Amiga is? Pyromania Amiga scene 5 14 May 2002 18:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07175 seconds with 16 queries