          
/fcdddt  3 nov 65  part 2

lis,	lsm		/initial entry

zrt,	lac dpf		/zero drum routine return
	dac dfp

lse,	jsp lcc
	lac (jsp tin
	dac ps1-1
lsa,	dzm mod
	dzm tas
	dzm iif
lss,	clc
	dac chi

lsp,	dzm wrd
	lac cun
ssn,	dip sgn
	dzm dnm
	dzm syl
n2,	dzm sym l
	dzm sym r
	clc
	dac let
	dac chc

lsr,	dzm bbf
	lio sk1
	dio wea
	init bax, lwt
	jsp tin		/listen
ps1,	dio chr
	law dtb		/used at tb2+2
	add chr
	dap .+1
	lac .
cas,	dio ch		/rar 9s for upper case
	and (777
	dac t2
	sub (44
	spa
	jmp ln
cad,	add (jmp uc	/first dispatch
	dap lsx
	sub ar1		/last no-eval routine
	spq
	jmp i lsx
	lac sym l
	ior sym r
	lio lcf
	sad (45		/check for N
	dio iif
	law syl
	lio let
	spi i
	jsp evl		/letters typed
	jmp ev4		/no letters typed
                
                                	law 77		/did not find symbol
	sad ch
	dzm tas		/cancel type-in
	lac (flex U
	jda tys
	jmp lss



ev4,	dap sgn
	lac wrd
sgn,	0		/operator and syllable address
	dac wrd
	lio chi
	spi
	lac lwt
lsx,	jmp .


evl,	dap evx		/symbol lookup
	law evc
	dap esi+2
evc,	lac est
	dap es4
evg,	dap ev2
ev2,	lac .
	spa
	jmp esn
	cla
es3,	sas sym l
	jmp esi
es4,	lac .
	sad sym r
	jmp ev3
esi,	idx es4
	idx es4
	sas evc
	jmp evg
	idx evx
ev3,	idx es4

evx,	jmp .

esn,	idx es4
	lac i ev2
	xor c4
	jmp es3
                
                                
n,	rir 5s		/number routine
	lac syl
	ral 3s
	spi i
cun,	ior t2
	dac syl
	lac dnm
	ral 2s
	add dnm
	ral 1s
	spi i
	add t2
	dac dnm
	jmp l1

ln,	add (44-12
	spa
	jmp n

	dzm let		/letter routine
l1,	dzm chi
	idx t2
	idx chc
	sas (4
	jmp ln3
	lio sym r
	dio sym l
	dzm sym r

ln3,	sub (6
	szm
	jmp lsr
	lac sym r
	mul spd+1
	div spd+2
	jmp .
	add t2
	dac sym r
	jmp lsr
                
                                
uc,	lio (rar 9s	/upper case
	jmp .+2
lc,	lio ps1		/lower case
	dio cas
	jmp lsr+1

sqo,	lac dnm		/' means take decimal number
	jmp n1+1

quo,	lac sym l	/" means take as flexo codes
	sza i
	lac sym r
	jda spv
	lac tys
	jmp n1

q,	lac lwt		/Q means last quantity
	jmp n1

ta0,
err,	lac (743521	/?
er1,	jda tys
	law 7234		/black
	jda tys
	jmp lse

ser,	law 7435		/symbol table overflow error
	jda tys
	law 0772
	jda tys
	lac est
	dap sr1
sr1,	lac .
	spa
	idx sr1
	idx sr1
	lac i sr1
	jda pi
	lac (741034
	jda tys
	jmp lse

daq,	law 7777		/>>04<< defines sym as address of Q
	and lwt
	jmp .+2

com,	lac loc		/comma defines sym as loc
	dac df1

                
                                
def,	lac let		/define symbol
sk1,	sza
	jmp err
	law pn2

de,	dap dex
	lio df1
	jsp evl
	jmp df2
	law sl
	sub est
	sma
	jmp ser		/symbol table full
	law i 1
	adm est
	dio i est
	sub one
	dap est
	lio sym r
	dio i est
	sub one
	swp
	lac sym l
	sza i
	jmp dex
	dio est
	xor c4
	dac i est
	jmp dex

df2,	dio i es4
dex,	jmp .

dot,	lio chc		/.
	lac loc
	spi i
	lac dnm
	dac syl
	law 44		/. in radix 50
	dac t2
	jmp l1

del,	dzm iif		/end of no-eval routines, delete
	jmp pn2

val,	dac df1		/open paren, sets up value for define
	jmp lss
                
                                
a,	spi		/A.acumulator
	jmp .+3
	dac ac
	jmp lse
	law ac
	jmp n1-1

ir,	spi		/I.io
	jmp .+3
	dac io
	jmp lse
	law io
	jmp n1-1

m,	spi i		/M.mask register
	jmp err
	law msk
	dac iif
n1,	dzm chi
	dac syl
	jmp n2

kil,	spi		/K
	jmp ki5
	lac let
	sza
	jmp err
lal,	lac low		/used below
	sad i est
	jmp err
	law ki1		/delete one symbol
	dap evx
	law lal
	jmp evl+2
ki1,	jmp .+2
	jmp err
	sub ev2
	dac t3
	idx t3
	dac t4
	idx t4
	idx es4
	and (7777
ki2,	sub t4
	dap ki3
	add t3
	dap ki4
ki3,	lio .
ki4,	dio .
	sas est
	jmp ki2
	add t3
	jmp .+2
ki5,	law low		/delete all symbols
	dac est
	jmp lse
                
                                
eql,	jda eap		/print octal integer
	jda opt
pn2,	jsp lct
	jmp lss

arw,	jda eap		/print as instruction
	jda pi
ar1,	jmp del		/used by cad+2

oct,	law 10		/octal radix
	jmp .+4
dec,	spi i
	jmp uns
	law 12		/decimal radix
	dac ops
	jmp lse

smb,	spi i
	jmp sav
	law pi
	jmp .+2
cns,	law opt		/symbolic-constant switch setup
	dap pns
	jmp lse

oad,	law pvl
	jmp tls-1
rad,	spi i		/octal-relative switch setup
	jmp err
	law pvl
	dap pa1
tls,	jmp lse


pls,	lac cad		/plus
	jmp ssn

min,	spi		/minus
	dio wrd
	lac csu
	jmp ssn

uni,	jmp ssn-1		/or

isc,	lac can		/and
	jmp ssn
                
                                tab,	spi i		/tab
	jda dep
	dzm lcf
	dac lwt		/push down list
	lio tas
	spi
	jmp ta3
	lio loc
	dio i bsa
	idx bsa
	sad (idx lop+6
	law lop
	dap bsa
	lac bsb
	sad bsa
	add one
	sad (idx lop+6
	law lop
	dap bsb
	skp i
ta3,	dac lwt
	jsp lcc
	lio lcf
	sni
	jmp ta4
	sub (ac
	spa
	jmp ta0
	sub (4+nbp		/internal symbol print
	szm
	jmp ta0
	add (4+nbp
	sal 1s
	add (aa
	dap .+1
	lac .
	jda tys
	idx .-2
	xct .-3
	jda tys
	jmp ta4+2

bs,	spi i		/backspace
	jda dep
	idx loc
	dac lwt
	lio tas
	spi
	jmp ta3
	lac bsa
	sad bsb
	jmp ta3+1
	sub one
	sad (idx lop-1
	law lop+5
	dap bsa
bsa,	idx lop
	dac loc
	jmp ta3
bsb,	idx lop
                
                                
fs,	spi i		/arrow up (forward space)
	jda dep
	law i 1
	adm loc
	jmp ta3

bac,	law opt		/open bracket (bar-constant)
	jmp .+2
bas,	law pi		/closed bracket (bar-symbolic)
	dap bax
	jmp bar
vb,	clc		/vertical bar
	dac mod
bar,	lac lcf		/slash
	dac tas
	lac iif
	dzm iif
	dac lcf
	sza
	dac tsf
	lac wrd
	spi i
	jmp ta5
	lac tas
	dac lcf
	lac lwt
	dzm tsf
	jmp ta6

uc8,	spi i		/> means make corr. and open register
	jda dep
	dzm tsf
	jmp ta6

cr,	spi i		/carriage return
	jda dep
	dac lwt
	law 72
	jda tys
	jmp lse+1

eas,	law ws4+2		/effective address search
	dap dpx
	law ea1
	jmp ws

nws,	lac sk2		/not word search
	dac wea

wds,	law ws1		/word search
	jmp ws


pbx,	jda eap		/print as bcd
	jda tys
	jmp pn2
                
                                
rd,	jsp zro+1	/read binary tape
	jsp soi
	jsp lct

rd1,	law 7777
	and t		/beginning of blockread
	sub lo		/beginning address requested
	spa
	cla
	add lo
	dac t3		/max. of C(lo) or C(t)
	add dfp
	lia
	law i 1
	add ch		/end of block address
	and (7777
	sub wrd		/upper limit requested
	sma
	cla
	add wrd
	sub t3
	spa
	jmp rd2		/lower limit is not in block read
	add one
	dia
	lia
	lac la
	add t3
	sub t
	and (7777
	dcc
	hlt

rd2,	jsp rbk
	jmp rd1
                
                                
dr1,	spi i
	jmp dr2		/assign drum fields
	jsp lct		/type drum fields
	lac dfd
	ral 6s
	jda opt
	lac (flex <
	jda tys
	lac dfp
	ral 6s
	jda opt
	jmp lse

bgn,	jmp bg0		/G

xec,	jmp xe0		/X

pra,	jmp pr0		/P

bk,	spi i		/B
	jmp 1bk
	clc
	dac bbf
	dac let
	law bk1
	dac syl
	dac iif
	dzm chi
	jmp lsr+1
1bk,	dac dep
	law bk1
	add c4
	dac tas
	dac tsf
	jsp dep+1
	jmp lse

ovb,	clc		/overbar
	spi
	jmp n1
	sas bbf
	jmp err
	jsp cbp
	jmp lse

start
                
                                                                                                                                                  
