
midas symbol punch

flx|

py,	tsx sav
	pss
	pch
	org
	loc
	rli
	rim
	bs
	tra .+1
py1,	load bs, tra
	load gcd+1, opr
	tsx gc
	load gcd+1, xcc
	stz rim
	stz rli
	stz t2
	move one, pss
	slr pch
	lda pun		|check for mag tape midas
	trn pzy

py3,	feed 30
py2,	cal 1
	lcc
	trn .-1
	add (624000
	tze pyt
	add (-624000+644000
	tze pyc
	lal
	ldx (6
	cyl
	tix .-1
	axr
	lax ftp-200
	trn py2
	p6h
	p6o
	lax ftp-200+1
	p6h
	p6h
	p6o
	p6s
	tra py2

pyt,	cal 1
	lcc
	trn .-1
	add (740000
	tze pym
	add (644000-740000
	tze pyc
	add (450000-644000
	tze pys
	tra py2

pym,	lda (2
pys,	add mon
	sto t2
	llr .+2
	slr .-2
	tra pyt

pyc,	feed 30		|c. r.
	lda (trn ls	|entry to symbol table readin routine
	punch		|  must be reassembled if Midas is changed
	feed 20
	lda (sto cor
	punch
	lda (-sto-cor-2
	punch
	lda cor
	punch
	lda cor+1
	punch
	ldx pd1		|pss
	lax cor+1
	punch
	ldx pd1
	lax cor+1
	add cor+1
	add cor
	add (-2
	com
	punch
	p6s
	p6s
	tra pzz

pzy,	lda (-40000
	tac-cla+opr
	tze py3
	stz pch
	move mon, t2
pzz,	stz rlc
	cla
	sto loc
	move .-1, ts
	slr tbc
	stz org
	init pza, low-3

pza,	llr		|sym l
	lal
	trn ppv
	cyr
	trn pzs
	lda t2		|macro
	trn pzi
	tra pzp


ppv,	cyr
	trn pzv		|variable

pzm,	ldx (nip+nip+nip-1	|pseudo-instr
pm4,	aux (-2
	lax ipt
	lcd
	tze pm2
pm3,	tix pm4
	tra pzp

pzv,	ldx pza
	lax 1
	trn pzp
	cyl
	trn pzi
	tra pzp

pm2,	lax ipt+1
	sxa t0
	ldx pza
	com
	adx 1
	tze pzi
	lax 2
	com
	ldx t0
	adx ipt+2
	tze pzi
	tra pm3

pzs,	clc		|symbol
	add t2
	com
	trn pzi
	ldx pza
	llx 1
	lax 0
	add (-trn
	tze .+2
	tra pzp
	ldx (nis+nis-1

pz1,	tix .+1
	lax ist
	lcd
	tze pz2
pz3,	tix pz1

pzp,	ldx pza		|punch symbol
	lax 0
	tsx ptw
	lax 1
	tsx ptw
	lax 2
	tsx ptw

pzi,	lda pza		|indexing
	add (-3
	sto pza
	com
	add low
	add (llr low
	trn pza
	stz wrd
	tsx enc
	tsx enc
	tsx enc		|denotes end
	tsx pub
	lda t2
	trn pzd
	init pzh, mai+1
	lda (-mai
	add mai
	tze pzd
	stz org
	stz loc

pzh,	lda		|punch macros
	sto wrd
	tsx enc
	ado pzh
	com
	add mai
	add (lda+trn
	trn pzh
	tsx pub
pzd,	lda pun
	com
	trn pzf
	wtb 1		|end of output
	lda (trn ps3
	cpyUalr
	wtb 1
pzf,	lda pch
	tze pz4
	feed 20
	lda (trn ps3
	punch
	feed 60
pz4,	tsx uns
	tra py1
	lda pss
	tze 1st
	tra s6

ptw,	sto wrd		|punch a word
	sxa ptx
	tsx enc
	ldx pza
ptx,	tra .

pz2,	sxa t0		|compare symvals
	ldx pza
	lax 2
	com
	ldx t0
	adx ist+1
	tze pzi
	tra pz3

constants

start add py
