                           
midas linking loader

6700/

start
                
                                
midas relocating linking loader
/10-24-63  wfm

equals char,character

entry,	lac sherej
	dac 7776
	lac .+2
	dac 7777
	jmp sa
sherej,	jmp shere
	0
sa,	lap
	sub (2
	and (177777
	dac list
	hlt>>05<<cla>>05<<cli>>05<<clf 7

shere,	szs 20
	lat
	and (177777
	dac memory
	dac rfactor
	eem

block,	law block
	dap gws1
	law btable
	dap .blj
	rpb
	dio .first
	rpb
	rpb-i
	dio .last
	lac first
	add last
	dac .checksum
	law gws+1
	dap gws
	dzm bitsc
	cla>>05<<clf 7
	rcl 2s
bsw,	add blj
	dap blx
	law 7777
	and first
blx,	jmp .
                
                                
btable,	jmp ablock
	jmp rblock
	jmp lblock
jblock,	stf 4
	jsp bits
	dac value
	law .+3
	dap gws1
	jmp gword+2
	szs 10
	jmp ljp
	jsp cr
	lac memory
	jda opt
	jsp cr
ljp,	lac list
jback,	dap qlac
	lac memory
	lio value
	szs i 60
	hlt>>05<<clf 7		/normal halt
	jsp qd
	jmp jfoo
	lac memory
	lio value
	hlt
	jmp i value

jfoo,	xct qlac
	and (-600000
	dac symrm
	dzm symlm
	xct qlac
	sma
	jmp .+4
	idx qlac
	xct qlac
	dac symlm
	idx qlac
	xct qlac
	jda spt
	jsp cr
	idx spt
	add qlac
	jmp jback

qd,	dap qdx
qlac,	lac .
	sza i
	idx qdx
	ral 1s
	spa
qdx,	jmp .
	rar 1s
	sma
	idx qlac
	idx qlac
	jmp qlac
                
                                
gword,	0
	dap gwx
	lac checksum
	cks
	ril 1s
	spi i
	jmp .-3
	rrb
	dio .lword
gws,	jmp .
	rpb-i
	add lword
	dac checksum
	idx first
	sas last
	jmp gwx-2
	law gwc
	dap gws
	lac gword
	jda ad
gwx,	jmp .

gwc,	sas lword
	hlt		/checksum error
gws1,	jmp block	/used as switch

ad,	0
	dap adx
	lac ad
	dio ad
	cma
	sub ad
	cma
adx,	jmp .

bits,	dap bitr
	dzm .value
	isp .bitsc
	jmp bih
	jda gword
	dio .codes
	law i 9.
	dac bitsc
bih,	cla>>05<<clf 3
	lio codes
	rcl 2s
	dio codes
	sza i
	jmp xsym
	add .+1
	dap bix
	law 7777
	and .rfactor
bix,	jmp .
                
                                	clc
	cma
	lio value
	jda ad
	jda gword
bitr,	jmp .

ego,	stf 3
	lac symr
	and (600000
	ral 2s
	add .+1
	dap .+5
	lac rfactor
	lio syml
	spi i
	and (7777
	jmp .
	clc
	cma
	jda gword
	dac value
	szf 3
	jmp enterv
	szf 6
	jmp compare
egol,	lac .
	and (-200000
egod,	dac .
	lac lkl
	dap vlio
	dap ept
	xct lkl
	dac lword
	cma
	dac gword
	szs 10
	jmp .+4
	lac value
	jda spt
	jsp cr
	idx lword
                
                                
ebll,	idx ept
	dap elda
	dap esto
ept,	lio .
	lac value
	spi
	cma
elda,	lio i .
	jda ad
esto,	dac i .
	isp gword
	jmp ebll

	lio value
	law i 2
	add list
	dap ept
	jmp vlio+1

rblock,	add rfactor
	dip .memory
ablock,	dap memory

rword,	jsp bits
	dac i memory
	idx memory
	sad .list
	hlt>>05<<cli>>05<<stf 7
	jmp bits+1

lookup,	dap lkx
	jda gword
	dio .syml
	clf 5
	lac syml
	and (-600000
	dac symlm
	sza
	stf 5
	jda gword
	dio .symr
	lac symr
	and (-600000
	dac symrm
	spi i
	ril 1s
	law ego
	spi
	dap lkx
	lac list
lkb,	dap lkl
	dap egol
	dap egod
                
                                
lkl,	lac .
	sza i
lkx,	jmp .
	ral 1s
	clf 6
	sma
	stf 6
	rar 1s
	and (-600000
	sad symrm
	jmp lkm		/right matches
	xct lkl
	spa
	idx lkl
lkr,	idx lkl
	dap .+2
	szf i 6
	add .
	add one
	jmp lkb

lkm,	xct lkl
	spa
	jmp .+4
	szf 5
	jmp lkr
	jmp lkf
	idx lkl
	xct lkl
	sas symlm
	jmp lkr
lkf,	idx lkx
	idx lkl
	jmp lkx
                
                                
enterv,	law i 3
	szf i 5
	law i 2
	add list
	dap list
	dap en1v
	lac symrm
	szf i 5
	jmp en3
	ior (400000
	xct en1v
	idx en1v
	lac symlm
en3,	xct en1v
	idx en1v
	szs 10
	jmp .+4
	lac value
	jda spt
	jsp cr
	lac value
en1v,	dac .
	jmp bits+1

compare,	xct lkl
	sad value
	jmp bits+1
	lac (flexo mds
	jda tys
	lac (char ls+36
	jda tys
	lac memory
	jda opt
	jsp tab
	xct lkl
	jda spt
	jsp tab
	lac value
	jda opt
	jsp cr
	hlt>>05<<cma>>05<<cli
	jmp bits+1
                
                                
vback,	dap vlio
	add lword
	dap .+1
	dio .
vlio,	lio .
	law i 1
	add vlio
	sas ept
	jmp vback
	lac vlio-1
	dap list
	jmp bits+1

xsym,	jsp lookup
	jmp enters
	szf i 6
	jmp insert
	xct lkl
	lio syml
	spi
	cma
	lio value
	jda ad
	dac value
	jmp bits+2

enters,	szf 4
	jmp bits+2
	law i 4
	szf i 5
	law i 3
	add list
	dap list
	dap en1
	lac symrm
	ior (200000
	szf i 5
	jmp en2
	ior (400000
	xct en1
	idx en1
	lac symlm
en2,	xct en1
	idx en1
	law 1
	xct en1
	idx en1
in1,	lac syml
	and (400000
	ior memory
en1,	dac .
	jmp bits+2
                
                                
insert,	szf 4
	jmp bits+2
	dap en1
	dap .+1
	idx .
	law i 1
	add list
	dap list
	dap mdac
	dap mlac
mloop,	idx mlac
mlac,	lac .
mdac,	dac .
	idx mdac
	sas en1
	jmp mloop
	jmp in1

cr,	dap crtabx
	law 77
	jmp .+3
tab,	dap crtabx
	law 36
	jda tou
crtabx,	jmp .

tys,	0
	dap tyx
	law i 3
	dac opt

tyl,	lac tys
	ral 6s
	dac tys
	and (77
	sza
	jda tou
	isp opt
	jmp tyl
tyx,	jmp .

tou,	0
	dap tox
	cks
	ril 2s
	spi i
	jmp .-3
	lio tou
	tyo-i
tox,	jmp .
                
                                
lblock,	law ldone
	dap gws1
	jsp lookup		/routine needed?
	jmp .-1
	szf 6
	jmp .-3
	law block		/yes
	dap gws1
ignore,	jda gword
	jmp .-1

ldone,	jsp block+3		/no
	jmp ignore
	jmp ignore
	jmp lblock+2
	law ljp
	dap gws1
	jmp ignore

opt,	0
	stf 1
	dap opx
	law i 6
	dac ad

op1,	lio opt
	cla
	rcl 3s
	dio opt
	sza
	clf 1
	sza i
	law char r0
	szf i 1
	jda tou
	isp ad
	jmp op1
	law char r0
	szf 1
	jda tou
opx,	jmp .
                
                                
spt,	0
	dap spx
	law symlm
	dap spdac
spb,	dap splac
	law spd
	dap spj

spn,	dzm ad
spr,	idx ad
splac,	lac .
spj,	sub .
	spa
	jmp spp

spdac,	dac .
	jmp spr

spp,	lac ad
	scr 1s
	sza i
	jmp sps
	add spt+1
	dap .+1
	lac .
	spi i
	rar 6s
	jda tou
sps,	idx spj
	sas (sub spd 3
	jmp spn
	idx spdac
	sas (dac symlm 2
	jmp spb
	jsp tab
	lac spt
	jda opt
spx,	jmp .

spl,	flexo  01	flexo  23
	flexo  45	flexo  67
	flexo  89	flexo  ab
	flexo  cd	flexo  ef
	flexo  gh	flexo  ij
	flexo  kl	flexo  mn
	flexo  op	flexo  qr
	flexo  st	flexo  uv
	flexo  wx	flexo  yz
	char m.

spd,	50x50	50	one, 1

symlm,	0	symrm,	0

constants
a,	variables
b,

start entry
                
                                                                   
