
midas mag tape patch

noinput

word trn 17756

1mk=6230

20|	tsx 1mk

rf1|	tra 1ma

rf2|	tra 1mb

ps2+2|	opr

s2+5|	tra 1mf

np1|	tra 1mc

1st+2|	tra 1md

pun|	tra 1mh

cnd+3|	tra 1me

1mk|	lda (-10
	tac-cla+opr
	sto mtp
	tac
	trx

1mc,	ldx pss
	tix .+2
	stz 2md
	stz 2mf

3mc,	rew 1
	tsx 1mk
	lda (3
	sto 5mb
	cal+com-opr
	tra np1+1

1md,	tsx pub
	ado 2md
	hlt+cal-opr+1
	tra ps2

1me,	lda nca
	stz nca
	ldx pss
	tix cnd+4
	ldx (3
	shr
	tix .-1
	add 5mb
	sto 5mb
	tra cnd+4

1mf,	ado 2mf
	com
	add 2md
	tze 3mf
	tra np2

3mf,	wtb 1
	lda t3
	add (add
	cpyUalr
	wtb 1
	bsr 1
	rtb 1
	cpyUlpd
	tze s2+6
	bsr 1
	tra 3mf

1ma,	load 3ma, -4
	lda mtp
	tze .+3
	lda pss
	tze 2ma
	wtb 1

4ma,	rtb 1
	cpy+lcc-opr
	add 1mb+6
	tze .+2
	tra 5ma
	lac
	cpyUladUxro
	slr wc1
	aux (-flx
	cpyUlad
	slx flx
	tix .-2
	cpyUlad
	slr wcc
	cpyUlcd
	tze 4mb
	bsr 1

5ma,	ado 3ma
	trn 4ma
	hlt
	tra 4ma

1mb,	lda mtp
	tze 4mb
	ldx 5mb
	wtb 1
	tix .-1
	lda .+1
	cpy+alr-opr
	lda wc1
	alr+cpy-opr+1
	aux (-flx
	add .-4
	sto 2mb

3mb,	lax flx
	alr+cpy-opr
	add 2mb
	sto 2mb
	tix 3mb
	lda wcc
	alr+cpy-opr
	add 2mb
	alr+cpy-opr
	wtb 1
	bsr 1
	ldx wc1
	aux (-flx+3
	rtb 1+cla-opr
	cpy+lad-opr
	tix .-1
	cpy+lcd-opr

4mb,	llr (3
	slr 5mb
	llr wcc
	tze rf2+1
	bsr 1
	ado 3ma
	trn 1mb+1
	clc
	alr+hlt-opr
	tra 1mb+1

1mh,	lda loc
	com
	add org
	tze 4mh
	load 3ma,-4

2mh,	load 3mh,lda org+2
	wtb 1
	lda org
	cpy+alr-opr
	lda loc
	com
	add (1
	cpy+alr-opr+1
	aux org
	add org
	sto cks
	sto t1

3mh,	xx
	cpy+alr-opr
	add cks
	sto cks
	ado 3mh
	tix 3mh
	lda cks
	com
	cpy+alr-opr
	wtb 1
	bsr 1
	ldx t1
	aux (-3
	rtb 1+cla-opr
	cpy+lad-opr
	tix .-1
	tze 4mh
	bsr 1
	wtb 1
	ado 3ma
	trn 2mh
	clc
	alr+hlt-opr
	tra 2mh

2ma,	stz wcc
	tra rf1+1

4mh,	lda pss
	tra pun+1

3ma,	0
2mb,	0
5mb,	0
cks,	0
2mf,	0
2md,	0
mtp,	0

	constants

start add ps3
