       drum test _  2-9-63

dia=iot 60
dba=iot 61
dcc=iot 62
dra=iot 63

define
dispatch C,A
repeat 14,C=C+C
C+A
terminate

jmp tst
          
                                                                  	/drum transfer subroutines


dw,	lac wf	/write
	add drg
	dac io0
	lio io0
	dia
	lio sze
	dio io2
	jmp dt

ds,	lac wf	/swap
	add drg
	dac io0
	lio io0
	dia
	lac rf
	add sze
	dac io2
	lio io2
	jmp dt

dr,	lio drg	/read, used for comparison
	dio io0
	dia
	lac cpf
	add sze
	dac io2
	lio io2
dt,	lac crg
	dac ac2
	dcc
	jmp eck
	jmp ck

          
                                                                 	/typewriter output routines

	/routine to type out k alphabetic words, jda entry

tpa,	.
	dap xta
	dzm tq
	lio (77
	tyo
	lio (35	/for red
	tyo
tca,	lio i tpa
	repeat 3,ril 6s	tyo
	idx tpa
	idx tq
	lac k
	sas tq
	jmp tsp
	lio (77
	tyo
	lio (34	/back to black
	tyo
xta,	jmp .
tsp,	cli
	repeat 6,tyo
	jmp tca
k,	1
tq,	.

	/routine to type out k octal words from memory, jda entry

tpo,	.
	dap xto
	dzm otq
	dzm wsf
	lio (35	/for red
	tyo
tco,	lio i tpo
	cla
	rcl 3s
	sza
	jmp .+2
	law 20
	swap
	tyo
	swap
	idx wsf
	sas (6
	jmp tco+1
	idx tpo
	idx otq
	cli
	repeat 3,tyo
	lac k
	sas otq
	jmp tco-3	/careful
	lio (77
	tyo
	lio (34	/back to black
	tyo
xto,	jmp .
otq,	.
wsf,	.
          
                                                                 	/readat, writdat, swapdat.  entered by jsp

rdt,	lio (jmp dr
	dap dxt
	lac cpf
	dac dfc
	lac cpf
	add wld
	dac wlc
	lac (char rr
	ior cpf
	clf 3
	clf 4
	stf 2
	jmp itp

wdt,	lio (jmp dw
	dap dxt
	lac wf
	dac df
	dac dfc
	add wld
	dac wlg
	dac wlc
	lac (char rw
	ior wf
	clf 2
	clf 4
	stf 3
	jmp itp

sdt,	lio (jmp ds
	dap dxt
	lac wf
	add wld
	dac wlg
	lac rf
	add wld
	dac wlc
	lac wf
	dac df
	lac rf
	dac dfc
	rar 6s
	ior wf
	ior (char rs
	clf 2
	clf 3
	stf 4
          
                                                                 
itp,	dzm rep
	dac tnm
	dio mde
sw2,	senseswitch 2	/up suppresses listing every w, s, r
	jmp blc
	lio tnm	/type test name
	tyo
icy,	cla
	rcl 3s
	swap
	tyo
	swap
	idx rep
	sas (4
	jmp icy
	lio (77
	tyo
	dzm rep
blc,	lac lim	/transfer another block
	dac csz
	dap sze
	dzm wrd
	clf 5
	lac cor
	add lim
	dac lma	/place of definition
sgl,	dzm blk
	lac dor
	dac drg
	lac cor
	dac crg
	dac cur
	dac cln
gns,	lac crg
gnf,	jmp .	/filled by various tests, go generate data
mde,	jmp .	/filled by itp+2,used by outside,go to tra. sub.
          
                                                                 ebk,	lac wrd	/error back from check sub.
	sza
	jmp set
sws,	senseswitch 4	/down, keep trying until no errors
	jmp sw5
	jmp blc	/try again

sw5,	senseswitch 5	/down, one word transf
	jmp sw6
	jmp st1
sw6,	senseswitch 6
	jmp .+2
dxt,	jmp .	/filled by second command of rdt,wdt,sdt, exit
	szf 1
	jmp tst	/to typewriter control
	jmp dxt

set,	law 1	/continue 1 word transfer, another word
	add drg
	dap drg
	law 1
	add crg
	dap crg
	idx lma
	idx blk
	sas lim
	jmp gns	/ends 1 word transfers
	dzm wrd
	clf 5
	lac wf
	add wld
	dac wlg
	lac rf
	add wld
	dac wlc
	jmp sw6

st1,	law 1	/initialize 1 word transfers
	dap sze
	dap wrd
	stf 5
	lac cor
	add sze
	dac lma
	jmp sgl

nrb,	lac wrd	/normal return from check sub.
	sza
	jmp set
	idx rep
	sas agn
	jmp sws
	jmp sw6
          
                                                                 
rep,	.	/repeat
lim,	.	/global value of total no. of words transfered
blk,	.
sze,	.	/local value of total no. of words transfered
wrd,	.	/0 if block tra. 1 if 1 word tra of block

cor,	.	/global value of core origin
crg,	.	/local    "   "   "     "
dor,	.	/global   "   "  drum   "
drg,	.	/local    "   "   "     "

cln,	.	/used by dataset gen., starting loc. in core
cl2,	.	/second cln for hot random in dataset gen.
agn,	1	/again, do test n times before satisfied
wf,	.	/write field
rf,	.	/read field
cpf,	.	/comparison field for checking writes

wld,	.	/used by random data
	711711	/used for random number printout
wlg,	.	/used by random data (generate)
wlc,	.	/  "  "    "     " (check)
lma,	.	/  "  "    "      "  , = cor + lim



	/note - wld,wlg,wlc _. contents depend on whether 
	/reading, writing, or swaping
          
                                                                 	/check
	/program to check drum transfers and control error printout
	/entered by jmp after a dcc

eck,	dac acn	/drum circuit find error
	lac (10000
	jmp cko

ck,	dac acn	/drum circuit find no error
	cla
cko,	dio ion
	dra	/to check error flip-flops
	nop
	nop
	rcl 3s
	rar 3s	/io(0,1,2) . ac(0,1,2)
	dzm ety
	dip ety
	law 1
	dac hct
	dac bct
	dzm cad
	dzm ocr
	dzm ecr
	lac ac2
	dap cad	/so is 0000 - 7777
	dac ac
	lac cad
ckf,	jmp .	/check function. goes to generate data which should
		/be in core. loaded by test-calling sub.
rec,	jmp .	/recur. return to data gen. for comparison.
		/loaded by checking part of data gen. sub.

ers,	lac ocr	/error summary, entered from dataset gen.
	add ecr
	add ety
	sza i
nrt,	jmp nrb	/normal return back to readat, etc.
	sub ety
	sza
	jmp smm	/on error
	senseswitch 1
	jmp smm
	law 1
	dac k
	law ehd
	jda tpa
	law ety
	jda tpo
	jmp smm
          
                                                                 
smm,	lio (10	/summary
	lac tcd
	sas (flexo nor	/normally dont print org, blk
	lio (12
	dio k
	senseswitch 1	/up suppresses printing
	jmp .+5
	law shd
	jda tpa	/type summary heading
	law tnm
	jda tpo	/type octal values for summary
ert,	jmp ebk	/error return back to readat, etc.

ego,	dac exv	/back from dataset gen. (expec. value return in ac)
	lac i ac	/pointer
	dac obv
	xor exv
	dac del
	lac hct
	sza
	jmp hdr
gpr,	cla	/get parity of del
	lio del
	rcl 9s
	rir 9s
	dio shf
	xor shf
	ior (rar
	dac shf
	lac (525252
shf,	rar .	/shift instruction
	and (3
	dap ety	/is either 01 or 10
	add (ion
	dap tku
tku,	idx .	/indexes either ocr or ecr
	senseswitch 1	/up suppresses printing
	jmp rec
	cla
	sas bct
	jmp .+3
	senseswitch 3	/up suppresses all but 1 line error print
	jmp rec
	law ety
	jda tpo	/type error line
	dzm bct
	jmp rec
          
                                                                 
hdr,	dzm hct	/line error information
	law 5
	dac k
	senseswitch 1	/up suppresses printing
	jmp rec
	law ehd
	jda tpa	/type error heading
	jmp gpr

shd,	text .tstiowacrioracaioaoddeveorgblk.
tnm,	.	/test name
io0,	.	/io before dia
ac2,	.	/ac before dcc
io2,	.	/io before dcc
acn,	.	/ac after dcc
ion,	.	/io after dcc
ocr,	.	/odd counter
ecr,	.	/even counter
cur,	.	/starting address of block being transfered
csz,	.	/size of block of data being transfered

ehd,	text .ertexpobsdelloc.
ety,	.	/error type
exv,	.	/expected value
obv,	.	/observed value
del,	.	/xor of exv,obv
ac,	.	/pointer

hct,	.	/head count. 0,1 used in prints
bct,	.	/body   "     "    "   "   "
end,	270000	/end drum
cad,	.	/core address. used by dataset gen., address part
		/gets set to ac2.  tells origin in core
          
                                                                  	/dataset generators

gr,	jmp mde	/no generation when reading

sme,	lac lma	/same name generation
	add df
	dac lmc
	lac crg
	ior df
tik,	dac i cln
	add (1
	dap cln
	sas lmc
	jmp tik
	jmp mde	/back to check sub.
lmc,	.	/limit count
df,	.	/drum field
dfc,	.	/drum field for check

nme,	lac lma	/same name check
	add dfc
	dac lmc
	lac (jmp sbk
	dac rec	/plant into check sub
	lac crg
	ior dfc
tok,	sas i ac
	jmp ego	/to check sub., return expected value
sct,	add (1
	dap ac
	sas lmc
	jmp tok
	jmp ers	/error summary in check sub.

sbk,	lac exv
	jmp sct


rnd,	lac crg	/random generation
	sas cor
	jmp nwr	/when doing 1 word transfer of a block
	lac rf
	szf 3
	lac (010000	/when writing
	dac rr
	add crg
	dac rc
	lac rr
	add lma
	dac rlm
	lac wlg	/wld+wf
	add rr
	jmp spn
          
                                                                 
nwr,	idx rlm	/from rnd+2
	sub (1
his,	add ol
spn,	rar 7s
	dac ol
	dac i cln
	idx rc
	dap cln
	sas rlm
	jmp his
	jmp mde	/back to readat, etc.
rr,	.	/either 01 or readfield in field part
rc,	.	/r counter
rlm,	.	/limit for random
ol,	.	/old random number

snd,	lac crg	/random check
	sas cor
	jmp nws	/when doing 1 word transfer of a block
	lac (jmp rck
	dac rec	/planted into check sub.
	lac rr
	szf 4
	lac (010000	/when swap
	dac rrc
	add crg
	dac rcc
	lac rrc
	add lma
	dac rlc
	lac wlc	/wld+rf
	add rrc
	jmp fde

nws,	idx rlc	/from snd+2
	sub (1
pst,	add olc
fde,	rar 7s
	dac olc
	sas i ac
	jmp ego	/to check sub, return expected value
rck,	idx rcc	/return from check
	dap ac
	sas rlc
	jmp pst
	jmp ers
rrc,	.	/either 01 or readfield in field part (check)
rcc,	.	/r counter (check)
rlc,	.	/limit for random (check)
olc,	.	/old random number (check)
          
                                                                 
hr,	law 4000	/hotswap random generate
	dac cln
	law 6000
	dac cl2
	lac (14000
	dac rc
	lac (10000
	add wld
	jmp .+2
hr1,	add ol
	rar 7s
	dac ol
	dac i cln
	dac i cl2
	idx cl2
	idx rc
	dap cln
	sas (16000
	jmp hr1
	jmp mde

q3,	.	/determines first or second half of check
hrn,	.	/number used in hot rand

hrc,	dzm q3	/hot random check
	lac (14000
	dac rcc
	lac (jmp hr4
	dac rec	/planted into check sub.
	cla
hr2,	dac hrn
	lac (10000
	add wld
	jmp .+2
hr3,	add olc
	rar 7s
	dac olc
	sas i ac
	jmp ego	/to check sub., return expected value
hr4,	idx rcc	/return from check
	dap ac
	sub hrn
	sas (16000
	jmp hr3
	idx q3
	sas (1
	jmp ers	/to error summary
	law 2000
	jmp hr2
          
                                                                 
zrs,	cli	/zeros generate
zcm,	lac lma	/zero-one common entry
	dac lmc
zot,	dio i cln
	idx cln
	sas lmc
	jmp zot
	jmp mde	/back to check sub.
one,	lio (777777	/ones generate
	jmp zcm

oht,	lio (cla	/zeros check
cmz,	lac lma	/zero-one check common entry
	dac lmc
	dio zro
	lio (jmp zb
	dio rec	/planted into check sub.
zro,	cla
	sas i ac
	jmp ego	/to check sub., return expected value
zb,	idx ac	/return from check
	sas lmc
	jmp zro
	jmp ers	/error summary in check sub.
ace,	lio (clc	/ones check
	jmp cmz
          
                                                                 
pdp,	463146	/checkerboard patterns
pap,	463146	314631	314631	463146
pbp,	631463
pcp,	631463	146314	146314	631463

ca,	lio (lac pap
	jmp cot
cb,	lio (lac pbp
	jmp cot
cc,	lio (lac pcp
	jmp cot
cd,	lio (lac pdp
	jmp cot
cac,	lio (lac pap
	jmp coc
cbc,	lio (lac pbp
	jmp coc
ccc,	lio (lac pcp
	jmp coc
cdc,	lio (lac pdp
	jmp coc

cot,	dio gtp	/common entry for checkerboard generate
	and (3
	add gtp
	dac gtp
gtp,	lac .
	dac i cln
	idx cln
	sas lma
	jmp cot
	jmp mde	/back to check sub.

coc,	dio ctm	/common entry for checkerboard check
	lio (jmp cbk
	dio rec	/plant into check sub.
	lio ctm
ch,	dio gpk
	and (3
	add gpk
	dac gpk
gpk,	lac .
	sas i ac
	jmp ego	/to check sub., return expected value
cbk,	idx cad
	dap ac
	sas lma
	jmp ch
	jmp ers	/error summary in check sub.
ctm,	.	/temporary 
          
                                                                 	/pairswaps

prs,	dap epr
	dzm q1
	cla
	sas wlf	/whether old random number or lat
	jmp .+10
	dra
	nop
	nop
	rcl 5s
	cla
	rcr 5s
	dio wld	/12-bit random number
	dzm wlf
	law 4000
	dac cor
	dac lim
	dzm dor
	law 2
	dac k
	law tcd
	jda tpa	/print title
	law wld
	jda tpo	/print octal values once only
psa,	law 1	/pairswaps again
	dac st
	lac (10000
	dac wf
	dac cpf
psw,	lac gn1	/pairswap write
	dac gnf
	lac ck1
	dac ckf
	lac (10000
	dac rf
pw,	jsp wdt	/write
	lac wf
	add (10000
	dac wf
	sad end
	jmp sw
	law 1
	sad st
	jmp pw	/again
          
                                                                  
ps,	lac gn2	/swap
	dac gnf
	lac ck2
	dac ckf
	jsp sdt
	lac wf
	dac cpf
	lac gn3
	dac gnf
	lac ck3
	dac ckf
	jsp rdt	/read to check
psi,	lac rf
	add (10000
	dac rf
	sad wf
	jmp psi
	sas end	/endrum
	jmp ps
	jmp psw

sw,	law 1
	sas st
	jmp ep	/to exit
	dzm st
	lac (10000
	dac wf
	lac gn3
	dac gnf
	lac ck2
	dac ckf
pr,	jsp rdt	/read
	lac cpf
	add (10000
	dac cpf
	sas end	/endrum
	jmp pr
	jmp psi

ep,	idx q1
	sas (1
epr,	jmp .	/exit
	law 4000
	dac dor
	jmp psa	/again

st,	.	/set, 0 when first enter, 1 when writing later
q1,	.	/determines first or second half of tests

gn1,	.
gn2,	.
gn3,	.	/loaded with appropriate jmps to generation

ck1,	.
ck2,	.
ck3,	.	/loaded with appropriate jmps to checkers

tcd,	flexo nor	/test code
dcd,	.	/data set code
          
                                                                 	/swaptests

spt,	dap esw
	dzm q2
	cla
	sas wlf	/whether old random number or lat
	jmp .+10
	dra
	nop
	nop
	rcl 5s
	cla
	rcr 5s
	dio wld	/12-bit random number
	dzm wlf
	law 2
	dac k
	law tcd
	jda tpa	/print title
	law wld
	jda tpo	/print octal
	dzm dor
	dzm eor
sa,	lac (10000	/swaptests again
	dac wf
	dac cpf
	dac rf
	law 4000
	dac cor
	dac lmb
	dac lim
	lio lmb
	sub sz1
	spa
	dio sz1
	lac lmb
	sub szl
	spa
	dio szl
lds,	lac gn1	/load set
	dac gnf
	lac ck1
	dac ckf
ld,	jsp wdt	/load, write all fields with data
	lac wf
	add (10000
	dac wf
	sas end
	jmp ld
	lac (jmp gr
	dac gnf
	lac ck2
	dac ckf
          
                                                                 
lok,	jsp rdt	/look, check data written in all fields
	lac cpf
	add (10000
	dac cpf
	sas end
	jmp lok
	lac w1
	dac wf
lps,	lac sz1	/loop set
	dac lim
int,	lac r1	/initialize read field
	dac rf
mat,	sad wf	/match
	jmp ru1
	sub rl
	sma
	jmp res
swt,	lac gn2	/switch
	dac gnf
	lac ck2
	dac ckf
	jsp sdt	/do swap
	lac wf
	dac cpf
	lac (jmp gr
	dac gnf
	lac ck3
	dac ckf
	jsp rdt	/check
	lac lim
	add sst
	dac lim
	add cor
	and (7777
	ior (4000
	dac cor
	add lim
	sub (i
	sma
	jmp .+6
	lac cor
	sub (4000
	add eor
	dac dor
	jmp lgr
	law 4000	/reinitialize
	dac cor
	jmp .-6
lgr,	cla	/longor
	sas lg
	jmp lgs
	lac szl
	sub lim
	spa
	jmp wto
ru,	lac rf	/read up
ru1,	add rst	/read up 1
	dac rf
	jmp mat
res,	sza i	/resume
	jmp swt
	cla
	sad lg
	jmp int
          
                                                                 
wto,	lac gn1	/write out
	dac gnf
	lac ck1
	dac ckf
	lac lmb
	dac lim
	lac eor
	dac dor
	law 4000
	dac cor
	jsp wdt	/write
	lac (jmp gr
	dac gnf
	lac ck2
	dac ckf
	lac wf
	dac cpf
	jsp rdt
	lac wf
	add wst
	dac wf
	sub wl
	spq
	jmp lps
	idx q2
	sas (1
esw,	jmp .	/exit
	law 4000
	dac dor
	dac eor
	jmp sa	/again

lgs,	lac szl	/long set
	sub lim
	sma
	jmp swt
	lac sz1
	dac lim
	jmp ru

q2,	.	/determines first or second half of tests
eor,	.	/holds value of dor
lmb,	.	/program variable
lg,	0	/long. =1, keep same rf and go thru all wf until
		/get to szl


sz1,	1	/initial size
sst,	1	/size step
szl,	4000	/size limit

r1,	010000	/initial read field
rst,	010000	/read field step
rl,	260000	/read field limit

w1,	010000	/initial write field
wst,	010000	/write field step
wl,	260000	/write field limit

	/the above 9 parameters can be altered by typewriter control
          
                                                                  	/dra dba test

d31,	dap ext
	law 3
	dac k
	law ln1	/type title
	jda tpa
	law 5
	dac k
	law ln2	/type subtitle
	jda tpa
	lac (dra
	dac trg
	dzm evl
	iot 20	/sure clock off
	cbs
	esm
	lac (jmp 3c
	dac 3	/for return after break
trg,	.	/dra, trigger
	nop
	cla
	rcl 6s
	rir 6s
	dio lin
1c,	dba
	lac tm	/timing loop
	cma
	dac tmo
	isp tmo
	jmp .-1
	law i 0	/if loop ends before break occurs
	dac evl	/evl = all sevens
	lsm
	jmp fot

3c,	dra	/good return from break
	nop
	cla
	rcl 6s
	rir 6s
	dio lot
	lsm
	lac 2	/c(io) when break occured
	sad lin
	jmp 6b
	lac (666666	/if io different at break
	dac evl
6b,	lac lot
	sub lin
	dap ldl
	sma
	jmp dlt
	add (10000
	dap ldl	/value of del planted
dlt,	and (777770	/del test, if .<7, ok
	sza
	lac dlt
	dip evl	/put 0 or 2 into ip
          
                                                                 
fot,	lac tmo	/forceout
	add tm
	dac tmo	/normalize
	senseswitch 1
	jmp itb
	szs i 30	/print out only if errors
	jmp otp
	lac evl
	sza i
	jmp itb
otp,	law evl	/output, print octal line
	jda tpo
itb,	szs i 60	/iterate
	jmp sqn
	szf 1
	jmp tst	/to typewriter control
sqn,	lac trg
	sza i
	jmp ent
	dzm trg	/initialize
	dzm lin
	jmp gdb

ent,	idx lin	/end test
	sad (10000
	jmp ots
gdb,	lio lin
	cbs
	esm
	jmp 1c

ots,	lsm	/outside
ext,	jmp .	/exit

ln1,	text .dradbatst.
ln2,	text .ertbegenddeltme.

evl,	.	/error-type value
lin,	.	/location in address
lot,	.	/location out address
ldl,	.	/location del (= | out - in| )
tmo,	.	/time out, time

decimal
tm,	2333	/timer for ~ 40 ms.
octal
          
                                                                 	/hot swap tests -- hot swap and one word hotswap
	/hot swap (2000 words) -- lio positive number
	/one word hot swap -- lio negative number
	/enter by jsp hs

hs,	dap hxt	/hot swap
	spi
	jmp 1wd
	law 3
	dac tts
	law 2000
	dac bsz
	law hr
	dap stg
	law dxt
	dap stp
	law mde
	dap htg
	law hrc
	dap htp
	law slh
	dap slp
	jmp hst

1wd,	law 5	/one word hotswap
	dac tts
	law 1
	dac bsz
	law sme
	dap stg
	dap htg
	law nme
	dap stp
	dap htp
	law sl1
	dap slp

hst,	dzm htm	/common entry
	dzm swr
	lac tts
	dac k
	law htt
	jda tpa	/print title
          
                                                                 
hbe,	law 4000	/hot back (again)
	dac lim
	dac cor
	lac sf
	dac rf
	dac wf
	dac cpf
	clf 5
	lac stg
	dac gnf	/hr or sme
	lac htp
	dac ckf	/hrc or nme
	law 2
	dac k
	law htm
	jda tpo	/print octal
	cla
	sas wlf	/old random number or lat
	jmp .+10
	dra
	nop
	nop
	rcl 5s
	cla
	rcr 5s
	dio wld	/12-bit random number
	dzm wlf
	law wld
	jda tpo	/type random octal

	dzm q4
	dzm dor
	jsp wdt	/write first field
	lac wf
	add (10000
	dac wf
	lac stp
	dac ckf	/dxt or nme
	lac htg
	dac gnf	/mde or sme
wtl,	jsp wdt	/writeloop, rest of fields
	lac wf
	add (10000
	dac wf
	sas ef
	jmp wtl	/again
	idx q4
	sas (1
	jmp ewl	/end write loop
	law 4000
	dac dor
	lac sf
	dac wf
	jmp wtl	/for second half
          
                                                                  
ewl,	lac ef	/end write loop
	sub (10000
	dac wf
	lac bsz
	dac lim
	clf 3
	stf 4
	jmp i slp	/slh or sli

slh,	dra	/swap loop for hotswap
	nop
	nop
	swap
	add adv
	and (7777
	add wf
	swap
	dia
	law 2000
	add rf
	swap
	and (1777
	add (4000
	jmp slc

sl1,	dra	/swap loop for one word
	nop
	nop
	swap
	add adv
	and (7777
	add wf
	swap
	dia
	law 1
	add rf
	swap
	ior (4000
	dac 4000
	law 4000

slc,	dcc	/swap loop common
	stf 5
	lio sf
	lac rf
	add (10000
	dac rf
	lac wf
	add (10000
	dac wf
	sad ef
	dio wf
	lac rf
	sas ef
	jmp i slp	/slh or sl1
	dio rf
	idx swr
	sad lmt
	jmp otl
	szf 5
	jmp otl+2
	jmp i slp	/slh or sl1
          
                                                                 
otl,	dzm swr	/outloop
	idx htm
	lac (jmp mde
	dac gnf
	lac htp
	dac ckf	/hrc or nme
	law 4000
	dac lim
	dac cor
	dzm q4
	dzm dor
rdl,	jsp rdt	/read loop
	idx q4
	sas (1
	jmp .+4
	law 4000
	dac dor
	jmp rdl
	lac cpf
	add (10000
	dac cpf
	sas ef
	jmp rdl-2
	senseswitch 2	/up for hotswap, down to end
	jmp hbe
	clf 5
hxt,	jmp .	/exit

htt,	text .hotswptstonewrd.
tts,	.	/tittlesize, 3 or 5
htm,	.	/hot time, counter
swr,	.	/swap iteration, counter

sf,	10000	/startfield
ef,	270000	/endfield
bsz,	.	/blocksize, 4000 or 1

adv,	100	/advance, hotswap parameter
lmt,	.	/limiter - 150 or 400
q4,	.	/determines first or second half
slp,	.	/slh or sl1

stg,	jmp .	/hr or sme (gnf before first write)
stp,	jmp .	/dxt or nme (ckf after first write)
htg,	jmp .	/mde or sme (gnf after first write)
htp,	jmp .	/hrc or nme (ckf before first write + for read)
start
          
                                                                 	/drum diagnostic controls

tst,	stf 6	/testset, enter typewriter control
	jsp tr
	law ct1
	jmp scn

nst,	jsp tr	/for preprogram
	law ct2
	jmp scn

nor,	lac (jsp prs	/normal
	dac gtg
	lac (flexo nor
	dac tcd
nrv,	lac (flexo srd	/common entry for nor and var
	dac dcd
	lac sb
	dac gn1
	lac sbc
	dac ck1
	dac ck2
	lac rb
	dac gn2
	lac gr
	dac gn3
	lac rbc
	dac ck3
	dzm wlf
	szf i 6
	jmp sxt
ex,	jsp tr
	law ct3
	jmp scn

dne,	jsp tr	/done
	law ct5
	jmp scn

tsc,	jsp frm	/testcall
gtg,	jsp .
gpp,	jsp frm	/go to preprogram
	jmp pre

bf,	.
bf2,	.
lgf,	.
rfl,	.
wlf,	0	/determines whether dra or lat for random
hif,	260000
          
                                                                 
frm,	dap .+7	/format
	lio (77
	tyo
	lio (72
	tyo
	clf 6
	clf 1
	jmp .

var,	lac (flexo var	/variable
	dac tcd
	dzm lgf
vrl,	lac (10000
	dac w1
	dac wst
	lac hif
	dac wl
vr1,	lac (10000
	dac r1
	dac rst
	lac hif
	dac rl
vr2,	law 4000
	dac szl
	law 1
	dac sz1
	dac sst
	dac lg
	sas lgf
	dzm lg
	lac (jsp spt
	dac gtg
	jmp nrv

1ts,	lac (flexo one	/one test
	dac tcd
	dzm lgf
	dzm rfl
f1,	jsp tr	/field one
	law ct6
	jmp scn
          
                                                                 ft1,	lac bf	/f test, first digit
	sad (20
	cla
	rar 6s
	dac bf2
	jsp tr
	law ct7
	jmp scn

ft2,	lac bf	/f test, second digit
	sad (20
	cla
	rar 6s
	dac bf
	lac bf2
	ral 3s
	add bf
	dac bf2
	jsp tr
	law ct8
	jmp scn

ntf,	lac bf2	/enter first field
	sza i
	jmp ein
	sub (270000
	sma
	jmp ein
	lac tcd
	lio bf2
	sas (flexo one
	jmp nt2
	dio w1
	dio wl
	lac (010000
	dac wst
	dzm lgf
	jmp vr1

nt2,	idx rfl	/enter second field
	sas (2
	jmp hfd
	dzm rfl
	dio r1
	dio rl
	lac (010000
	dac rst
	jmp vr2
          
                                                                 ht,	law 150	/hotswap
	dac lmt
	lac (jsp hsj
	jmp .+4
ot,	law 1400	/one word hotswap
	dac lmt
	lac (jsp h1j
	dac gtg
	law 36	/determined experimentally
	dac adv
ota,	jsp tr
	law ct9
	jmp scn

hsj,	dap .+6
	lio (+1
	jmp .+3
h1j,	dap .+3
	lio (-1
	jsp hs
	jmp .

ho,	jsp tr
	law ct0
	jmp scn

avc,	lat	/advance parameter change
	dap adv
	jmp ho

nc,	lat	/limiter number change
	dac lmt
	jmp ho

hwd,	lat	/hot wild, random number
	dap wld
	dac wlf
	jmp ho

bt,	lac (jsp d31	/to dra dba
	dac gtg
	jsp tr
	law ct9+2
	jmp scn

hfd,	dio w1	/half done
	dio wl
	lac (010000
	dac wst
	jmp f1

2ts,	lac (flexo two	/two test
	dac tcd
	law 1
	dac lgf
	dzm rfl
	jmp f1
          
                                                                  
jr,	law 0
	lio (flexo srd
	jmp jdt
js,	law 2
	lio (flexo snd
	jmp jdt
jc,	law 10
	lio (flexo scd
	jmp jdt
jd,	law 12
	lio (flexo sdd
	jmp jdt
je,	law 14
	lio (flexo sed
	jmp jdt
jf,	law 16
	lio (flexo sfd
	jmp jdt
jo,	law 4
	lio (flexo sod
	jmp jdt
jz,	law 6
	lio (flexo szd
	jmp jdt

jdt,	dio dcd	/j data
	add (lac rb
	dac loc
loc,	lac .	/some jmp instr.
	dac gn2
	idx loc
	xct loc
	dac ck3
spe,	jsp tr	/special
	law ct4
	jmp scn
          
                                                                 
v0,	lat
	rar 6s
	dac r1
	jmp spe
v1,	lat
	rar 6s
	dac rst
	jmp spe
v2,	lat
	rar 6s
	dac rl
	jmp spe
v3,	lat 
	rar 6s
	dac w1
	jmp spe
v4,	lat
	rar 6s
	dac wst
	jmp spe
v5,	lat
	rar 6s
	dac wl
	jmp spe
v6,	lat
	dac sz1
	jmp spe
v7,	lat
	dac sst
	jmp spe
v8,	lat
	dac szl
	jmp spe
v9,	lat
	dap wld
	dac wlf
	jmp spe
          
                                                                 
tr,	dap rxt	/type read
	listen	/type in
	dio bf
rxt,	jmp .	/read exit

scn,	dap .+1	/scan
fch,	lac .	/fetch, one of ct's
	dap jup
	ral 6s
	and (77
	sad bf
jup,	jmp .
	sad (76
	jmp ein
	idx fch
	jmp fch

ein,	lac (357421	/red,uc,?
	lio (347277	/black,lc,cr
	repeat 6, rcl 6s	tyo
	jmp tst


ct1,	disp 00,tst	/dispatch table
	disp 77,tst
	disp 74,nst
	disp 45,nor
	disp 25,var
	disp 01,1ts
	disp 02,2ts
	disp 70,ht
	disp 26,ot
	disp 62,bt
	disp 76,0

ct2,	disp 00,nst
	disp 77,tst
	disp 20,gpp
	disp 76,0

ct3,	disp 00,ex
	disp 77,tst
	disp 74,dne
	disp 51,jr
	disp 22,js
	disp 63,jc
	disp 64,jd
	disp 65,je
	disp 66,jf
	disp 46,jo
	disp 31,jz
	disp 21,spe
	disp 76,0
          
                                                                 

ct4,	disp 00,spe
	disp 77,tst
	disp 74,dne
	disp 20,v0
	disp 01,v1
	disp 02,v2
	disp 03,v3
	disp 04,v4
	disp 05,v5
	disp 06,v6
	disp 07,v7
	disp 10,v8
	disp 11,v9
	disp 21,spe
	disp 76,0

ct5,	disp 00,dne	/from dne
	disp 77,tst
	disp 67,tsc
	disp 76,0

ct6,	disp 00,f1	/for 1ts and 2ts
	disp 77,tst
	disp 20,ft1
	disp 01,ft1
	disp 02,ft1
	disp 03,ft1
	disp 04,ft1
	disp 05,ft1
	disp 06,ft1
	disp 07,ft1
	disp 76,0

ct7,	disp 20,ft2
	disp 01,ft2
	disp 02,ft2
	disp 03,ft2
	disp 04,ft2
	disp 05,ft2
	disp 06,ft2
	disp 07,ft2
ct8,	disp 77,tst
	disp 33,ntf
	disp 00,ntf
	disp 76,0

ct9,	disp 21,ho	/for hotswap
	disp 00,ota
	disp 00,bt+2
	disp 77,tst
	disp 74,dne
	disp 76,0

ct0,	disp 00,ho
	disp 21,ho
	disp 11,hwd
	disp 61,avc
	disp 45,nc
	disp 74,dne
	disp 77,tst
	disp 76,0
          
                                                                 
pre,	clf 1	/preprogram
	clf 6
	idx tpt
tpt,	xct tpt	/testpoint
	jmp rdm
	jmp snm
	jmp srn
	jmp rha
	jmp rhb
	jmp rhc
	jmp rhd
	jmp rsm
	jmp rze
	jmp rn1
	jmp 1ze
	jmp hsg
	jmp zrn
	jmp h1g
	jmp var
	jmp 31g
	jmp lsw
	jmp rse

rse,	law tpt	/reset
	dap tpt
	jmp pre

lsw,	lac (flexo all	/longswap
	dac tcd
	law 1
	dac lgf
	jmp vrl

sxt,	jsp spt	/swap exit
	jmp pre
          
                                                                 
snm,	law 202	/same name
	lio (flexo snd
	jmp prm
rdm,	law 0	/random
	lio (flexo rnd
	jmp prm
srn,	law 200	/same rand
	lio (flexo srd
	jmp prm
rha,	law 10	/r checkera
	lio (flexo rcd
	jmp prm
rhb,	law 12	/b
	lio (flexo rdd
	jmp prm
rhc,	law 14	/c
	lio (flexo red
	jmp prm
rhd,	law 16	/d
	lio (flexo rfd
	jmp prm
rsm,	law 2	/rand same
	lio (flexo rsd
	jmp prm
rze,	law 6	/rand zero
	lio (flexo rzd
	jmp prm
rn1,	law 4	/rand one
	lio (flexo rod
	jmp prm
1ze,	law 406	/one zero
	lio (flexo ozd
	jmp prm
zrn,	law 604	/zero one
	lio (flexo zod
	jmp prm
          
                                                                 
rb,	jmp rnd
rbc,	jmp snd
sb,	jmp sme
sbc,	jmp nme
	jmp one
	jmp ace
	jmp zrs
	jmp oht
	jmp ca
	jmp cac
	jmp cb
	jmp cbc
	jmp cc
	jmp ccc
	jmp cd
	jmp cdc
31g,	clf 1	/dra dba go
	jsp d31
	jmp pre

prm,	dio dcd	/parameter, for pairswaps
	lio (flexo nor
	dio tcd
	cli
	rcr 6s
	add (lac rb
	dac bac
	cla
	rcl 6s
	add (lac rb
	dac for
bac,	lac .	/back
	dac gn1
	idx bac
	xct bac
	dac ck1
	dac ck2
for,	lac .	/fore
	dac gn2
	idx for
	xct for
	dac ck3
	lac gr
	dac gn3
	jsp prs
	jmp pre

hsg,	clf 1	/hotswap go
	lio (+1
	law 320
	dac lmt
s1c,	law 36
	dac adv
	jsp hs
	jmp pre
h1g,	clf 1	/hot one go
	lio (-1
	law 300
	dac lmt
	jmp s1c
          
                                                                  	/end of drum test

c,	constants
start tst
          
                                                                                                                                                  

