
PRINT II = july 1961


	pit=1400
	and=anl
	ana=ano
	ora=oro
	lca=cla 62
	hlg=hlt
	ala=alo
	pna=664020

define
	print
	llr .
	tra pit
	terminate

	psd=020000
	pnd=040000
	pso=060000
	pno=100000
	psu=120000
	pnu=140000
	pfl=160000	|cr+tf
	pbp=200000
	psg=220000
	png=240000
	pfr=260000
	plv=300000
	pcm=320000
	poz=340000
	psf=360000
	psb=400000
	pms=420000
	pmn=440000
	pfp=460000
	to=0	|cr+tf
pit|	cla	|printing interpretive routine
	add (17777	|clear first five bits
	and
	lac
	add (add 1
	sto ppc	|cr+tf
p20,	cla
	add ppc
	add (1
	sto ppc
	sto .+2	|set up program counter
	cla
	hlt+opr-opr	|add users instruction
	llr (17777
	and
	slr p62	|reads store x
	lpd	|cr+tf
	cyl	cyl	cyl	cyl	cyl
	alr+com-opr
	add (24	|to test for illegal instruction
	trn p38
	lac
	add (add p30
	sto .+6
	llr p62
	lac
	add (add
	sto p61
	cla
	hlt	|will add instruciton
	trn .+4
	add (tra
	ala
	tra p31	|go to rtine
	sto .+2
	lac
	hlt	|will make transfer cr+tf

p30,	tra p38	|the transfer table
	p15	|psd
	p16	|pnd
	ps9	|pso
	p10	|pno
	p11	|psu
|i.3	>>40<<pnu
	tra p37	|flexo characters cr+tf
	tra p43
	p17	|psg
	p18	|png
	p19	|pfr
	tra p39	|plv
	tra p44	|pcm
	tra p20	|poz, do nothing
	tra p45	|psf
	tra p66	|set binary point, psb
	q61	|pms - mixed, spaced
	q62	|pmn - no space end of 
	q21	|pfp - floating point - end of transfer table cf+tf
p39,	add (tra	|leave the program
	sto .+2
	cla
	opr	|will transfer cr+tf
p37,	cla	|print flexo characters
	add ppc	|program counter
	add (1
	sto ppc
	sto .+2
	cla
	opr	|will add in register to be typed
	pnt
	pnt
	pna	|cr+tf
	add p62	
	add (-1
	sto p62
	trn p20	|back to interpretive routine
	tra p37	|repeat operation  cr+tf

p66,	add (1	|psb, set binary point for mixed numbers
	sto p07
	tra p20	|return to interpret cr+tf
p38,	cla	|illegal order
	add (flexo ipi
	pnt
	pnt
	pna
	add ppc	|progam counter
	hlt	|stop computer
	tra p20	|take next instruction + cr+tf
p43,	llr (tra p73-1	|pbp, bypass signature
	slr p72
	tra p20
p44,	add (-1	|pcm, set program counter
	sto .+2
	tra p20
	7	|storage, normally types 8 columns c+tf
p45,	com	|psf, signifiant figures in fraction
	add (1
	sto dct+1
	tra p20	|cr+tf
p60,	sto	|stores users instruction
p61,	sto	|add x, specified register
p62,	sto	|store x, specified register
p63,	sto	|counter for total number to be printed
p64,	sto	|counter for typing 8 on a line - see p44+4
ppc,	sto	|pseudo program counter cr+tf

p76,	llr p61	|print a single number
	slr .+2
	cla
	opr	|will add number to be printed
	sto ps1	|prepare for printing
	llr (trn p20
	slr p52	|return address from print program
	opr+hlt-opr	|adjusted at jump table see p31 cr+tf
p31,	slr p76+7
	slr p73+11
p70,	add ppc	|format printer
	add (1
	sto .+3
	sto p71+2
	cla
	hlt	|will add next instruction cr+tf
	llr (17777
	and	|eliminate all but first five bits
	lpd
	cyr
	add (377777	|will cry to bit 0 if next ordr instruction
	trn p76	|print a single number
p71,	llr p62	|format printer proper
	clc+lpd-opr	|subtract loction of first regisger
	hlg	|add locagion of lusg register
	sto p63	|counter for total number to be printed
	tra p75	|to print a carriage return cr+tf
p72,	add p61	|start of a line of format
	llr (add
	lpd
	sto ps1
	llr (trn .+3
	slr p52
	tra p10	|print register number cr+tf
	add (char r|
	pna
	sto p64	|set counter for typing n on a line cr+tf
p73,	cla	|print a tab
	add (char r	
	pna
	llr p61
	slr .+1
	opr	|will add desired register or printing
	sto ps1
	llr (trn .+3	|for return from print
	slr p52
	opr	|go to proper print program see p31+2 cr+tf
	add p61	|contains add x
	add (1
	sto p61
	cla
	add p63
	trn p74	|return to interpret cr+tf
	add (-1	|continue program
	sto p63	|adjust total counter cr+tf
	llr p64
	lac
	add p44+3	|tzpe n numbers
	trn .+5
	lac
	add (-1	|adjusts counter for n caracters
	sto p64
	tra p73	|continue printing the same line
p75,	cla	|start a new line
	add (char r

	pna	|print a carriage return
	tra p72	|cr+tf
p74,	cla
	add (char r

	pna	|print a carriage return and return to interpret
	add ppc
	add (1
	llr p75-20
	slr p72
	sto ppc
	tra p20	|interpret enter cr+tf
p10,	llr (add ps3
	slr ps1+2	|signed octal, suppress with nothing
ps8,	llr (opr	|suppress with nothing
	slr p51-3
ps7,	llr p06	|suppress with spaces
	slr ps4	|store in flexo tabl
	tra ps6		|cr+tf
ps9,	llr (add ps3	|signed octal, suppress spaces
	slr p02
	tra ps7
p15,	llr (add ps2	|decimal, suppress with spaces
	tra ps9+1	|cr+tf
p18,	llr (tra p16	|unsigned decimal, suppress with nothing
	tra .+2
p17,	llr (tra p15	|unsigned decimal, suppress with spaces
	slr p21+7
	llr (add ps2	|decimal -100000
	tra p21-1
p12,	llr (tra p10	|unsigned octal, suppress nohing
	tra .+2
p11,	llr (tra ps9	|unsigned octal, suppress spaces
	slr p21+7
	llr (add ps3	|contais octal -100000
	slr p21+10	|cr+tf

p21,	cla	|general unsigned numbers
	sto p05
	add .+10
	sto p50
	llr ps1
	lac
	trn .+2
	hlt
	hlt
	ala
	add p05
	add (1
	sto p05
	slr ps1
	tra p21+5	|cr+tf
p19,	llr (tra p14	|pfr, decimal fraction
	slr ps5-1
	llr p38+4	|pna
	slr ps5-2	|this routine is continued later, at p14
ps6,	llr ps1	|print signed number, in ps1
	lac
	trn .+4	|in case of negative number
	cla
	add p06	|space character cr+tf
	tra .+5
	com
	sto ps1
	cla
	add (char r-
	pna
	add (char r.	|tyes decimal point if needed
	opr	|changed to pna for fractions
	opr	|also changed for fractions cr+tf
ps5,	llr p02	|print out routine
	slr .+6	|determines octal or decimal
	cla
	sto p03
	sto p01	|set counters
	cla	|return point
	add ps1	|enter number
	opr	|wil subtract proper number cr+tf
	add (1
	trn .+7	|to print
	add (-1
	sto ps1	|restore number
	cla
	add p01	|counter for subtractions
	add (1
	tra .-13	|repeat
	cla	|print
	add p01	|counter
	add (add ps4
p50,	opr	|used only for unsigned octal or decimal cr+tf
	llr (opr
	slr p50
	sto .+3	
	sto p51-4
	cla
	opr+hlt-opr	|will add desired flexo character
	llr p06	|space character
	lpd	|determine if zero was suppressed
	add (377777
	trn .+6	|zero not suppressed cr+tf
	cla
	add p03
	add (5
	trn .+2
	tra .+5
	llr (pna
	slr .+5
	llr (char r0
	slr ps4	|suppress no more zeros
	cla
	opr	|will dd flexo character agan
	pna	|print it - will not always clear afterwards
	cla
	add p03	|count
p51,	add (-1
	sto p03
	add (6
p52,	trn p52	|this instructionleaves the print routine
	cla
	add ps5+7
	add (1
	sto ps5+7	|cr+tf
	cla
	tra ps5+4	|end of print number cr+tf
q61,	llr (tra p15
	tra .+2
q62,	llr (tra p16	|first=mixed wih spaces, pms
	slr q64		|second=mixed with nothing
q63,	llr (tra .+3	|general mixed numbers
	slr ps5-1
	tra ps6
	llr (opr
	slr ps5-1
	slr ps5-4	|to prevent too many spaces from being printed
	llr p07		|to count cr+tf
	slr drh		|at present, a spare register-set counter
	llr ps1		|bring in number
	cla
	add drh
	add (-1
	trn .+11
	sto drh
	lac	|cycle the live register
	cyr
	ala
	add ps1		|shift ps1 right
	shr
	sto ps1
	tra .-13		|cr+tf
	cla
	add ps1		|make just a fraction
	lpd
	cyr
	sto p05	|at present, a spare rgister
	llr p52	|save p52 return
	slr p60	|another spate register
	llr (trn .+3	|fraction in p05, number in ps1
	slr p52
q64,	hlt		|should ransfer cr+tf
	llr p60
	slr p52	|restore p52 transfer
	llr .+3
	slr ps5-4
	add (char r.
	pna
	llr p05	|put back in ps1 for fraction print
	slr ps1	|cr+tf
p14,	llr (opr	|continuation of fraction print
	slr ps5-1
	slr ps5-2	|sign and decimal point are now typed
	llr (char r0	|also, fraction is + and is in ps1
	slr ps4
	llr ps1
	lac
	clr
	sto dlh	|break up the fraction
	lpd
	sto drh
	llr dct+1
	slr dct	|counter cr+tf
df1,	llr drh
	cla 12	|lal cr+tf
	cyl
	lad
	cyl
	llr (-17000
	and
	lpd
	slr drh
	ala
	add dlh
	cyl
	cyl
	add dlh
	cyl
	lad
	llr (-400007
	and
	lpd
	slr dlh
	cyl		|cr+tf
	add (add ps4
	sto .+2
	cla
	opr	|will add flexo character
	pna
	add dct
	add (1
	sto dct
	trn df1
	clc
	trn p52	|clcis necessary or else no trn at p52 cr+tf
dlh,	sto	|storage
drh,	sto
dct,	sto	|counter for significant figures
	-5	|normally six figures cr+tf
q21,	cla	|start of floating point print
	add p61	|number is   x(10) TO I.f
	add (1	|every other register will have to be axamined
	sto p61
	sto .4
	llr ps1
	slr dct	|save the fraction part
	cla
	hlt	|will addin desired number cr+tf
	trn .+2
	tra .+4
	com
	amz
	com
	llr (tra .+4	|the exponent
	slr mpx
	llr p29
	tra mp	|to multiply
p22,	trn p25	|if negative - exponent in accumulatro
	sto p60	|p60 contains I
	slr ps1	|ps1 contains f
	llr (add p28
	slr p23
	cal	|set-up clear both acc and lr
	add p63	|so will print out proper number of numbers
	add (-1
	sto p63
	lac
p23,	hlt	|will add in present term of expansion cr+tf
	llr (tra .+4
	slr mpx	|in the nultiply exit
	llr ps1
	tra mp
	ala	|throw away second half of answer
	add (1
	add p23
	sto p23
	add (-add-p28-5+1
	trn p23-1	|cr+tf
	lac	|multiply loop finished
	add p28+5	|1 over sq rt 10
	llr (tra .+4
	slr mpx	|now square the results
	alr
	tra mp
	llr (tra p24
	slr mpx
	llr dct
	tra mp	|multiply the original fraction cr+tf
p24,	sto ps1	|now print the raction. see if first figure is zero
	llr p52	|save print exit
	slr p23
	llr (tra p26
	slr dlh-7	|first time will not pri t digit
	llr (trn .+3
	slr p52	|set up transfer order
	tra p19	|print the fraction cr+tf
	add (char r	|color change
	pna
	add p60	|where the exponent is saved
	add (1	|because the 10 to power was divided by 10
	sto ps1
	llr (trn .+4
	slr p52
p16,	llr (add ps2	|decimal, suppress with nothing
	tra p10+1
	add (char r	|color change again
	opr 24061	|makes accumulator negative
	llr p23	|restore original transfer
	slr .+1
	hlt	|fnishes
p29,	115041	|lo2 2 base 10 cr+tf
p28,	002301	|table of powers
	004612
	025117
	065422
	135153
	120751	|1 over sq rt 10
p25,	add (-1	|in case of negative exponent
	sto p60	|save
	lac
	add (400000	|fractional equivalent of +1
	alr
	tra p22+2	|return cr+tf
p26,	sto p21+10	|see if first digit was zero
	llr q64+6	|pna
	slr dlh-7
	llr (char r0
	lpd
	opr 51	|samz
	trn .+4
	cla
	add p21+10	|will print the other digit
	tra dlh-7
	add p60	|decrease exponent
	add (-1
	sto p60
	cla
	tra dlh-6	|do not prin digit cr+tf
mp,	lpd	|begin double precision multiply
	sto p05
	lpd
	com
	trn .-1
	sto ps4
	lac
	com
	trn .-1
	sto dlh
	cla
	add p05
	llr .-5
	trn .+2
	llr (opr	|cr+tf
	slr mp+57
	slr mp+62
	cal
	sto drh
	add (-20
	sto p05
	cla
	add dlh
	cyl
	sto dlh
	trn mp+64
	lal
	llr (-600000
	and	|cr+tf
	lpd
	add drh
	cyl
	sto drh
	cla
	add p05
	add (1
	sto p05
	trn mp+25	|cr+tf
	cla
	add drh
	slr drh
	llr (-400000
	and 
	lpd
	cyr
	add drh
	slr drh
	hlt
	ala
	add drh
	hlt
mpx,	hlt
	lal
	add ps4
	tra mp+25+6	|end of multiply
ps1,	sto	|saves the number
p01,	sto	|counter for what digit to print
p02,	sto	|for octal or decimal
p03,	sto	|counter for print out

p05,	sto	|for unsigned numbers
p06,	char r 	|space, used in suppressing zeros cr+tf
p07,	sto 11	|used for mixed numbers
decimal
ps2,	-100000
	-10000
	-1000
	-100
	-10
	-1
octal		
ps3,	-100000
	-10000
	-1000
	-100
	-10
	-1
ps4,	sto	|used in zero suppression
	char r1
	char r2
	char r3
	char r4
	char r5
	char r6
		char r7
	char r8
pie,	char r9	|end ofsubroutine cr+tf

constants


p16+3|	opr 64060
p26+5|	amz

start pit
2