
Macro ii-a=part 2.

|Pseudo instruction define


dfn,	add mii
	trn ilf
	load qt, tra ilf
	slr ct
	load tt, tra df1
	load bt, tra df2
	llr loc
	slr tlo
	clc
	sto loc
	sto asi
	sto mdi
	add psi
	sto dm3
	add one
	sto dm1
	add one
	sto dm2
	add (-sto-psi-nmi-nmi-nmi+1+trn
	trn tmm
	tra rnw

df1,	add syl
	add chc
	trn r
	tra ilf

df2,	add syl
	add chc
	trn itc
	tra ilf


|Pseudo instruction terminate

ter,	add mii
	com
	trn ilf
	add tlo
	sto loc
	clc
	sto asi
	add one
	sto mii
	add psi
	add (2
	sto psi
	call sco
	call sco
	call sco
	call sco
	llr sc3
	slr te9
	add scw
	tra .+2

te8,	lal
	ala
	add scn
	add one
	sto scn
	trn te8
	lac

te9,	xx
	tra rst


|Define macro instruction

dmi,	llr sym
	lcc

dm3,	xx
	llr syn
	lcc
dm1,	xx
	cla
	sto liu
	sto syl
	sto sym
	add mai
	sto sc3
	add one
	sto mai
	add (llr-1
dm2,	xx
	cal+com-opr
	sto mii
	clear dss+1, dsp+nds-1
	sto mdi
	slr scw
	load scn, -22
	load dsk, -add-dsm
	load ddx, tra rnw
	load ct, tra pd1
	load tt, tra pds
	llr t
	tra cfc

|Pick up dummy symbols

pds,	load ddx, tra rst
	clc
	add chc
	trn rst
	clc

pd1,	add syl
	com
	trn ids
	add let
	com
	trn ids
	add liu
	com
	trn ids

pd2,	add sym
	tra .+2

|Define new dummy symbol

dd,	slr ddx
	com
	ala
	add dsk
	add mon
	sto dsk
	add (add dsm+nds
	trn tmp
	com
	add (slr dsm+nds
	sto dd1

dd1,	xx
	add (-slr-dsm+1
ddx,	xx

|Search for dummy symbol

sds,	slr sdx
	load sd1, add dsm
	ala
	add sdx
	add one
	sto sdy

sd2,	lac
sd1,	xx
	trn sd4

sd3,	clad sd1
	add one
	sto sd1
	add dsk
	trn sd2
	clc
sdx,	xx

sd4,	add one
	trn sd3
	add sd1
	add (-add-dsm
sdy,	xx
m
|Prepare specifications for M-I words, constants, arguments

wsp,	llr liu
	lcc
	trn ev2
	add sgn
	sto ws4
	add (-opr
	trn ws1
	add (400000-40

ws1,	sto t1
	clad sym
	call sds
	tra uds
	add t1
	alr
	cll
	add (add dsp-1
	sto ws3
	cla
ws3,	xx
ws4,	xx		|sign operator
	add wrd
	sto wrd
	lac
	llr ex

|Prepare dummy symbol specification

prs,	slr prx
	ala
	sto dsi
	add dsn
	com
	trn pr2
	sto dsn
	lal
	add (377000
	cyl
	trn .-1
	clr
	sto dse
	clc
prx,	xx

pr2,	lal
	add dse
	sto dse
	llr prx
	tra ss

|Macro instruction storage word

sw,	add chc
	add syl
	trn rnw
	call evl
	add pss
	trn sw2
	clad def
	trn usm

sw2,	llr (tra rnw

mw,	slr tea
	llr one
	lac
	add aml
	sto aml
	lcc
	add loc
	sto loc
	subr ss, mca

|Macro instruction constant

rp5,	add pss
	trn rp7
	clad def
	trn rp8

rp7,	llr (tra rp3

mc,	slr tea
	cla
	sto num
	sto dsi
	call ss
	call sco
	call sco

mca,	subr scz, sma

rp8,	add (flex usc
	subr alu, rp7

|Dummy symbol assignment

da,	add syl
	com
	trn ipa
	add liu
	com
	trn ipa
	llr sym
	slr t3
	load bt, tra ilf
	slr qt
	slr ct
	load tt, tra da1
	tra rnw

da1,	add chc
	add syl
	trn rnw
	call evl
	add pss
	trn da3
	clad def
	trn usd

da3,	clad t3
	call sds
	tra dab
	add (400000

da5,	alr
	cll
	add (sto dsp-1
	sto day
	clad wrd

day,	xx
	lac
	llr (tra rst

mp,	slr tea
	sto t3
	call ss
	call sco
	call sco
	call sco
	call scz
	add t3
	tra sm-1

dab,	add t3
	subr dd, da5

|Macro instruction

mac,	sto aw
	llr dsk
	slr dsl
	llr loc
	lcc
	sto dsv
	load bt, tra ilf
	slr qt
	load tt, tra aev
	load ct, tra ae1
	load ae6, tra rnw
	load ae4, slr dsv
	cal
	sto tcn
	add (2-nds

ma1,	add (slr dsv+nds-1
	sto .+1
	xx
	add (-slr-dsv-nds+2
	trn ma1
	llr t
	tra cfc

|Evaluate macro instruction arguments

aev,	load ae6, tra am
ae1,	call evl
	add pss
	trn ae3
	clad def
	trn usp

ae3,	clad ae4
	add one
	sto ae4
	add (dss-dsv-slr
	sto ae5
	sto ae9
	com
	add (sto dss+nds
	trn tmp
	llr wrd

ae4,	xx		|slr dsv
	clad dsi
	trn ae5
	add mii
	trn ae7
	clc

ae5,	xx		|sto dss
ae6,	xx		|exit

ae7,	cal
	call dd

ae9,	xx		|sto dss
	llr ae6
	tra mp

|Assemble M-I into program

am,	add one
	sto def
ami,	cal 40
	sto dsi
amc,	slr wrd
am1,	add (tra aw
	call tc
	add (tra as
	call tc
	add (tra ac
	call tc
	add (tra aa
	call tc

am5,	add dsl
	sto dsk
	load bs, tra rnw
	tra rst

aw,	xx		|llr mai
	lac
	add wrd
	sto wrd
	clad aw
	add one
	sto aw
	clad mii
	llr (tra ami
	trn mw
	slr bs
	tra tb3

|Assemble argument into macro instruction word

as,	sto t1
	add aw
	sto as1
	add one
	sto aw

as1,	xx
	lac
	sto t2
	clr
	add (000377
	cyr
	trn .-1

as9,	cll+amz-opr
	trn am1

as2,	cyr
	alr
	cll
	add (add dsv-1
	sto as5
	add (dss-dsv
	sto as8
	lac
	clr
	alr
	trn as3
	add (opr-com+400000

as3,	add (com-400000
	sto as6
	cla
as5,	xx		|get dum sym

as6,	xx		|sign op
	add wrd
	sto wrd
	clad mii
	trn as8

as7,	llr t1
	lcc
	trn am1
	sto t1
	add t2
	tra as9

as8,	xx		|add dss
	trn as7
	lpd
	subr prs, as7

|Assemble macro instruction constant

ac,	add aw
	sto ac1
	add one
	sto aw
ac1,	xx
	lac
	add wrd
	sto wrd
	clad mii
	llr acx
	trn mc
	call co
	llr num
acx,	tra amc

|Assemble macro instruction assignment

aa,	add aw
	sto aa2
	add one
	sto aw
aa2,	xx
	lac
	cll
	add (sto dsv-1
	sto aa3
	clad wrd

aa3,	xx
	clad mii
	trn .+2
	tra ami

aa4,	clad dsi
	trn aa7
	lac
	trn aa6
	add (sto dss-1
	sto aa5
	cal
	call dd

aa5,	xx
	subr mp, ami

aa6,	add (add dss-1-400000
	sto aa5
	cla
	tra aa5

aa7,	lac
	cll
	add (sto dss-1
	sto aa8
	clc
aa8,	xx
	tra ami

|Store dummy symbol specification

ss,	slr ssx
	clad dsn
	trn ssx
	call sco
	call scz
	clc
	sto dsn
	add dse
	llr ssx
	tra sm

ssx,	xx

|Store word in macro instruction list

sma,	add wrd
	llr tea

sm,	slr smx
	ala
	add mai
	sto sm1
	add one
	sto mai
	lac
sm1,	xx
	llr pss
	lcc
	trn sm2
	add mai
	add (add
	com
	sto hih
	add low
	trn sce
sm2,	cal 40
smx,	xx

|Store code bit

sco,	slr scx
	llr (400000
	tra sc1

scz,	slr scx
	cal

sc1,	clad scn
	add one
	trn sc4
	clad scw
sc3,	xx
	lal
	sto scw
	call sm

sc2,	add sm1
	sto sc3
	load scn, -21
	tra scx-1

sc4,	sto scn
	lac
	add scw
	cyl
	sto scw
	cla
scx,	xx

|Test code bit

tc,	sto tcy
	slr tcx
	clad tcn
	add one
	trn tc3

tc1,	clad aw
	sto tc2
	add one
	sto aw
	load tcn, -21

tc2,	xx
	lac
	tra tc5

tc3,	sto tcn
	llr tcc
	lal

tc5,	sto tcc
	trn tc4
	clc
tcy,	xx		|zero exit to subroutine

tc4,	clc
tcx,	xx		|one exit, return to am.

|Set to pick up constant value

ca,	add cas
	trn ct
	ala
	add cni
	com+lad-opr
	trn ilf
	call evl
	add pss
	trn lp3
	clad def

lp3,	sto tdf
	llr wrd
	slr twd
	cla
	sto wrd
	add one
	sto def
	sto syl
	sto cni
	llr tt
	slr t4
	llr ct
	slr t5
	add (tra rp1-1
	sto tt
	add mon
	sto ct
	tra sp

ct,	tra c

|Save constant and reset

d,	add cas
	trn rl
	clad cni
	trn ilf

rp,	add one
rp1,	add (tra rp4+1
	sto rp4
	llr t4
	slr tt
	llr t5
	slr ct
	call evl
	add mii
	trn rp5
	llr (tra rp3

co,	slr cox
	clad one
	add nca
	sto nca
	clad pss
	trn co8
	clad def
	trn usc
	clad con
	llr wrd
	tra co9

co2,	cla
co3,	xx
	lpd
	trn co4
	amz
	trn co6

co4,	clad co3
	add one

co9,	sto co3
	add nco
	trn co2

	llr co3
	lcc
	sto nco
	add mon
	sto hih
	add low
	trn sce
	lac
	add (slr-add
	sto co5
	llr wrd
co5,	xx

co6,	llr con
	lcc

co7,	add co3
	xx		|add cor table
	trn .+2

co8,	sto num
	cla
cox,	xx

rp3,	llr tdf
	slr def
	cal+com-opr
	slr liu
	slr chc
	slr let
	sto cni
	sto dsn
	load sgn, opr
	llr twd
	slr wrd

rp4,	xx
	tra tt
	tra ct
	tra r

|Pseudo-instruction constants


cns,	add mii
	trn ilf
	llr loc
	lcc

cn6,	xx		|sto cor table (first entry)
	sto tlo
	clad nca
	add aml
	sto aml
	clad pss
	trn cn5
	load bs, tra cn4
	clad con
	tra cn8

cn2,	cla
cn3,	xx		|add constants list
	sto wrd
	tra tb4

cn4,	clad cn3
	add one

cn8,	sto cn3
	add nco
	trn cn2

cn5,	llr loc
	lcc

cn7,	xx		|sto cor table (second entry)
	clad tlo
	add nca
	sto wrd
	load bs, tra cn1
	tra ba1

cn1,	load bs, tra rnw
	llr con
	lcc
	add one
	sto nco
	cla
	sto nca
	add cn6
	add (2
	sto cn6
	add one
	sto cn7
	add (add-1
	sto co7+1
	add (-add-cor-ncn-ncn+1
	trn rnw
	add (flex tmc-1
	subr alm, alh

|Read a character from flexo list.

rch,	slr rcx
rc1,	xx
	tra .+2

rc3,	load rc1, tra rc4
	llr fwb
rc5,	lac
	llr (444444
	anl
	cyr
	sto fwb
	slr t
	lac
rcx,	xx

rc4,	load rc1, llr (tra rc3

rc8,	llr flx		|llr from flexo list
	slr fwb
	clad rc8
	add one
	sto rc8
	add nfc
	trn rc5

|Read block of characters from input tape.

rfb,	load rf5, sto flx
	load rc8, llr flx
	load rf6, opr
	slr rf8

rft,	r1c
	cyl+lro-opr
	add (400000-111111
	trn rft
	lac

rf1,	xx
	tra .+2

rf4,	load rf1, tra rf3
	cyl+lro-opr
	add fwd
	cyr
	sto fwd
	cla

rf8,	xx
rtt,	lac
	sto t
	cyr
	add (757777	|c. s.
	trn rtd
	add (617575	|tab
	trn rtz
	add (776177	|c. r.
	trn rtu
	add (761777	|stop
	trn rtd

str,	clc
st2,	xx
	add .-1
	sto rtv
	sto rty
	tra rft

rf3,	load rf1, llr (tra rf4
	cyl+lro-opr
	add fwd
	cyl
rf5,	xx
	cla
	sto fwd
	add rf5
	add one
	sto rf5

rf6,	xx
	add (-sto-flx-nfw+40
	trn rtt
	lac
	load rtv, tra rfo
	tra rtt+1

sas,	add (773737
	tra stt

sat,	add (377777
	tra stt

saa,	add (777337
	tra stt

sar,	add (737377
	add t
	trn stc
	tra stx

stt,	add t
	trn st1

stx,	llr .+2
	slr st2
	tra rft

st1,	add one
	trn stx
	add st2
	add one
	sto st2
	tra rft

stc,	add one
	trn stx
	load rf6, tra rtt
	load rtv, tra rsa
	tra rft

rtu,	add one
	trn str
rtv,	xx

rtz,	add one
	trn str
rty,	xx
rtw,	load st2, tra sas
	tra rft

rtd,	add one
	trn str
	tra rft

rfo,	llr rf5
	lcc
	add (-llr
	sto nfc
	load rtv, opr
	load st2, tra sas
	tra rc8

rsa,	load rf6, tra rfo
	llr .+3
	slr rf8
	cla
	tra rf1

|Ignore to tab or carr ret

itt,	llr (tra rst
	tra .+2
itc,	load itx, tra tt
	tra it3

it1,	add (-400404
	trn it2
	add (-404004+400404
	trn it2
it3,	subr rch, it1

it2,	add one
	trn it3
	clc
itx,	xx

|Error stop entries

ust,	add (flex usw
	subr alu, tb3

usb,	add (flex usl
	subr alu, b5

usq,	add (flex usp
	subr alu, rst

uss,	add (flex uss
	subr alu, s2

usm,	add (flex usm
	subr alu, sw2

usp,	add (flex usa
	subr alu, ae3

usc,	cla
	sto wrd
	add (flex usc
	subr alu, co8

i,	add (flex ich
	subr alm, r

ilf,	clad (flex ilf
	subr alm, itt

ipi,	add (flex ipi
	subr alm, itc

mdt,	clad (flex mdt
	subr alm, rnw

usd,	add (flex usd
	subr alu, da3

ids,	lro
	slr sym
	subr alm, pd2

mdm,	add (flex mdm
	subr alm, dmi

ipa,	clad (flex ipa
	subr alm, itt

sce,	clad (flex sce
	subr alm, alh

tmp,	add (flex tmp
	subr alm, alh

tmm,	clad (flex tmm
	subr alm, alh

uds,	llr sym
	slr r2
	add (flex uds
	llr ex

|Error identification routine

alu,	slr alx
	slr sov
	tra alb

alm,	slr alx
	slr sov
	lro
	slr r2

alb,	type
	add tb
	pna
	add loc
	com
	trn al1
	subr opt, al2

al1,	cla
	print flex ind

al2,	add tb
	pna
	add asi
	trn al6
	add asm
	trn al3
	amz
	trn al6

al3,	call spt
	add aml
	trn al4
	amz
	trn al6
	clad (char r+
	tra al5

al4,	clad (char r-
al5,	pna
	add aml
	com
	trn .-1
	call opt

al6,	clad api
	trn al7
	amz
	trn al9

al7,	ala
	add tb
	pnt
	lac+lro-opr
	type
	add syn
	call spt
	add r2
	trn .+3
	amz
	trn al8
als,	clad tb
	pna
	add r2
	call spt

al8,	add cr
	prt
	tac+cyr-opr
	trn alh+1
	clc

alh,	alr+hlt-opr
	clc
	sto pch
alx,	xx

al9,	clad r2
	trn .+3
	amz
	trn al8
	clad tb
	pna
	tra als

|Octal print subroutine.

opt,	sto t1
	slr opx
	load opu, trn opj

opq,	llr t1
	lal
	cyl
	llr (400003
	ana 10
	sto t1
	lal
	llr opj+2
	add (add fch
	sto .+1
	xx

opu,	xx
	slr opu
	pna

opj,	clad 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

|Type symbol routine

spt,	slr spx
	sto t1
	load opu, -2

spu,	clad t1
	llr (111111
	anl
	cyr
	sto t1
	laz+lro-opr
	trn .+2
	pna
	add opu
	add one
	sto opu
	trn spu
	cal
spx,	xx

|Indicators and variable storage

pss,	0	|-0 = pass 1, +1 = pass 2
npa,	0	|-0 = begin pass, +1 = continue pass
pch,	0	|-0 = do not punch, +1 = punch if pass 2
inp,	0	|-0 = suppress input routine, +1 = punch input routine
tit,	0	|-0 = suppress title, +1 = punch title
psa,	0	|end of psuedo-instruction list) at beginning
psb,	0	|end of macro-instruction list ) of pass 1
ini,	0	|aux. input routine indicator
hih,	0	|upper limit of macro instruction and constant list
nfc,	0	|test word for end of flexo word list
r2,	0	|last undefined symbol
fwd,	0	|flexo word from input tape
fwb,	0	|flexo word from list
wrd,	0	|partial sum of syllables of word
num,	0	|number = value of syllable.
sym,	0	|symbol = flexo word for symbol.
def,	0	|-0 = indefinite word, +1 = definite
chc,	0	|character count of characters in syllable
syl,	0	|0 = at most one plus syllable, +1 = otherwise.
let,	0	|0 = no letters in syllable, -0 = at least one letter
api,	0	|last psuedo-instruction for error stop
asi,	0	|relative location: +0 = yes, -1 = no
asm,	0	|alarm symbol for relative location
aml,	0	|location relative to above symbol (asm)
nsm,	0	|(for establishing above symbolic relative
asa,	0	|(location from location
amn,	0	|(assignment
cas,	0	|-0 = lower case, +1 = upper case
liu,	0	|+0 = no letters in uc, -0 at least one in uc.
cni,	0	|constant syllable indicator
con,	0	|current address in constant list
nco,	0	|number of distinct constant values
nca,	0	|number of constants
twd,	0	|word   )
tdf,	0	|define ) temporary.
tlo,	0	|temporary for current location
mii,	0	|macro instruction mode indicator
mdi,	0	|define indicator
syn,	0	|second three characs of M-I name
spz,	0	|psuedo instruction switch
tea,	0	|temporary subroutine exit address
dsi,	0	|dummy symbol indicator
dsn,	0	|dummy symbol odd-even indicator
dse,	0	|dummy symbol temporary
scn,	0	|(temporaries
scw,	0	|(for code
tcn,	0	|(word
tcc,	0	|(subroutines
dsk,	0	|dummy symbol count
dsl,	0	|temporary for dum sym count

t,	0	t1,	0	|temporary
t2,	0	t3,	0	|registers
t4,	0	t5,	0	|

mon,	-1
one,	1
tb,	char r	
cr,	char r


constants

psi|	sto psi+npi+npi+npi+1

	576327	357577	trn sta
	245577	377157	trn oct
	723347	554237	trn dec
	566527	115757	trn fx
	564237	723057	trn ch
	542377	560137	trn noi
	723707	754637	trn dfn
	637357	620577	trn ter
	502677	576327	trn cns
	233717	377777	trn txt

|Initial symbol table


dsm-nsy-nsy|

ist,	
	-flex sto	0
	-flex slr	100000
	-flex add	200000
	-flex llr	300000
	-flex trn	400000
	-flex tra	500000
	-flex opr	600000
	-flex cry	600012
	-flex lpd	600022
	-flex cyl	600031
	-flex lad	600032
	-flex com	600040
	-flex amz	600051
	-flex lcd	600072
	-flex pen	600100
	-flex orl	600105
	-flex ora	600125
	-flex lro	600200
	-flex alr	600201
	-flex ala	600221
	-flex alc	600261
	-flex anl	600305
	-flex ana	600325
	-flex shr	600400
	-flex cyr	600600
	-flex bsr	604000
	-flex rds	604004
	-flex rew	604010
	-flex wrs	604014
	-flex cpf	607000
	-flex spf	607001
	-flex cpy	620000
	-flex dis	622000
	-fles dsa	622021
	-flex dsc	622061
	-flex prt	624000
	-flex pna	624021
	-flex pnc	624061
	-flex pnt	624600
	-flex p6a	626021
	-flex p6h	626600
	-flex p7a	627021
	-flex p7h	627600
	-flex hlt	630000
	-flex clr	640000

	-flex cll	700000
	-flex cla	740000
	-flex tac	740004
	-flex lal	740012
	-flex lac	740022
	-flex tbr	740023
	-flex clc	740040
	-flex lcc	740062
	-flex laz	740072
	-flex cal	740200
	-flex rpf	746020
	-flex ios	760000
	-flex r1c	761000
	-flex r1r	761600
	-flex r3c	763000
	-flex p6s	766000

dsm,	|check symbol count

dsm|	-char lr

dss|	1


ftp|

-0	0	-0	0
313113	701007	212112	343443
-0	0	111111	000000
211311	344744	210012	343443
0	0	0	0
212012	303443	021300	322722
200002	311113	000300	011711
111112	444443	210213	344307

-0	0	22	11
311113	344443	313012	703443
311311	344324	020002	111113
000012	444443	300000	742111
131111	445564	2	11
313111	701000	213112	303443
211112	340043	000300	000700
111311	421124	-0	0

300000	711111	-0	0
300213	742007	-0	0
111113	000007	-0	0
111132	445562	-0	0
111311	444744	-0	0
120000	421111	-0	0
311311	344300	-0	0
211112	344525	-0	0

211112	344443	-0	0
313113	343443	-0	0
211112	300743	-0	0
211202	344743	-0	0
131111	465544	-0	0
120021	421124	-0	0
111220	444231	-0	0
211112	344443	-0	0

start+add+ps5
m