             
ts ddt part 5

tas,	ch	/pointer for examine, deposit

dep,	dap dxx
	lac lwt
	spi
dxx,	jmp .
ope,	skp	/skip if register open
	jmp dxx
	lac wrd
jmc,	skp i	/skip if normal mode
	jmp . 3
bs1,	dac i tas
	jmp dxx
	tsn
	eem
	dac i tas
	lem
	tsf
	jmp dxx

gec,	jsp lct
	tsn
	eem
	lac i tas
	lem
	tsf
	jmp rkp

pi,	xx		/print instruction
	dap px
	jsp pev
	sub ci
	spa
	jmp ppk
	dac pi
	jsp tou
	law 71
	jda tys

ppk,	jsp tou
	lac lwt
	and (760000
	sad pr1		/law
	jmp plo
	sad (sft
	jmp tfs
	rar 1s
	sza
csu,	sub (320000	/used as sub
	spa
	jmp plo

pvl,	lac pi
	jda opt
px,	jmp .		/exit

pev,	dap pex		/symbol lookup subr
	init pvk,top
	law 7777
	ior pi
	sad (-0
	jmp pen
	lac est
pe2,	dap ea
	clf 1

eal,	idx ea
ea,	lac .
	xor pi
	spa
	jmp eix
	lac pi
	sub i ea
	spa
	jmp eix
	szf 1 i
	jmp psw
	lac i ea
	sub i ch
	szm
	jmp psw
                
                                
eix,	index ea,pvk,eal
	szf i 1
	jmp pvl
	lac pi
	sub i ch
	dac pi
	law i 1
	add ch
	dap ch
	lac i ch
	jda tys
	lac pi
sk2,	sza i
	jmp px
pex,	jmp .

tfs,	init pvk,est
	init pex,pa1 1
	law top
	jmp pe2

pen,	law 54
	jda tys
	lac pi
	cma
	jmp pvl 1

plo,	lac est
	sub pi
	spq
	jmp pvl
	jsp pev
	jmp pa1 1

pad,	0		/print address
	dap px
	law 7777
	and pad
	dac pi
pa1,	jsp pev		/pev or pvl
	jsp tou
	jmp pvl

tys,	0		/type symbol, etc.
	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 rc
	lio (74
	jmp dn1

lcc,	dap lcx
	law 7277
	jmp lc1

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

so1,	rpb		/skip over input routine
soi,	rpb		/enter here
	spi i
	jmp so1
	rrb
	rpb-i

rbk,	dap rbx		/read a block into buffer
	init rb1, buf
	dap la
	dzm chi
	cks
	ril 1s
	spi i
	jmp .-3
	rrb
	dio t2
	dio t
	spi
	jmp lse		/start block read
	rpb
	dio ch

rb0,	rpb
rb1,	dio .
	lac i rb1
	adm chi
	idx rb1
	index t2, ch, rb0
	add chi
	add t
	rpb
	rrb
	rpb-i
	dio chi
rb2,	sad i .-1	/used as sad i

rbx,	jmp .
	hlt+clc-opr	/checksum error stop
	jmp rbk+1
                
                                
/combined octal-decimal print subroutine

opt,	0
	dap opx
ops,	init op1, odv	/odv or ddv
	setup op2, 6
	stf 1

opa,	dzm opd
	szf i 1
	jsp tou
	jmp opc

opb,	clf 1
	dac opt
	idx opd
opc,	lac opt
	lio opt
op1,	sub .
	spi i
	sma
	jmp opb

	lac opd
	lio opd
	sza i
	lio ddv+1
	idx op1
	count op2, opa
	jsp tou
opx,	jmp .

ddv,	100000.	10000.	1000.
	100.	10.	1

odv,	100000	ci, 10000	1000
	100	10	one, 1
                
                                
/dispatch table

dtb,	disp pls,pls	/space
	disp n, quo
	disp n, sqo
	disp n, pbx
	disp n, daq
	disp n, uni
	disp n, isc
	disp n, pul
	disp n, uc8
	disp n, fs
bki,	0
	0
	0
	0
ch,	0
loc,	0
	disp n, arw
	disp bar, err
	disp l, smb
	disp l, tbl
	disp l,dec	/u
	disp l, vfy
	disp l, wds
	disp l, xec
	disp l, rd
	disp l, zro
syl,	0
	disp com,eql	/comma,=
t,	0
la,	dio
	disp tab,tab	/tab
fa,	dio
                
                                
	disp err,ub	/_ ,.
	disp l,err	/j
	disp l,kil	/k
	disp l,err
	disp l,m	/m
	disp l,nws	/n
	disp l,oad	/o
	disp l,pra	/p
	disp l,q	/q
	disp l,rad	/r
chi,	0
sbi,	-0
	disp min,pls	/-,+
	disp cpr,bas	/)
	disp ovb,vb	/.
	disp pls,bac	/(
fl1,	0
	disp l,ar	/a
	disp l,bk	/b
	disp l,cns	/c
	disp l,err	/d
	disp l,eas	/e
	disp l, f	/f
	disp l,bgn	/g
	disp l,oct	/h
	disp l,ir	/i
	disp lc,lc	/lower case
	disp dot,del	/.,x
	disp uc,uc	/upper case
	disp bs,bs	/backspace
df1,	0
	disp cr,cr	/car. ret.

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
                
                                
c77,	77
pvk,	lac	tpi,0
let,	0
psw,	lio ea	dio ch
	stf 1	jmp eix
cj,	jmp
c4,	add
rc,	rar 9s

buf,	buf+100/
ovf,	0
pf,	0
ac,	0
io,	0
be,	0
msk,	-0
ll,	0
ul,	low-1
bk1,	repeat 4,ch

constants

start lis
                
                                                         
