
7094 tape dump and read


dump,	lax 1
	sto ul
	lax 0
	aux (3
	sxa rtn

tes,	sto ll
	add c377
	com
	add ul
	ldx ll
	sxa wordgt
	ldx .+1
	sxa get1
	trn .+2
ccla,	cla
	add c377
	sto nwrds
	trn endof

finis,	wtb 1
	cpf
	cpyUlro
	lda ll
	cpyUalr
	cpyUlro
	add nwrds
	sto enrec
	cpyUalr
	ldx nwrds
	tra .+2
loop,	ado wordgt
	cpyUlro
wordgt,	lda .
	cpyUalr
	tix loop
	wtb 1

out,	bsr 1
	ldx .+1
	sxa wordgt
	ldx ll
	sxa get1
	rtb 1
	cpy
	lda ll
	cpyUlcd
	tze .+2
	tra wer
	cpy
	lda enrec
	cpyUlcd
	tze .+2
	tra wer


	ldx nwrds
	tra .+2
cont,	ado get1
	cpy
get1,	lda .
	cpyUlcd
	tze .+2
	tra wer
	tix cont
wck,	llr (16000
	rpf 7
	tze out1
wer,	hltUalo
	ldx rtn
	aux (-1
	trx 0

out1,	ado enrec
	tra tes

endof,	ldx m5
	wtd 1
	tix .-1
	lda eof
	cpyUalr
	wtd 1
	ldx rtn
	trx 0


rtn,	0
eof,	4444
c377,	377

|routine to read 7094 tapes

read,	lax 0
	sto readn
	lax 1
	sto top
	aux (3
	sxa rtn
	stz error
	lda (ado readn
	sto readn+1
loop1,	llr m5
	slr rrd
loop2,	rtb 1
	cpf
	cpy
	cpyUlac
	cpy
	cpyUlcd
	axr
	lda readn
	sto save

loop3,	cpy
	com
	add top
	trn tcc
	cpyUlac
readn,	sto .
	ado .-1
	tix loop3


ck,	rpf
	tze .-1
	llr (16000
	ana
	tze loop1
	llr (10000
	ana
	tze erck
	bsr 1
	rtd 1
	lda eof
	cpyUlcd
	tze retn

erck,	ado rrd
	trn .+3
	ado error
	tra loop1
	bsr 1
	lda save
	sto readn
	tra loop2


tcc,	lda error
	com
	sto error
	lda ccla
	sto readn
	tra loop1-1

retn,	lda error
	ldx rtn
	trn .+2
	tze . 2
	aux (-1
	trx 0

ll,	0
ul,	0
nwrds,	0
enrec,	0
top,	0
error,	0
save,	0
rrd,	0

constants

m5,	-5



start





