                             /terminator, pseudos

te,	test0 trm, s1
	sett sid, 1
	zero tc
	testel mm, 3u, te1
	zero tjp
	load mm
	tles 3u, te9
	complaint flexo mtl
	goto te1
te9,	complaint flexo mts

te1,	test0 rob, te0
	complaint flexo itg
	zero rob
	zero gi
	zero gis
	move nls, nl
te0,	load (600000
	call cn

teb,	call sbc
	putback bar, lmb
	grow nl, 1, lmb
	zero mm
	call rcw
	store mbh
	zero ao
	sett pfu, s1
	goto pue


pc,	zero tht
pcr,	zero ucl
	step1 tht
	tgrec npi, pcz
	load tht
	lookup pnm-1
	store zet
	call rrc

pc2,	call rch
	store chr
	trze pc3
	trnl (21, pc4
	zero chr
pc3,	sett ucl, 1
pc4,	load zet
	lookup 0
	trnl chr, pcr
	test1 ucl, pc9
	step1 zet
	goto pc2
pc9,	load tht
	dispatch pcd-1
                
                                
pcd,	pv1	pv2	pv3	pv4	pv5	pv6
	pv7	pv8	pv9	pva	pvb	pvc
	pvd	pve	pvf	pvg	pvh
pnm,	pn1	pn2	pn3	pn4	pn5	pn6
	pn7	pn8	pn9	pna	pnb	pnc
	pnd	pne	pnf	png	pnh

pn1,	22	0
pn2,	43	0
pn3,	65	0
pn4,	65	45	64	0
pn5,	62	61	22	22	0
pn6,	23	51	65	62	43	65
	0
pn7,	23	65	45	46	51	0
pn8,	61	43	23	46	0
pn9,	24	45	71	23	22	0
pna,	42	65	30	0
pnb,	51	65	22	23	0
pnc,	63	46	47	30	0
pnd,	24	47	0
pne,	64	46	26	45	0
pnf,	70	0
png,	50	0
pnh,	23	65	44	47	46	0

ps,	govia psw

pv1,	sett ss, 200000	/s
	goto psr
pv2,	sett ss, 400000	/l
	goto psr
pv3,	zero ss		/e
	goto psr
pvf,	sett ss, 40000	/h
	goto psr
pvg,	sett ss, 20000	/q
	goto psr

pv5,	sett st, 12	/bass
	goto psr
pv6,	sett st, 26	/treble
	goto psr
pv7,	sett st, 16	/tenor
	goto psr
pv8,	sett st, 20	/alto
	goto psr
                
                                
pv9,	sett ao, 1	/units
	sett psw, p9a
	goto te
p9a,	load n1
	store 1u
	x2to1
	addi n1
	x2to1
	store 3u
	sett irl, -1

psr,	zero ao
	goto te

pv4,	call sbc		/end
	putback bar, (600000
	feed 20
	step1 nl
	call ppp	/no. of notes
	zero t2
	zero t3
p41,	load t3
	lookup not
	store t1
	call ppp	/note entry
	step t2, t1
	step1 t3
	trnl nl, p41
	load t2
	call ppp	/+checksum
	feed 6
	step1 bc
	call ppp	/no. of bars
	zero t2
	zero t3
p42,	load t3
	complement
	lookup bar
	store t1
	call ppp	/bar entry
	step t2, t1
	step1 t3
	trnl bc, p42
	load t2
	call ppp	/+checksum
	feed 100
	goto u


pvh,	sett ao, 1	/tempo
	sett psw, pha
	goto te
pha,	load n1
	addi (700000
	call cn
	goto psr
                
                                
key,
pva,	call rch		/key
	trze pva
	ftrel (55, pum
	ftrel (57, pus
	trel (54, puf
	call rrc
	goto s1

pum,	sett pfu, s1
pun,	copy nt, kt, 44
pue,	copy kt, mt, 44
	govia pfu

pus,	sett pfu, put
	goto puh
puf,	sett pfu, pug
puh,	sett psw, pun
	sett ao, 1
	goto s1

put,	sett acc, 1
	sett aci, 4
	sett tne, 3
	goto puw
pug,	sett acc, -1
	sett aci, 3
	sett tne, 6

puw,	test0 n1, pw2
	move tne, ton

pw1,	load ton
	lookup nt
	addi acc
	store t4
	load ton
	putback kt, t4
	stepa ton, 7
	tlesc 44, pw1
	istepa n1, 1
	step tne, aci
	tlesc 7, puw
	istepa tne,7
	goto puw

pw2,	sett pfu, psr
	goto pue
                
                                
pvb,	sett ao, 1	/rest
	test0 mm, pb2
	error flexo ilr
	goto i1a

pb2,	sett psw, pb1
	goto te
pb1,	test0 n1, psr
	testp irl, pb3
	load 1u
	addi (100
	x2to1
	store t1
	call snl
	store irl
	putback not, t1
	call snl
	putback not, (600000
	grow nl, 1, lmb

pb3,	call sbc
	putback bar, irl
	istepa n1, 1
	trnz pb3
	goto psr

pvd,	sett ao, 1	/up
	sett psw, pd1
	goto te
pd1,	move n1, tll
	goto psr


pve,	sett ao, 1	/down
	sett psw,pe1
	goto te
pe1,	load n1
	trze pe2
	complement
pe2,	store tll
	goto psr
                
                                

pvc,	sett ao, 2	/copy
	test0 mm, cow
	error flexo ilc
i2a,	sett psw, i1a
	goto te
i1a,
co1,	sett psw, psr
	goto te

cow,	sett psw, co2
	goto te

co2,	law 1
	add n1
	sub bc1
	dac cbh
	trze co3
	tles tbc, co4
co3,	error flexo blc
	goto i1a
co4,	sett psw, co5
	goto te

co5,	law 1
	add n1
	sub bc1
	tgrel cbh, co7
co6,	error flexo brc
	goto psr

co7,	istepa cbh, 1
co8,	load cbh
	complement
	lookup bar
	store t4
	call sbc
	putback bar, t4
	step1 cbh
	sub n1
	add (-1
	add bc1
	spa
	jmp co8
	goto psr

start
                
                                                     

