#!/bin/sh


# d1	100	The system will be loaded to this track and on before
#		moving takes place
# d3	0	d3 = 0 means the the drum will contain the free area,
#		d3 = 1 that it will be on buffer disc.
# d4	0	1024 * d52 + d4 is used as the number of blocks on the
# d52	0	buffer disc. Only significant if d3 = 1.
# d5	39	1024 * d46 + d5 is used as the first free block. This
# d46	0	may be changed by init help.
# d9	0	First track of final help. Should only be changed for
#		debugging purpose.
# d11	38	Parameter track.
# d16	294	First track of core image.
# d17	3	by-value for standard paper tape reader.
# d18	512	by-value for HP-button inhibit.
# d19	960	Track group for core image.
# d21	34	First track of catalog (catalog always in group 960).
# d22	1	No. of 320-track drums. Drum disc has d22 = 30.
# d23	4	No. of catalog tracks.
# d32	1	d32 = 0 designates that a special work area is used.
#		If d32 = 1 the free area is used for working.
# d33	0	First track and number of tracks in the special work
# d34	0	area (in group d19). Only significant if d32 = 0.
# d35	0	Running kind of aux. programs. d35=0 drum/disk
# d36	0	Aux. programs reserved. d36=1 reserved from free
# d41	1	d41 = 1 designates that code for treating buffer media
#		will be included. d41 = 0 otherwise.
# d43	17	Help 3 alarm output unit + typewriter input. Is used
#		for all alarm messages and HP-entry run number.
# d44	17	Standard output unit + typewriter input. Is used for
#		normal output from aux. programs and most of HP-entry
#		message.
# d46	0	See d5.
# d50	960	Image group during loading. May be redefined according
#		to d19 in the Help 3 system used for loading.
# d52	0	See d4.
# d53	400	Block length on the buffer disc.
# d54	1	Tape station to which tape programs will be moved.

# Size of system	Buffer		Start
# Main			13		0
# exit			1		13
# binin			2		14
# binout		5		16
# start			1		21
# clear ...		6		22
# algol			4		28
# run			1		32
# d36=1
# edit			18
# move			8
# check ...		10
# slip			23
# print			19
# ga4			173

# Size of system	No buffer	Start
# Main			11		0
# exit			1		11
# binin			2		12
# binout		5		14
# start			1		19
# algol			4		20
# check ...		9		24
# clear ...		5		33
# 38 parameter track
# 39 catalog, 20 tracks
# d1=21d1
# d36=1
# run			1
# edit			15
# move			3
# slip			23
# print			18
# ga4			171

# Build a big GIER machine:

# Drumdisk
# Buffer disk, CDC 854, 2030 tracks of 600 cells
# Free on buffer disk
# ga4 on buffer disk

flx2a <"Main help (5) 8.08.68.flx" | tac | sed '0,/_s/{//d;}' | tac | \
	sed -e '/_iredefine/{ N; s/_s/d3=1,d4=1006,d5=0,d16=934,d19=961,d21=14,d22=30,d23=24,d32=0,d33=0,d34=960,d41=1,d52=1,d53=600/g }' >BUILDbig4.asc
flx2a <"inithelp (4) 13.01.69.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"exit (2) 7.06.68.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
echo "d36=1,d35=1" >>BUILDbig4.asc
flx2a <"binin (1) 22.07.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"binout, ... (2) 9.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"start (3) 21.09.70.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"algol (2) 8.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"check ... (12) 1.07.70.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"clear ... (10) 8.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"run (2) 10.08.67.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"edit (9) 8.07.70.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"move (5) 15.12.68.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"slip (4) 14.01.69.flx" | \
	tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
flx2a <"print ... (12) 23.01.69.flx" | tac | sed '0,/_s/{//d;}' | tac >>BUILDbig4.asc
echo "_e10" >>BUILDbig4.asc
# Build tape with track 0 and basichelp3
cat "basic track 0 20.08.67.flx" ../help3bin/basichelp3.flx > BUILDbig4.flx
sed 's/#061#...//g' BUILDbig4.asc |sed 's/#061.//g'|a2flx >> BUILDbig4.flx
#rm -f BUILDbig4.asc

