
Macro ii-a=part 1

	npi=12	ncn=16	nmi=200	nfw=700	nds=70	nsy=75


5400|		dsm,	|Dummy symbols
	dsm+nds|dss,	|Argument translation indicators
	dss+nds|dsp,	|M-I parameter values
	dsp+nds|dsv,	|M-I argument values
	dsv+nds|cor,	|List of constant origins
	cor+ncn+ncn+1|cks,	|Check sum
	cks+1|	org,	|Block origin
	org+1|	loc,	|Current location
	loc+101|flx,	|Input character block storage
	flx+nfw|ftp,	|Character constants for title punch
	ftp+200|psi,	|Pseudo-instruction list
	psi+nmi+nmi+nmi|mai,|Macro-instruction storage
	17740|	low,	|Symbol table - end


20|

|Start over entry

	tac
	trn so1
	clc
sov,	xx

so1,	ala
	add (sto pss
	sto so3
so2,	lal
	trn so4
	alc
	tra so3

so4,	ala
	add one
so3,	xx
	clad so3
	add one
	sto so3
	add (-sto-tit
	trn so2
	lal
	llr (tra .+2
	trn rm
	llr npa
	lcc
	trn np2

so5,	add pss
	trn ps1
	tra ps4

|Reset to convert next word

rnw,	cal+com-opr
	slr wrd
	slr syl
	slr nsm
	slr amn
	slr asa
	sto cni
	sto dsi
	sto dsn
	add one
	sto def

sp,	load sgn, opr
	slr sga
	cla
	sto let
	sto liu
	sto num
	sto sym
	sto chc

|Read and condense one character

r,	call rch

cfc,	lal
	ala
	add (666660
	cry
	ala
	add (666660
	cry
	ala
	add (666740
	cry
	ala
	add (666000
	cry
	ala
	add (666000
	cry
	cll

cf5,	xx

|Dispatch on character value

	sto rt
	clc
rt,	xx

|Character dispatch table

dtb,	trn i	|blank tape
	trn i	|not used
	trn l	|e
	trn n-8	|8
	trn i	|not used
bt,	xx	||
	trn l	|a
	trn n-3	|3
	trn p	|space
qt,	xx	|=
	trn l	|s
	trn n-4	|4
	trn l	|i
	trn p	|+
	trn l	|u
	trn n-2	|2
	trn r	|color
	trn d	|.
	trn l	|d
	trn n-5	|5
	trn l 	|r
	trn n-1	|1
	trn l	|j
	trn n-7	|7
	trn l	|n
	trn ca	|,
	trn l	|f
	trn n-6	|6
	trn l	|c
	trn m	|-
	trn l	|k
	trn i	|not used


	trn l	|t
	trn i	|nu
	trn l	|z
kt,	trn i	|backspace
	trn l	|l
tt,	xx	|tab
	trn l	|w
	trn i	|nu
	trn l	|h
	trn tt	|carriage ret.
	trn l	|y
	trn i	|nu
	trn l	|p
	trn i	|nu
	trn l	|q
	trn i	|nu
	trn l	|o
	trn r	|stop
	trn l	|b
	trn i	|nu
	trn l	|g
	trn i	|nu
	trn n-9	|9
	trn i	|nu
	trn l	|m
	trn rcu	|upper case
	trn l	|x
	trn i	|nu
	trn l	|v
	trn rcl	|lower case
	trn n	|0
rdt,	trn r	|nullify

rcu,	add one

rcl,	sto cas
	tra r

|Storage word termination characters (tab and carr ret)

tab,	add syl
	add chc
sv,	trn rnw
	call evl
	add pss
	trn tb3
	clad def
	trn ust

tb3,	clad aml
	add one
	sto aml

tb4,	clad loc
	add mon
	sto loc

tb2,	clad wrd

ts,	xx
	add cks
	sto cks
	llr loc
	lcc
	sto wrd
	llr (77
	anl
	laz
	trn t9

tb1,	clad ts
	add one
	sto ts
	tra bs-1

t9,	clad pss
	trn bnp
	tra pun

|Location assignment termination character

b1,	add def
	com
	trn bnp
	llr (400000
	tra b3

b,	add syl
	add chc
	trn itc
	call evl
	add nsm
	com
	sto asi
	trn ba1
	llr asa
	slr asm
	llr amn
	slr aml

ba1,	clad pss
	trn b1
	clad def
	trn usb

b5,	add loc
	add org
	com
	trn bnp
	clad loc
	add wrd
	com
	trn pun
	amz
	trn bs

|Punch binary block.

pun,	clad pch
	trn bnp
	p6s
	add loc
	add one
	sto loc
	com
	ala
	add pub
	sto pua
	p6s
	p6s

pu,	cla
pua,	xx
	punch
	add pua
	add one
	sto pua
	add loc
pub,	add org
	add (-add-loc-1
	trn pu

	clad cks
	com+lad-opr
	punch
	p6s
	p6s

|Form origin for next block

bnp,	llr wrd
	lcc
	amz
	com
	llr (17777
	anl
	slr cks

b3,	slr org
	lcc
	sto loc
	load ts, sto loc+1
	clc
bs,	xx


|Syllable separation characters (plus, minus, space)

p,	add chc
	add syl
	trn r
	cla
m,	sto t2
	call evl
	add one
	sto syl
	llr t2
	lcc
	trn sp
	llr (com
	tra sp+1

|Evaluate syllable and accumulate word value

evl,	slr ex
	clad mii
	trn wsp

ev2,	clad let
	trn el
	add num

sga,	xx
	add amn
	sto amn

en,	clad num
sgn,	xx
	add wrd
	sto wrd
	clc
ex,	xx

ndf,	sto def
	llr sym
	slr r2
	tra ex

el,	add sgn
	add (-opr
	trn el1

el2,	llr one
	slr nsm
	tra e2

el1,	clad nsm
	trn el2
	amz
	trn .+2
	tra e2
	llr sym
	slr asa
	sto nsm

|Evaluate symbol (logarithmic search)

e2,	load t1, 4000
	llr low
	slr ea
	slr ea1

e,	clad sym
	trn esm
	cla
ea,	xx
	trn et
	tra eup

esm,	cla
ea1,	xx
	trn edn
et,	add sym
	trn eqt

eup,	load e1, tra e1+1
	clad t1
	cyr
	sto t1
	add mon
	trn ndf
	add one

e1,	xx
	add ea
	sto ea
	sto ea1
em,	com
	add low
	com
	trn eup
	add low
	add (-add-low+1
	trn e

edn,	llr (com
	tra eup+1

eqt,	add one
	trn edn
	add ea
	sto e4
	cla

e4,	xx
	sto num
	tra en


|Relative address syllable (.)

rl,	add chc
	llr sgn
	trn .+2
	llr (opr
	slr rl3
	llr loc
	lcc

rl3,	xx
	add wrd
	sto wrd
	llr one
	slr syl
	llr mii
	lcc
	trn r
	add rl3
	add (400001-com
	trn rl4
	add (-400000+com-opr

rl4,	subr prs, r

|Process alphabetic or numeric character

l,	sto let
	add cas
	trn ln
	clc
	sto liu
	tra ln

l2,	clad sym
	cyr
	add t
	sto sym
	tra r

n-9,	add mon
	add mon
	add mon
	add mon
	add mon
	add mon
	add mon
	add mon
	add mon
n,	com
	ala

n2,	add num
	cyl
	sto num
	cyl
	cyl
n1,	xx
	lad
	sto num
	cla

ln,	add chc
	add one
	sto chc
	add (-3
	trn l2
	llr let
	lcc
	trn r
	sto num
	sto let
	sto chc
	add one
	sto syl
	llr sym
	slr api

|Read three more characters for P-I or M-I

	llr t
	slr syn
	load t1, 2
	subr rch, ln1

ln4,	add one
	trn ln3
	tra rch+1

ln1,	cyr
	add (775777
	trn ln2
	add (777575
	trn ln2
	add (762201
	trn ln4
	add (775575
	trn ln2
	add (621777
	trn ln2
	add (776177
	trn ln2

ln3,	clad t1
	trn rch+1
	add mon
	sto t1
	clad syn
	cyr
	add t
	sto syn
	tra rch+1

ln2,	add one
	trn ln3

|Search for pseudo or macro instruction

spi,	clc
	sto spz
	add psi
	add (add-3
	sto sp1
	llr sym

sp0,	lac
sp1,	xx
	trn sp3

sp2,	clad (-3
	add sp1
	sto sp1
	com
	add (add psi
	trn sp0

	clc
	add mdi
	trn dmi
	clc
	add spz
	trn ipi
	tra sp4

sp3,	add one
	trn sp2
	sto spz
	add sp1
	sto sp5
	clad syn

sp5,	xx
	com
	trn sp2
	amz
	com
	trn sp2
	add mdi
	trn mdm

sp4,	add sp5
	sto sp6
	clc

sp6,	xx
	trn sp6-2
	tra mac

|Parameter assignment routine (equal sign).

q,	add syl
	com
	trn ipa
	add let
	com
	trn ipa
	llr sym
	slr t3
	load bt, tra ilf
	slr qt
	slr ct
	load tt, tra qq
	tra rnw

qq,	add chc
	add syl
	trn rnw
	call evl
	add pss
	trn q1
	clad def
	trn usq
	tra qq1

q1,	add def
	trn rst

qq1,	llr t3
	slr sym
	llr wrd
	slr t3
	clc
	sto let
	add one
	sto def
	call evl
	add def
	trn vsm
	add e4
	add (-add-1
	sto v7
	tra vs6

|Address tag routine.

c,	call evl
	add syl
	com
	trn c2
	cla
	sto asi
	sto aml
	add sym
	sto asm

c2,	llr loc
	lcc
	sto t3
	trn rnw
	clc
	add def
	trn c1
	add wrd
	lad
	trn mdt
	add mon
	trn rnw
	tra mdt

c1,	add syl
	com
	trn rnw


|Enter new symbol and value in symbol table

vsm,	clad low
	add (-2
	sto low
	add one
	sto v3
	add hih
	trn sce
	llr sym

vs1,	clad v3
	add one
	sto v5
	sto v1
	add one
	sto v3
	add (-add-3
	sto v2
	sto v6
	add one
	sto v4
	sto v7
	add (-low+2
	trn vs2

vs3,	lcc
v6,	xx
vs6,	clad t3
v7,	xx


|Reset terminating character switches

rst,	clad mii
	load ct, tra c
	trn rsm
	sto mdi
	load bt, tra b
	load qt, tra q
	load tt, tra tab
	tra rnw

rsm,	load bt, tra df2
	load qt, tra da
	load tt, tra sw
	tra rnw

vs2,	cla
v5,	xx
	lpd
	trn vs4
	lac
	trn vs3
vs5,	cla
v1,	xx
v2,	xx
	cla
v3,	xx
v4,	xx
	tra vs1

vs4,	cry
	trn vs3
	tra vs5

|Pseudo-instructions octal, decimal, and noinput

oct,	add (opr
	tra dec+1
dec,	add n2
	sto n1
	tra noi+1
noi,	sto ini
	cla
	sto syl
	llr t
	tra cfc

|Pseudo-instruction character

ch,	call rch
	cyr
	llr .-1
	add (757577
	trn ch1
	llr (cyl
	add (617777
	trn ch1
	llr (opr
	add (756177
	trn ch1
	tra ilf

ch1,	add one
	trn ilf
	slr ch4
	call rch
	cyr
ch4,	xx
	sto num
	tra r

|Pseudo instruction flexo

fx,	cla
	sto num
	llr .
	slr t1
	call rch
	lal
	add num
	cyr
	sto num
	llr t1
	lal
	sto t1
	trn rch+1
	tra r

|Pseudo-instruction text

txt,	load txv, llr (tra txq
	load txx, trn rch+1
	call rch
	com
	sto t2

txq,	cla
	sto wrd
	llr .
	slr t1

txw,	call rch
	add t2
	trn txk

txa,	lal
	add wrd
	cyr
	sto wrd
	llr t1
	lal+lro-opr
	sto t1

txx,	xx
txv,	xx
	slr bs
	clad mii
	trn mw
	tra tb3

txk,	add one
	trn txa
	load txv, llr (tra rnw
	load txx, trn txa
	load bs, tra rnw
	cal
	add t1
	trn txa
	tra rnw

|Restore

rm,	slr rmx
	load low, add low
	load psi, sto psi+npi+npi+npi+1
	load mai, sto mai+1
	load rst, tra rma
	clad (llr ist
	tra rmb

rm1,	xx
	lcc
	sto sym
rm2,	xx
	slr t3
	tra vsm

rma,	clad rm2
	add one
rmb,	sto rm1
	add one
	sto rm2
	add (-llr-ist-nsy-nsy
	trn rm1
	load rst, cla
rmx,	xx

|Pseudo-instruction start

sta,	load bt, tra ilf
	slr qt
	slr ct
	load tt, tra s
	llr t
	tra cfc

s,	add pss
	trn 1st
	call evl
	add def
	trn uss

s2,	llr wrd
	slr t3
	clad one
	add org
	add loc
	com
	trn s4
	load bs, tra s4
	llr loc
	lcc
	sto wrd
	tra pun

s4,	load sov, tra np2
	hlt+cal-opr
	add pch
	trn s6
	feed 40
	add (add-1
	add t3
	punch
	feed 100
	load sov, tra ps1

s6,	clc
	hlt+ala-opr
	subr rm, ps1

1st,	load sov, tra np2
	hlt+cal-opr

|Begin new pass

ps2,	add one
	sto pss
	sto pch
	sto tit
	llr ini
	slr inp

ps4,	llr psb
	slr psi
	clad psa
	llr mai
	sto mai
	tra np1

ps5,	call rm		|initial entry here
ps3,	llr mai
	slr psa
	llr psi
	slr psb
	load sov, tra ps2

s5,	clc
	sto pss
	hlt+ala-opr

ps1,	clc		|test start pass 1
	sto pss
	sto pch
	add one
	sto ini
	llr psi
	slr psb
	llr mai
	slr psa

np1,	lac		|begin pass
	add (add
	sto con
	com
	sto hih
	add one
	sto nco
	cla
	sto nca
	sto asm
	add one
	sto mii
	add (17
	sto cks
	sto org
	com
	sto loc
	add (cor+20
	sto cn6
	add one
	sto cn7
	add (add-1
	sto co7+1
	load n1, opr

np2,	cla
	sto fwd
	sto api
	load ts, sto loc+1
	load nfc, -add-flx
	load rc1, tra rc4
	load rf1, llr (tra rf4
	load rtv, tra rft
	slr rty
	load st2, opr
	load rc8, llr flx
	load bs, tra rnw
	clc
	sto cas
	add pss
	add pch
	add tit
	add (-2
	trn ptl
	feed 40

|Print and punch title

ptl,	load cf5, tra pt7
	tra pt2

pt1,	add one
	trn pt5

pt2,	call rch
	add (373773
	trn pt1
	add (337773-373773
	trn pt1

pt5,	lac
	cyr
	cyr
	alr
	add (776776
	trn ptq
	add (677777
	trn ptr

pt6,	lac
	pna
	add pss
	add pch
	add tit
	add (-2
	trn ptp
	llr t
	tra cfc

pt7,	cyl
	add (add ftp
	sto pt8
	add one
	sto pt9
	cla

pt8,	xx
	trn ptp
	ala
	p6s+lac-cla
	p6h
	p6a

pt9,	xx
	p6h
	p6h
	p6a

ptp,	subr rch, pt5

ptq,	add one
	trn pt6
	clc
	sto tit
	tra pt6

ptr,	add one
	trn pt6
	clc
	sto tit

|Print pass 1 or pass 2

pps,	add (char r
	pna
	add (flexo  -
	pnt
	pnt
	pnt
	pna
	add (flexo pas
	pnt
	pnt
	prt
	pna
	add pss
	trn pp1
	add (621644-1
	tra .+2

pp1,	add (625240
	pnl
	pnl
	pnl
	pna
	load cf5, add (tra dtb

|Punch input routine

	clad pss
	add pch
	add mon
	trn rst

pf2,	feed 40
	clad inp
	trn rst

pir,	llr 17760

pi2,	lac
	add one
	alr+com-opr
	add 17775
	trn pi3
	lac
	add 17774
	sto pi1
	lac
	punch

pi1,	xx
	punch
	tra pi2

pi3,	add (trn 17744
	p7h
	p7h
	p7a+com-opr
	sto inp
	tra pf2


start

m