                                  
/fcdddt  23 sept 65  part 3

tbl,	spi i		/symbol table readers
	jmp err
	rpb
	rir 1s
	law tb0
	spi i
	law tb3
	dap lcx
	jsp rbk
	jmp lct+1

ttl,	spi i		/title punch and punch format setup
	jmp err
	cli
	ppa-i		/start punch
	jsp lcc
ttm,	jsp tin		/listen
	swap
	sad c77
	jmp pir
	sad (36
	jmp pri
	sad (75
	jmp pi2
	ral 1s
	add (ftp
	jda tt1
	idx tt1
	law ttm
	jmp tt1+1
                
                                 
jbk,	spi		/jump block
	jmp err
	add cj
	dac lwt
	feed 40
	lio lwt
	jsp pbw
	feed 240
	jmp lse

pul,	jda chk		/punch lower limit setup
	dap fa
	jmp lss

pwd,	dac dep		/punch word
	lac tas
	sma
	jmp ta0
	lac tsf
	spi
	ior mod
	sza
	jmp ta0
	spi
	jmp .+3
	jsp dep+1
	dac lwt
	clc
	dac pvf
	lac tas
	dap fa
	dap la
	jmp pb5

pun,	spi			/punch any length block
	jmp err
	jsp zro+1

pb5,	lac fa
	ior c77
	dac t
	sub la
	sma
	jmp pb6		/next hundred too high
	idx t

pb4,	jsp pbb		/pbb or pur
	lac t
	dap fa
	jmp pb5

pb6,	lac la
	dac t
	idx t
	xct pb4
	jmp pn2
                
                                
vfy,	jsp zro+1		/for verify
	jmp ver

zro,	law zd		/for zero registers
	dap zvp
	lac wrd
	spi
	jmp .+3
	jda chk
	jmp .+5
	cla
	dap fa
	law i 1
	add mb
	dac wrd
	dap la
	lac fa
	jda chk
	dac chk
	dac lo
	sub wrd
	szm
	jmp err
	dzm dff
	dzm pvf
	law zd3
zvp,	jmp .
                
                                
tb0,	dzm sym l	/macro table read
tb1,	dzm sym r
	jsp gwd
	and (202020
	ral 1s
	xor i gwa
	xor c4
	swap
tb2,	cla
	rcl 6s
	add ps1+1	/law dtb
	dap .+2
	law 77
	and .
	dac t2
	idx t2
	lac sym r
	ral 2s
	add sym r
	ral 3s
	add t2
	dac sym r
	sni i
	jmp tb2
	lac la
	sad rb1
	jmp tbn
	jsp gwd
	dac df1
	jsp de
	jmp tb1

tbn,	law est		/type no. of syms
	sub est
	sar 1s
	jda opt
tbm,	jsp rbk
	jmp .-1

gwd,	dap gwx
	lac la
	sas rb1
	jmp gw1
	jsp rbk
	jmp gwd+1
gw1,	dap .+2
	idx la
gwa,	lac .
gwx,	jmp .
                
                                
tb3,	jsp gwd		/midas table read
	dac sym l
	jsp gwd
	and (177777
	dac sym r
	ior sym l
	sza i
	jmp tbn
	jsp gwd
	dac df1
	lac sym l
	lia
	ril 1s
	sma+spi-skp
	jmp tb3
	and (177777
	dac sym l
	jsp de
	jmp tb3

eap,	0		/eql,arw,pbx common
	dap .+7
	lac eap
	dac lwt
	lac iif
	sza
	jmp ta0
	jsp lct
	jmp .

lwt,	0
	dap pnx
	lac lwt
pns,	jda pi		/pi or opt
pnx,	jmp .
                
                                
pi,t4,	0		/print instruction
	dap px
	jsp pev
	lac pi
	sub ci
	spa
	jmp ppk
	dac pi
	law 72
	jda tys
	jsp tou
	law 71
	jda tys

ppk,	cli
	jsp tou
	xct ea 1
	jmp pvl
	law 72
	jda tys
	and (760000
	sad (660000
	jmp i66
	sad pr0+1		/law 0
	jmp plo
	rar 1s
	sza
csu,	sub (320000	/used as sub
	spa
	jmp plo

pvl,	lac pi
	sza i
	szf 1 i
pv3,	jda opt
px,	jmp .

i66,	law 1		/1s-9s
	add pi
	and pi
	sza
	jmp pvl
	law pa1+1
	dap pex
	lac ea
	jmp eak 2

pad,	0	/print address
	dap px
	law 7777
	and pad
	dac pi
	clf 1
pa1,	jsp pev		/pev or pvl
	lac (flexo +
	jda tys
	jmp pvl
                
                                
pev,	dap pex		/symbol lookup subr
	law i 7777
	and pi
	sad (760000	/detect operates
	jmp sev
	and (760000
	sad (640000
	jmp sev
eak,	dap ea 1
	lac est
	dap ea
	clf 1

eal,	lio i ea
	spi
	idx ea
	dap psw
	spi i
	cli
	dio t3
	idx ea
ea,	lac .
	skp i
	jmp sko
	xor pi
	spa
	jmp eix
	lac pi
	sub i ea
	spa
	jmp eix
	szf i 1
	jmp psw
	lac i ea
	sub i ei1
	szm
	jmp psw

eix,	idx ea
	sad evc
	jmp . 3
	sas (lac est-22
	jmp eal
	xct ea 1
	jmp pex
	szf i 1
	jmp pvl
	lac pi
ei1,	sub .
	lia
	sza	/detect neg nums
	jmp i77
	dio pi
eiy,	jsp spt
	lac pi
sk2,	sza i
	jmp px
	xct ea 1
	jmp . 2
pex,	jmp .
	cma
	dac t2	/mask
	jmp eix
                
                                
sev,	dac t1	/save instruction
	lac pi
	cma
	dac t2	/mask
	law 600		/spa>>05<<sma-skp
	jmp eak

sko,	ior t1
	sas i ea
	jmp eix
	szf 1
	xor t1
	sza i
	jmp eix
	xor pi
	lia
	and t2
	sza
	jmp eix
	dio pi
	szf 1 i
	jmp psw
	lac (flexo >>05<<
	jda tys

psw,	lac .
	dac sym r
	lio t3
	dio sym l
	lac ea
	dap ei1
	stf 1
	xct ea 1
	jmp eiy
	jmp eix

i77,	law i 7777
	and pi
	sas (770000
	jmp eiy-1
	law 7254
	jda tys
	lac pi
	cma
	jmp pv3
                
                                
/symbol print subroutine

spt,	dap spx
	law sym l
	dac t3
spb,	init spj,spd

spn,	dzm t2
spr,	idx t2
	lac i t3
	and (177777
spj,	sub .
	spa
	jmp spp
	dac i t3
	jmp spr

spp,	lac t2
	scr 1s
	sza i
	jmp sps
	add spt
	dap .+1
	lac .
	spi i
	rar 6s
	and c77
	jda tys
sps,	idx spj
	sas (sub spd+3
	jmp spn
	idx t3
	sas (sym+2
	jmp spb
spx,	jmp .

spl,	flex  01	flex  23
	flex  45	flex  67
	flex  89	flex  ab
	flex  cd	flex  ef
	flex  gh	flex  ij
	flex  kl	flex  mn
	flex  op	flex  qr
	flex  st	flex  uv
	flex  wx	flex  yz
	7372

spd,	3100
	50
one,	1
                
                                
/combined octal-decimal print subroutine

opt,	0
	dap opx
	dzm op1
opa,	lac opt
opb,	dac op2
	cli>>05<<swp
	rcl 1s
	div ops
ops,	10
	sas op1
	jmp opb
	sni
	lio (20
	jsp tou
	lac op2
	dac op1
	sas opt
	jmp opa
opx,	jmp .
op1,	0

ci,	10000
c10,	10
                
                                
tys,	0		/type symbol
	dap tyx
	setup opt,3
tyl,	lac tys
	ral 6s
	dac tys
	and c77
	sza i
	jmp tyc
	sad (72
	jmp dns
	sad (74
	jmp ups
	swap
tyb,	jsp tou
tyc,	count opt, tyl
	lac lwt
	cli
tyx,	jmp .

dns,	lac ps1		/redundant case shift filter
	lio (72
dn1,	sad cas
	jmp tyc
	dac cas
	jmp tyb

ups,	lac (rar 9s
	lio (74
	jmp dn1

lcc,	dap lcx
	law 7277
	jmp lc1

lct,	dap lcx
	law 7236
lc1,	jda tys
lcx,	jmp .

tin,	dap tix		/listen
	lac ac
	lio io
	clf 1
	szf i 1
	jmp .-1
	tyi
tix,	jmp .
                
                                
so1,	rpb		/skip over input routine
soi,	rpb		/enter here
	spi i
	jmp so1

rbk,	dap rbx		/read a block into buffer
	init rb1, buf
	dap la
	dzm chi
	rpb
	dio t2
	dio t
	spi
	jmp lse		/start block read
	rpb
	dio ch

	law i 1		/format check
	add ch
	sub t2
	and (777700
	sza
	jmp err

rb0,	rpb
rb1,	dio .
	lac i rb1
	add chi
	dac chi
	idx rb1
	index t2, ch, rb0
	add chi
	add t
	rpb
	dio chi
	sad chi

rbx,	jmp .
	hlt+clc-opr	/checksum error stop
	jmp rbk+1
                
                                
tt1,	0		/title punch subroutine
	dap tt2
	lac i tt1
	repeat 3	cli	rcl 6s	ppa
tt2,	jmp .

pur,	dap pb2		/punch read-in mode blocks

pu1,	lio fa
	jsp pbw
	jsp pv
	swap
	jsp pbw
	index fa, t, pu1
	jmp pux

pbb,	dap pb2		/punch binary block format
	dzm t2
	lio fa
	jsp pbw
	lio t
	jsp pbw

pb1,	jsp pv
	swap
	jsp pbw
	index fa, t, pb1
	lio t2
	jsp pbw
pux,	lac la
	dip fa		/in case punch to 7777
	feed 5
pb2,	jmp .

pir,	feed 40
init fa,7751
	init ptr,ptb
pi3,	lio fa
	jsp pbw
ptr,	lio .
	jsp pbw
	idx ptr
	index fa,ptb+3,pi3
pi2,	lio ptb+24
	jsp pbw
	law pbb
pi1,	dap pb4
	feed 30
	jmp lse

fee,t2,	0		/feed sub and temp store
	dap fex
	cli
	ppa
	isp fee
	jmp .-2
fex,	jmp .
                
                                
ptb,	rpb
	dio 7760
	xct 7760
	dio 7776
	rpb
	dio 7777
	rpb
	0
	lac i 7760
	add 7776
	dac 7776
	idx 7760
	sas 7777
	jmp 7757
	lac 7776
	add 7777
	rpb
	dio 7776
	sas 7776
	hlt
	jmp 7751

/dispatch table

dtb,	disp pls, pls	/0
	letter 1, quo
	letter 2, sqo
	letter 3, pbx
	letter 4, daq
	letter 5, uni
	letter 6, isc
	letter 7, pul
	letter 8, uc8
	letter 9, fs
	disp err, err
	disp err, err
	disp err, err
	disp err, err
	disp err, err
	disp err, err
	letter 0, arw		/20
	disp bar, err
	letter 34, smb
	letter 35, tbl
	letter 36, dec
	letter 37, vfy
	letter 40, wds
	letter 41, xec
	letter 42, rd
	letter 43, zro
	disp err, err
	disp com, eql
	disp err, err
	disp err, err
	disp tab, tab
	disp err, err
                
                                 
	disp pwd, dr1		/40
	letter 23,jbk
	letter 24,kil
	letter 25,ttl
	letter 26,m
	letter 27,nws
	letter 30,oad
	letter 31,pra
	letter 32,q
	letter 33,rad
	disp err, err
	disp err, err
	disp min, pls
	disp def, bas
	disp ovb, vb
	disp val, bac
	disp err, err		/60
	letter 12,a
	letter 13,bk
	letter 14,cns
	letter 15,pun
	letter 16,eas
	letter 17,f
	letter 20,bgn
	letter 21,oct
	letter 22,ir
	disp lc, lc
	disp dot, del
	disp uc, uc
	disp bs, bs
	disp err, err
	disp cr, cr

/title punch table

ftp,	0	0	/space
	004277	c4,400000	/1
	625151	514600	/2
	224145	453200	/3
	141211	771000	/4
	274545	453100	/5
	364545	453000	/6
	010171	050300	/7
	324545	453200	/8
	065151	513600	/9
tou,	dap tox	dio tot	/typeout subroutine
	cks	ril 2s
	spi i	jmp .-3
	lio tot	tyo-i
tox,	jmp .	op2,	0
opd,dnm,	0	tot,	0
                
                                	364141	413600	/zero
c77,	000077	000000	//
	224545	453000	/s
	010177	c01,010100	/t
	374040	403700	/u
	073060	300700	/v
	376014	603700	/w
	412214	224100	/x
	010274	020100	/y
	615141	454300	/z
plo,	jsp pev	jmp pa1+1
	141414	141400	/=
pbw,	dap pby	ppb	/punch 1 word
	rcl 6s	ppb
	rcl 6s	ppb
	rcl 6s	add t2
	dac t2	pby,	jmp .
	204040	403700	/j
	771014	22100	/k
	774040	404000	/l
	770214	027700	/m
	770214	207700	/n
	364141	413600	/o
	771111	110600	/p
	364151	215600	/q
	771111	314600	/r
lo,	0	wc,	0	/low, word count
esp,	dzm .	cn3,	400000	/procede counter
	101010	101000	/-
	000041	221400	/)
	101074	101000	/+
	001422	410000	/(
pri,	law pur	jmp pi1
	761111	117600	/a
	774545	453200	/b
	364141	412200	/c
	774141	413600	/d
	774545	414100	/e
	770505	010100	/f
	364151	513000	/g
	771010	107700	/h
	004177	410000	/i
	000001	030000	/close quote
	000060	cj,600000	/.
	c3,000003	c2,020000	/open quote
                
                                
/indicator and variable storage

t3,chr,	0		/last character, temp
wrd,	0		/quantity being assembled
sym,	0	0	/symbol left and right
chi,	0		/+0 when letter or num has been typed
			/since last typeout or c.r.

let,	0		/+0.letters typed, -0 otherwise
ch,	0
chc,	0		/number of characters counted
syl,	0		/syllable
t,	0		/temp storage
la,	dio		/last address
fa,	dio		/first address
fsm,	0		/flexo codes for type in
mod,	0		/mode, -0 for "type in"
df1,	0		/value for defining symbol

loc,	0		/current location
tas,	0		/address part for fetch or deposit
			/current register. instruction part
			/+0 for register closed, tells dep
			/and fet subroutine to ignore
tsf,	0		/current examination flop
lcf,	0		/current location flop
			/0.external, non-0.internal
iif,	0		/initial internal flop, 0 usually
			/becomes non-0 when type A,I,M,B
bbf,	0		/B flop, 0 usually, set to -0 by type B

dfp,	0		/drum field of program
dfd,	0		/drum field of DDT
dpf,	0		/used to hold dfp

dff,	0		/deposit-fetch flop, 0.dep, -0.fet
pvf,	0		/punch-verify flop, 0 usually
			/-0 - center dot
			/not .+0 - continue in pv subroutine
cn1,cn2,	400000
sbi,	+0
buf,t1,	buf+100/		/paper tape buffer
                
                                 
/part 4

pc,	0
ac,	0
io,	0
msk,	-0
ll,	0
ul,	7777
bk1,	-0
	repeat nbp-1,-0
.+nbp/
bk0,	-0
mb,	10000

pa,	dcc		/public area
	hlt+cla+cli-opr-opr
	lac r0
	lio r2
	hlt
	jmp .
	jmp .
	hlt
	bpt
	bpt
	7751
	0
	0
	0
	0
	dac r1
	dio r2
	lio dfq
	dia
	lio dfe
	cla
	dcc
	hlt+cla+cli-opr-opr
	jmp plc
pa+7777-7747,
	jmp lis

constants
start
                
                                                                                                           
