
Tape deck check

twe,	tra ntr

mb,	cla
	sto FAC
	add LOC
	add one
	sto loc

mbe,	load mb1, sto out+1

mbk,	clad RAN
	llr (335671
	cry+cyr-opr
	sto ran
mb1,	xx		|sto out
	clad mb1
	add one
	sto mb1
	add ET1
	trn mbk
	move loc, out

mb2,	load GBG, 134562
	load UPC, -nsd+1
	wrs 1
	cpf

upd,	clad upc
	add one
	move gbg, gbg
	sto upc
	trn upd
	load ra, llr out

ra1,	cla
	repeat 6, opr
	llr gbg
	tra .+1
	slr gbg
ra,	xx		|llr out
	cla+cop
	add ra
	add one
	sto ra
	add ET2
	trn ra1
	repeat 3, opr

rz,	rpf 50
	sto TT
	trn ok
	tslr wr
	tra a1
	text |wrs flags= |
a1,	add tt
	tslr opt
ax,	clad (101001
	pno

ok,	cla+cpf-opr
	bsr 1
	tac+com-opr
	repeat 4, cyl
	sto tt
	trn ok1
	llr (16000
	afz
	trn ok1
	tslr wr
	tra oka
	text |bsr flag |
oka,	rpf
	tslr opt
	add (101001
	pno

ok1,	cla+cpf-opr
	llr (123456
	clear in, in+2000
	load rt, slr in
	rds 1
	clad tt
	trn ok2
	rpf 50
	trn ok2
	tslr wr
	tra okb
	text |rds flag |
okb,	rpf
	tslr opt
	add (101001
	pno
	hlt
	tra ok

ok2,	cpf+lro-opr

rl,	cpy
rt,	xx		|slr in
	cal
	add rt
	add one
	sto rt
	add ET3
	trn rk
	rpf
	sto tt
	add (760000
	trn rl
	clad (-10000
	add one
	trn .-1
	tslr wr
	tra a2
	text |false eor,read |

a2,	llr rt
	lcc
	add (slr in
	com
	tslr opt
	tslr wr
	tra ae
	text | words,  |
ae,	tra a3

rk,	clad (-30
	add one
	trn .-1
	rpf
	sto tt
	add (360000
	trn rfk
	tslr wr
	tra a3
	text |no eor on read,|
a3,	add tt
	tslr opt
	add (101001
	pno

gbt,	add (-4000
	rpf-cla+opr-10
	trn tlo		|if ok
	tslr wr
	tra g1
	text |read rwc |
g1,	add loc
	tslr opt
	add (101001
	pno
	tra mb2		|rwc, write again with no bsr

tlo,	clc
	add in
	trn foo
	com
	add loc
	sto TSI
	add (2
	trn foo
	add (-1
	trn mb2		|read loc one larger than wrote, rewrite
	add (-1
	trn gbo		|ok
	add (-1
	trn ok1		|read loc one less than wrote, read next record
foo,	tslr wr		|lose infinitely
	tra fo2
	text |wrote |
fo2,	add loc
	tslr opt
	tslr wr
	tra fo3
	text |,read |

fo3,	add in
	tslr opt
	add (101001
	pnc
	add in
	trn gbo		|check to see if blank record read
	tra bc3		|start over

gbo,	llr gbg
	add (134562
	lpd
	trn gbl
	amz
	trn rfz
gbl,	tslr wr
	tra a5
	text |gbg loses: |
a5,	add gbg
	tslr opt
	add (101001
	pno

rfz,	load ks, tra kp
	clc
	sto ZRI
	sto ERI
	add (add in
	tra kb

rfk,	tslr wr
	tra a7
	text |read flags= |
a7,	tra a3

kp,	load ks, llr k1
	stz eri
	tac+com-opr
	trn k
	tslr wr
	tra kp1
	text |
word	read	wrote	lpd

|
kp1,	tra ks

kl,	cal		|compare write with read
k1,	xx		|add in
	trn k2
	amz
	trn k
	slr zri
k2,	xx		|llr out
	lpd
	trn .+3
	amz
	trn kck
	sto tt

ks,	xx		|first error switch
	tac+com-opr
	trn k
	lcc
	add (add in
	com
	tslr opt
	add (101+200202
	pnt
	pno
k3,	xx		|add in
	tslr opt
	add (100101
	pno
k4,	xx		|add out
	tslr opt
	add (100101
	pno
	add tt
	tslr opt
	add (101001
	pno

k,	stz eri
kck,	clad k1
	add one
kb,	sto k1
	sto k3
	add (out-in
	sto k4
	add (llr-add
	sto k2
	com
	add rt
	add (llr-slr+out-in+trn-1
	trn kl
	llr zri
	lcc
	trn kte
	tslr wr
	tra kte
	text |no words read.
|

kte,	clad loc
	tslr opt
	add eri
	trn rok
	tslr wr
	tra ke1
	text | fail |
ke1,	add fac
	add one
	sto fac
	tslr opt
	tac
	repeat 3, cyl
	trn try

bc,	clad (101001
	pno

bc1,	tac
	llr (3777
	anc
	add (-sto-out
	sto et1
	add (-llr+sto
	sto et2
	add (llr out-slr-in-1+trn
	sto et3
	tac
	cyl
	trn bc2
	cyl
	trn mb
bc3,	hlt+cal-opr
	tra bc1

bc2,	cyl
	trn bc4
	rew 1
	stz loc
	tra mb

bc4,	clc
	add loc
	trn mb
	bsr 1
	tra mbe

rok,	tslr wr
	tra ro1
	flex  ok
ro1,	tra bc

try,	clad fac
	add (-3
	trn ax
	tra bc

ntr,	rew 1
	cpf+cla-opr
	sto fac
	sto loc
	tra bc3

|Octal print subroutine.

opt,	sto T
	lac
	add (-llr-rz
	trn opf
	add (rz-ntr+trn
	trn opf
	add (tra-trn+ntr+2
	sto opx
	load opu, trn opj

opq,	llr t
	lal
	cyl
	cyl
	sto t
	llr (7
	ana
	llr opj+2
	add (add fch
	sto .+1
	xx

opu,	xx
	slr opu
	pno

opj,	cla
	add opc
	cyr
	sto opc
	trn opq
	cyl
	trn opq-1
	cal
opx,	xx

opc,	171717

fch,	flex  0t-add-fch
	flex 11 -add-fch-1
	flex 22 -add-fch-2
	flex 33 -add-fch-3
	flex 44 -add-fch-4
	flex 55 -add-fch-5
	flex 66 -add-fch-6
	flex 77 -add-fch-7

opf,	cla
	print flex ip 
	add t
	hlt
	tra ntr

|Write subroutine.

wr,	lac
	add (2
	sto wr1
	add one
	sto wr2
	add (-llr-rz-3
	trn wrf
	add (rz-ntr+trn
	trn wrf

wr1,	xx
	slr wrx
	lcc
	add (tra-llr+1
	sto wr1

wr2,	xx
	lac+lro-opr
	type
	step wr2
	add wr1
	trn wr2
	cal
wrx,	xx

wrf,	cla
	print flex iw 
	hlt
	tra ntr

one,	1

vari
const

nsd=62
out=2000
in=5000

start add ntr
v