[comp.sys.amiga.tech] Shells that handle BCPL

nordmark@nada.kth.se (Arne Nordmark) (03/31/89)

[Ah, shell writing, that's my favourite food]

AmigaDOS definitely lacks reasonable functions for runnaing commands.

ARP's ASyncRun() is *real* close, but it is a bit buggy and can't
run BCPL programs. Apart from that, and the annoying fact that you
can't choose which IO (input or output) that it should close for you,
it is certainly the most IMPRESSIVE art-work I have seen for this
machine. (as is much of the other ARP stuff).

I have used ASyncRun() for a lot of stuff including popen(), and a shell.

But when 1.3 came along there was certain AmigaDOS commands that
you wanted to use, and that was impossible whith a shell based on
ARP, since it rejects the BCPL stuff.

I have been forced to write my own function, launch(), that do the things
I want, i.e. use arbitrary input and output files, use a new console-task,
pass my environment variables, run the 1.3 commands etc. etc.

Since it is modeled after ASyncRun(), it has many of it's features.
I owe the ARP poeple a lot.
The superb Lattice 5.02 developing environment has helped a lot too.

A have managed to run the 1.3 BCPL commands by putting some magic
values into the registers and *patching* the input file-handle.

The latter sounds a bit drastic, but it is the only way I have
succeded to pass the argument line to the BCPL programs since they
seem to read their arguments from their standard input.

Is this totally wrong?

Can anyone who have done this kind of stuff (Bill Hawes?, Andy?)
tell me the *preferred* way to run BCPL programs?

I also wonder if it is a FACT that all BCPL commands starts with
the code sequence:
	movea.l $164(A2),A4
(This is how ASyncRun determines if a program is written in BCPL)

If this is *classified* information, please reply by email. :-)

Thanks,

  -- Gunnar

SNAIL: Gunnar Nordmark          VOICE: (+46) 8 - 755 42 52
       Nora strand 5
       S-182 34 DANDERYD        EMAIL: gno@stacken.kth.se
       SWEDEN                          gno@SESTAK.BITNET

"Words, words, words."  William Shakespeare 
-- 
	Arne Nordmark		Tel: 08 - 790 71 57
	KTH/Mekanik
	100 44 STOCKHOLM	Email: nordmark@mech.kth.se