#!/bin/sh

# Build a version of Help-3 on a 3-drum machine without buffer.

flx2a <"Main help (5) 8.08.68.flx" | tac | sed '0,/_s/{//d;}' | tac | sed -e '/_iredefine/{ N; s/_s/d22=3,d41=0,d16=934/g }' >BUILDdrum3nobuf.asc
flx2a <"inithelp (4) 13.01.69.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"binin (1) 22.07.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"binout, ... (2) 9.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"check ... (12) 1.07.70.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"clear ... (10) 8.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"exit (2) 7.06.68.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"start (3) 21.09.70.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
echo "d36=1" >>BUILDdrum3nobuf.asc
flx2a <"slip (4) 14.01.69.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"algol (2) 8.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"edit (9) 8.07.70.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"move (5) 15.12.68.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"print ... (12) 23.01.69.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
flx2a <"run (2) 10.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDdrum3nobuf.asc
echo "_e10" >>BUILDdrum3nobuf.asc
# Build tape with track 0 and basichelp3
cat "basic track 0 20.08.67.flx" ../help3bin/basichelp3.flx > BUILDdrum3nobuf.flx
sed 's/#061#...//g' BUILDdrum3nobuf.asc |sed 's/#061.//g'|a2flx >> BUILDdrum3nobuf.flx
#rm -f BUILDdrum3nobuf.asc

