English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 21 November 2017, 19:50   #41
steve_mynott
Registered User
 
Join Date: Jul 2014
Location: london
Posts: 49
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, 22:28   #42
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,333
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, 22:59   #43
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,333
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, 17:50   #44
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 56
Posts: 775
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, 18:31   #45
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,175
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 offline  
Old 07 January 2018, 13:50   #46
asymetrix
Registered User
 
Join Date: Jul 2009
Location: UK
Posts: 112
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, 15:41   #47
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,175
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 offline  
Old 07 January 2018, 18:07   #48
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,309
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  
Old 16 December 2018, 19:41   #49
PurpleMelbourne
Banned
 
PurpleMelbourne's Avatar
 
Join Date: Dec 2018
Location: Australia
Age: 51
Posts: 99
So dragging up this old thread. I'm really curious to know how this went.

Has it been possible to compile, and port away from the original BCPL code?
PurpleMelbourne 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
native x86 code in WinUAE? Falk support.WinUAE 20 21 January 2023 18:30
Best way to write native code? arodgers support.FS-UAE 4 02 September 2016 19:53
FS-UAE Native Code? jdog320 support.FS-UAE 2 26 July 2016 11:03
amiga c/c++ compiler Fissuras request.Apps 41 18 June 2012 20:50
Best C Compiler for Amiga is? Pyromania Amiga scene 5 14 May 2002 17: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 10:14.

Top

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