           
harmony compiler phase 1_ 7/22/63

/Form A-31276490732-3b/21a

0/

	define	load A	lac A	termin

	define	store A	dac A	termin

	define	addi A	add A	termin

	define goto T	jmp T	termin

	define	govia P	jmp i P	termin

	define	subt A	sub A	termin

	define	zero A	dzm A	termin

	define	step1 J	idx J	termin

	define	call S	jda S	termin

	define	band U	and U	termin

	define	halt	hlt	termin

	define	clear	cla	termin

	define	comple	cma	termin

	define	halve	sar 1s	termin

	define	x2to1	ral 1s	termin

	define	x2to6	ral 6s	termin

	define	x2to7	ral 7s	termin

	define	x2to3	ral 3s	termin

	define	exit P	jmp	termin

	define	move A,B	lac A	dac B	termin

	define	sett A,B	lac (B	dac A	termin

	define	trze T	sza i	jmp T	termin

	define	trnz T	sza	jmp T	termin

	define	trpl T	sma	jmp T	termin

	define	trmi T	spa	jmp T	termin

	define	trel A,T	sad A	jmp T	termin

	define	trnl A,T	sas A	jmp T	termin
                
                                
	define	write P	law P	jda wr	termin

	define	type Q	lio Q	tyo	termin

	define	ftrel A,T	trel A,T	termin

	define	compla U	lac (U	jda er	termin

	define	error U	lac (U	jda er1	termin

	define	lookup V
		add (V	dap .+1	lac	termin

	define	feed N	law i N	jda fee	termin

	define	step J, I
		lac J	add I	dac J	termin

	define	stepa J, I
		law I	add J	dac J	termin

	define	istepa J, K
		law i K	add J	dac J	termin

	define	grow A, V, C
		lac A	add (V	dac C	termin

	define	tles C, T
		sub C	spa	jmp T	termin

	define	tlesc C, T
		sub (C	spa	jmp T	termin

	define	tgrel C, T
		sub C	sma	jmp T	termin

	define	tgrec C, T
		sub (C	sma+sza-skp	jmp T	termin

	define	test0 Y, Z
		lac Y	sza i	jmp Z	termin

	define	test1 Y, Z
		lac Y	sza	jmp Z	termin

	define	testp Y, Z
		lac Y	sma	jmp Z	termin

	define	testm Y, Z
	lac Y	spa	jmp Z	termin
                
                                
	define	testel Y, Z, A
		lac Y	sad Z	jmp A	termin

	define	testnl Y, Z, A
		lac Y	sas Z	jmp A	termin

	define	halfof V
		lac V	sar 1s	dac V	termin

	define	double Q
		lac Q	ral 1s	dac Q	termin

	define	dispat U
		add (U	dap .+1	jmp i	termin

	define	diswit L, U
		add (U	dap .+2	lac L	jmp i	termin

	define	putback U, Q
		add (U	dap .+2	lac Q	dac	termin

	define	answer X
		0	dap X	lac .-2	termin

	define	x10dec
		ral 1s	dac t1	ral 2s	add t1	termin

	define	copy H, I, N
		law H	dap .+3	law I	dap .+2
		lac	dac	idx .-2	idx .-2
		sas (dac I+N	jmp .-5	termin

	define	search W, N, ERR
		dac t1	law W	dap .+2	lac t1
		sad	jmp .+5	idx .-2	sas (sad W+N
		jmp .-5	jmp ERR	lac .-6	add (-sad-W
		termin

	define	print F
		lac F
		repeat 3	rcl 6s	tyo
		termin
                
                                / wr, rp, fee, ppp, rpr

wr,	0
	dap wre
wr1,	print i wre
	idx wre
	sas wr
	jmp wr1
wrx,	jmp i wre
wre,	0

rpr,	0
	rrb
	rpa-i
	dap .+1
	jmp

rp,	0
	dap rtx
rt2,	cks
	ril 1s
	spi i
	jmp rt2
	rrb
	rpa-i
	dio t1
	rcr 7s
	spa
	jmp rt2
	law 1000
	add t1
	dap .+2
	law 2525
	670000	/rar
	sma
	jmp rtb
	law 77
	and t1
	sad (77
	cla
	sad (36
	cla
	sad (13
	jmp rt2
rtx,	jmp
rtb,	lac t1
	sza
	hlt
	jmp rt2
                
                                
fee,	0
	dap fex
	cli
	lat
	and (700
	sad (700
	jmp fex
	ppa
	isp fee
	jmp .-2
fex,	jmp

ppp,	0
	dap pup
	lio ppp
	lat
	and (700
	sad (700
	jmp pup
	ppb
	ril 6s
	ppb
	ril 6s
	ppb
pup,	jmp

start
                
                                                                      

