              executive routine 14 march 66

/part 1

a=720077

psf=a
bef=a+0100
bff=a+0200
rpf=a+0300
rpn=a+0400
rcn=a+0500
lar=a+0600
lrd=a+0700
psn=a+1000
ben=a+1100
bfn=a+1200
lpf=a+1300
spn=a+1400
scn=a+1500
ad1=a+1600
ad2=a+1700
rsb=a+2000
bpt=a+2100
arq=a+2200
dsm=a+2300
wat=a+2400
sbr=a+2500
srw=a+2600
sei=a+2700
sps=a+3000
sbe=a+3100
sbf=a+3200
sti=a+3300
sdl=a+3400
siw=a+3500
sxw=a+3600
rbe=a+3700
rsn=a+4000
rsf=a+4100
srs=a+4200
lqn=a+4300
soq=a+4400
lei=a+4500
lea=a+4600
rer=a+4700
la2=a+5000
tsn=a+5100
tsf=a+5200
nmn=a+5300
nmf=a+5400
lbe=a+5500
usn=a+5600
usf=a+5700
ldc=a+6000
tln=a+6100
tlf=a+6200

isb=720052
eem=724074






                
                                lem=720074

































































                
                                
/random constants

/consoles

ncb=12	/typewriter buffer size
ewv=5	/restart level

/punches

npu=1	/number of punches
npb=140	/punch buffer size
pwm=30	/restart level

/reader

rbn=ncbx5+npb	/buffer size
rwm=40	/restart level

/programs

npr=6	/number of programs

/drum margin

nmb=40
nmx=140
dvn=700	/user address advance






































                
                                
/ts break from user core

0/

0,	0	/ac
1,	0	/pc
2,	0	/io

3,	add i dp1
	dap . 1
	xct .		/dispatch on trap number
	jmp pav		/if dispatch entry is law, then save 
			/active registers first

15/

15,	sd		/pointer to resource table
16,	aw1		/pointer to pointer table
17,	lem		/entry from ts setup
	jmp pan


/dispatch table for user

d7,	jmp tot		/i-o completion
	jmp ill		/illegal instruction
	jmp wa7		/wat
	jmp ra		/rpa
	jmp rb		/rpb
	jmp to		/tyo
	jmp i z84	/tyi
	jmp pa		/ppa
	jmp pb		/ppb
	jmp di		/dia
	jmp db		/dba
	jmp dc		/dcc
	jmp da		/dra
	jmp bp		/bpt
	jmp ar		/arq
	jmp end		/dsm
	jmp rry		/rrb
	jmp xe0		/xe1 mode trap























                
                                
/dispatch table for ID

d8,	jmp tot
	jmp .
	jmp wa
	jmp ra
	jmp rb
	jmp to
	jmp i z84
	jmp pa
	jmp pb
	jmp di
	jmp .
	jmp dc
	jmp .
	jmp .
	jmp ar
	law stt
	jmp .
	jmp .


/dispatch table for MYSTIC and extended exec

d9,	jmp tot
	jmp .
	jmp adf
	jmp .
	jmp rb
	jmp to
	jmp i z84
	jmp .
	jmp .
	jmp di
	jmp .
	jmp dc
	jmp .
	jmp .
	jmp ar
	law tts
	jmp .
	jmp .























                
                                
/entry from interrupts

tot,	rpf
	dio i pf1
	clf 7
	jsp srv
	jmp rm1
	stf 5
	jmp .-3

rm1,	lac lqu
	sza
	soq i
	jmp pac		/get next user if quantum expired
	jsp cbk		/or if user had infinite quantum
	nop
	cla
	skp 2
	law 4000
	ior i pf1
ba2,	lia
	lpf
rm3,	ad1
	srs i
	xct i rs1
re9,	lac 0
	lio 2
	jmp i 1

dmr,	ior i jfm	/place user in io wait state
	dac i jfm

ret,	jsp ix1
	rpf
	ril 9s
	spi
	jmp xe0
re1,	xct i xe9
	spn
	scn
	jmp rm3
























                
                                
/entries into program active control

dms,	ior i jfm	/place user in waiting state
	dac i jfm	/(i-o wait) and deactivate

wa,	lac i act
	and (377777
	dac i act

wa1,	rpf
	dio i pf1
	clf 7
pac,	jsp pav
	jsp xxx
pan,	law i npr+1	/count of number of programs to check in
	dac pli		/high priority mode

pai,	cli
	lar
	scn
	szs 60		/sw6 = exec debugger call button
	jmp bug
	idx aw1
	sad (aas npr
	jmp par
	idx be
	idx act
	idx jfm
	idx kfm
	idx rst
	jmp pa0

par,	law aas
	dap aw1
	law ber
	dap be
	law dmi
	dap act
	law jdm
	dap jfm
	law kdm
	dap kfm
	law pbb
	dap rst
	jsp bsc
	jsp srv
	jmp pa0
	jmp .-2

bug,	lpf
	lbe
	lqn
	jmp 5600












                
                                
/pointers

aw1,	aas	/assignment register 1
be,	ber	/break enable register
act,	dmi	/program active list, console mask
jfm,	jdm	/reactivate bits
kfm,	kdm	/sequence break bits
rst,	pbb	/pointer to rest of variables

aw2,	0	/assignment register 2
ac1,	0	/active AC
io1,	0	/active IO
pc1,	0	/active PC
pf1,	0	/active PF
qn1,	0	/active quantum word
dp1,	0	/active dispatch table pointer
cr1,	0	/active core rename word
di1,	0	/active drum initial address word
sp2,	0	/pointer to [pointer to inactive variables]
rr0,	0	/reader switch
pp0,	0	/punch switch
dtr,	0	/drum translation table
z81,	0	/four words
z82,	0	/..of private storage
z83,	0	/..for a tyo-tyi translator
z84,	0	/tyi dispatch address (used by translator)
zzi,	0	/tyi translator entry
zzo,	0	/tyo translator entry
why,	0	/why we started MYSTIC/ID
abf,	0	/ID/MYSTIC here/not-here etc.
spc,	0	/user special fields
brk,	0	/pointer to [pointer to breakpoint variables]
xe9,	0	/premature xe1 trap switch
rs1,	0	/where to go when reader is ready
idc,	0	/ID core rename word






























                
                                
/program active control

pa0,	lio i aw1	/set up this console
	lar
	lio i be
	lbe
	lac adr
	rar 7s
	cma
	and i act	/don't look at call buttons of consoles
			/doing arq's
	and cbi
	sza
	jmp ube		/call button activation
	law i 2
	sas pli
	jsp cbk
	jmp pa6

pa5,	jsp rsv		/set up rest of variables
	lio i aw2
	la2
	lio i cr1
	ldc
	dra		/do dra early to allow info time to arrive
	lac c3
	ior i act
	dac i act
	and (370000
	dip sw5
	sad sw4
	jmp sw3		/program already in core
	lai		/drum swap required
	add (140
	dap sw4
	and (7777
	jda drm
sw4,	0
sw5,	0
	jmp dre
	dzm dec
	lac sw5
	dac sw4

bgn,	lio i qn1
	sdl i
	sir 6s
bge,	lqn
	dio lqu
	cla
	skp 2
	law 4000
	ior i pf1
	lia
	lpf
	jsp uav
	jmp re1








                
                                
/drum error recovery

dre,	dra
	xct (xct (spi i
	jmp .		/not parity error
	isp dec
	jmp pa5+1	/try again
	spq
	jmp sw5+2	/accept whatever was read
	lsm
	tsf
	clc 20
	iot 3
de0,	cks
	ril 2s
	isp dec
	jmp de2		/typewriter not working
	spi i
	jmp de0
	law dem
	dap de1
de1,	lac .
	lio .+ 3
	rcl 6s
	tyo
	sas .
	jmp de1+2
	idx de1
	sas (lac dec
	jmp de1
	cli
	tyo
	lac sw5
	ral 1s
	rcl 2s
	tyo
	cli
	rcl 3s
	sni
	lio .+2
	tyo
	clc 20
	tyo
de2,	dzm sw4
	tsn
	tln
	law i 20
	dac dec
	jmp pa5+1


dem,	text .
drum parity error field.


dec,	0









                
                                
pa6,	isp pli
	jmp pai		/still in high priority search
	dzm pli		/to prevent wrap around
	lio i act
	spi i
	jmp pai		/user not active
	jmp pa5 		/active user found in low priority search

sw3,	law 1
	and i abf
	szf i 5
	sza
	jmp bgn		/no inf quantum to mystic or ext ex
			/or if io device was serviced
	cli
	jmp bge		/otherwise grant infinite quantum since
			/this is the only user doing anything

rsv,	dap sbz		/set up rest of pointers
	lac i rst
	dac aw2

	z=ac1
	repeat 31, dac z	idx z	z=z+1

	jmp sbp+1


lqu,	74		/last loaded quantum word
pli,	0
c3,	400000


































                
                                
cbk,	dap cbx		/check break status routine
	spn
	scn
	cks
	ril 6s
	lai
	and i jfm
	lia
	sza
	jmp cb9
	lac i kfm
	spa
	sbr
	jmp cbx
	jmp . 3
cb9,	and i kfm
	sza
	stf 2
	lai
	xor i jfm
	dac i jfm
	idx cbx
cbx,	jmp .

xxx,	dap xx1		/save break enable
	rbe
	dio i be
	lac i pf1
	and (23000
	sad (21000
	law 1
	lio i kfm
	ril 1
	rcr 1
	dio i kfm	/new mode bit into kdm table
xx1,	jmp .





























                
                                
/drum transfer wait and execute

drm,	0
	dap drx
	lio i drx
	dia
	lac i drx
	dap dr3
	idx drx

dr1,	dra
	xct .+1
	clc
	dio t
	dip t
dr3,	law .
	add (10000-nmb
	sub t
	and (7777
	sub (nmx-nmb
	spa
	jmp dr2
	jsp srv
c1,	skp		/used as a constant
	jmp dr1
	
dr2,	lio i drx
	idx drx
	lac drm
	dcc
c2,	skp i		/used as a constant
	idx drx
	jmp bsc+1

t,	0		/general temporary storage cell


/end of part one
start


























                
                                
/exec, part 2, 7 feb 66

/switch and button sense

/button 0 . 1, transfer control to debugger

/switch changes, call administrative routine

bsc,	dap cb1
	rsb
	lai
	xor tsb
	sza i
	jmp cb2
	dac t
	ior tsb
	xor tsb
	dio tsb
	sar 7s
	ior cbi
	and onn		/make sure these consoles are on
	dac cbi
	law 177
	and t
cb2,	ior adr
	dac adr
	sza i
cb1,drx,	jmp .
	lac c3
	ior dmi
	dac dmi
	jmp cb1

cbi,	0		/call button word































                
                                
/service consoles and punches

srv,	dap sr1
	srw
	xct srr		/skp i if reader in use
	jmp sr0
	rrb
	lac i rip
	ral 8s
	rcr 8s
	dac i rip
	rpa-i
	idx rie
	sad erb
	law b
	dac rie
	idx rip
	sad erb
	law b
	dac rip
	lio c1
	dio rrs
	sad roe
	rsn
	sad rop
	dio srr
	srw
	xct srr
	jmp sr4
	jmp srv 4

sr0,	rpn
	jsp sat
	jmp .+4
	jsp ite
	ppa
	jmp sr4
	rcn
	jsp sat
sr1,	jmp .
	sps
	jmp sr2
	sti
	jmp sr3
	jsp if0+1
	psf
sr2,	tyi
	jsp itf
	jmp sr4
sr3,	jsp ite
	tyo
sr4,	idx sr1
	jmp sr1












                
                                
/set up console or punch buffer index

sat,	dap sa1
	sni
sa1,	jmp .		/nothing to set up
	cla
	rcl 4s
	add (bop-1
	dap ie1
	add (bip-bop
	dap if1
	add (bew-bip
	dap ie2
	add (bor-bew
	dap it1
	dap it2
	idx it2
	idx sa1
	jmp sa1

/index and test if buffer empty

ite,	dap ie7
	lac i ie1
	dap .+2
	law 377
	and .
	lia
ie1,	idx bop
it2,	sad bor+1
it1,	lac bor
	dac i ie1
ie2,	sad bew
	bff
	sad i if1
	ben
ie7,	jmp .




























                
                                
/index and test buffer full

itf,	dap if2
	lac i if1
	dap . 1
	lac .
	rcr 8s
	ral 8s
	dac i .-3
	bef
if1,	idx bip
	sad i it2
	lac i it1
	dac i if1
	sad i ie1
	bfn
	idx i ie2
	sad i it2
	lac i it1
	dac i ie2
if2,	jmp .

if0,	psn
	dap if3
	bff
	lac i if1
	dac i ie1
if3,	jmp .





































                
                                
/get characters from reader buffer

rre,	xct i rr0
	nop
	dap rr2
	law 600
	siw
	cla
	dap iws
rr1,r9r,	law re9
	dap i rs1
	rsf
	xct i rr0
	jmp rr8
rri,	rpa-i		/initialize

	law i 3
	dac r00		/count for read binary
	lac c1
	dac i rr0	/reader switch
	lac c2
	dac rrs
	dac srr
	law b		/ordinary pointers
	dac rip
	dac rop
	law b+rbn-rwm	/early warning
	dac rie
	dac roe
	usf
rr8,	jsp srv
	nop
	xct rrs		/skp i for bffr empty
	jmp rr6
	law 20
iws,	skp i 600	/skip when no wait
	jmp dms
	law rr9
	dap i rs1
	law 20
	jmp dmr

rr6,	lac i rop	/get character
	dac t
	lio c2
	idx roe
	sad erb
	law b
	dac roe
	idx rop
	sad erb
	law b
	dac rop
	sad rie
	dio srr		/buffer almost empty
	sad rip
	dio rrs		/buffer empty
	lio t
rr2,	jmp .






                
                                
/read traps

rb,	jsp rre		/binary
	spi i
	jmp rr1
	lac prb
	ril 2s
	rcl 6s
	dac prb
	isp r00
	jmp rr1
	law i 3
	dac r00
	jmp r02

ra,	jsp rre		/alpha
	cla
	rcl 8s
	dac prb
r02,	isb
	xct iws
	jmp rr
	usn
	jmp ret

rry,	xct i rr0	/rrb
	nop
	usf
rr,	lac prb
	dac 2
	jmp ret

rr9,	law i 7777
	ior 1
	sub (1		/undex the pc
	dap 1		/since later we index it
	jmp r9r

prb,	0		/pseudo reader buffer
r00,	0		/count to fill binary word

rip,	b		/ring buffer pointers
rop,	b

rie,	b+rbn-rwm
roe,	b+rbn-rwm

erb,	b+rbn

rrs,	skp i		/buffer empty indicator















                
                                
/punch trap

pb,	law 2		/binary
	rcl 6s
	jmp pu

pa,	lac 2		/alpha
pu,	xct i pp0
pu2,	dac t
	spn
	jsp sat
	jmp ill
	law 2
	sbf i
	jmp dms
	lio t
	jsp itf
	law 2
	sbf i
	jmp dmr
	isb
	jmp ret











































                
                                
/type-in trap

ti,	scn
	jsp sat
	jmp ill
z19,	law 4
	sps
	sbe i
	jmp dms
	jsp ite
	jmp i zzi
z18,	dio 2
	law 4
	sbe i
	jmp dmr
	isb
	jmp ret

/type-out trap

to,	scn
	jsp sat
	jmp ill
z25,	law to3
	sps
	jmp if0
	law 10
	sbf i
	jmp dms
to3,	lio 2
	jmp i zzo
z51,	jsp itf
	law 10
	sbf i
	jmp dmr
	isb
	jmp ret




























                
                                
/buffer pointer table

bop,	z=0
	repeat 1,	b+z	z=z+1
	repeat 5,	b+z	z=z+ncb
	repeat 1,	b+z	z=z+1
	repeat npu,	b+z	z=z+npb

bip,	z=0
	repeat 1,	b+z	z=z+1
	repeat 5,	b+z	z=z+ncb
	repeat 1,	b+z	z=z+1
	repeat npu,	b+z	z=z+npb

bew,	z=0
	repeat 1,	b+z		z=z+1
	repeat 5,	b+z+ncb-ewv+1	z=z+ncb
	repeat 1,	b+z		z=z+1
	repeat npu,	b+z+npb-pwm+1	z=z+npb

bor,	z=0
	repeat 1,	b+z	z=z+1
	repeat 5,	b+z	z=z+ncb
	repeat 1,	b+z	z=z+1
	repeat npu,	b+z	z=z+npb
			b+z

/buffers

b,	repeat 1,	repeat 1,	0
	repeat 5,	repeat ncb,	0
	repeat 1,	repeat 1,	0
	repeat npu,	repeat npb,	0

	0		/for luck






























                
                                
/selectric translator

z10,	lai		/tyi translation
	add i z81	/physical case bit
	add (z99		/pointer to table
	dap . 2
	law 177
	and .		/mask table entry
	sas z31
	sad z32		/case shift?
	jmp z11		/yes
	scr 6s
	ril 6s
	sal 6s
	sad i z82	/required logical case .eq.
	jmp z18		/current physical case ?  yes
	dap i z82	/no, change indicator
	dio i z83	/and save character
	lio z32		/transmit shift to the user
	sza
	lio z31
	law z21		/and patch
	jmp . 3

z21,	law ti		/reentry to pick up saved character
	lio i z83
	dap i z84	/patch tyi destination
	jmp z18

z11,	cli		/case shift typed in
	sas z32
	lio (100
	dio i z81	/change physical case
	jmp z19































                
                                
z50,	swp		/tyo translator
	and (77		/mask character
	sas z31
	sad z32
	jmp z56		/case shift
z52,	add i z82	/logical case shift
	add (z99		/base of table
	dap . 1
	lac .
	rcl 6s
	ral 7s
	and (100		/char . io   case . ac
	sad i z81	/required physical case .eq.
	jmp z51		/current physical case ?  yes
	dap i z81	/no, change case bit
	lio z65
	sza i
	lio z66
	jsp itf		/and output case shift
	jmp z25

z56,	cli		/change logical case
	sas z32
	lio (100
	dio i z82
	jmp z52

z31,	74	/upper case fio-dec
z32,	72	/lower

z65,	65	/upper case selectric
z66,	66	/lower

































                
                                
/tables for selectric   (two tables in one)
/tab1=0-6   0-5=6 bit selectric key code   6=case
/tab2=11-17   12-17=6 bit concise code    11=case
/tab2(tab1(x))=x for all legal characters   space if illegal
/concise=tab2(case selectric key)for input
/selectric=tab1(case concise) for output
/if case bit changes,transmit appropriate extra case shift

z99,	070073	/space,.
	770000	/1,ill
	740071	/2,i
	750070	/3,h
	720077	/4,c.r.
	730077	/5,index=c.r.
	700036	/6,tab
	710000	/7,space
	630066	/8,f
	620067	/9,g
	070064	/ill,d
	070065	/ill,e
	070062	/ill,b
	070063	/ill,c
	070154	/ill,+
	070061	/ill,a

	760057	/0,(
	624000	//=uc9,ill
	540051	/s,r
	550050	/t,q
	520075	/u,backspace
	530000	/v,ill
	500000	/w,ill
	510000	/x,ill
	430046	/y,o
	420047	/z,p
	070044	/ill,m
	400045	/,,n
	470042	/black,k
	440043	/red,l
	060054	/tab,-
	070041	/ill,j
























                
                                
	004033	/center dot=colon,,
	370000	/j,ill
	340031	/k,z
	350030	/l,y
	320035	/m,red
	330000	/n,ill
	300000	/o,ill
	310034	/p,black
	230026	/q,w
	220027	/r,x
	070024	/ill,u
	070025	/ill,v
	360022	/-,s
	560023	/),t
	404055	/. =semicolon,)
	200173	/(,asterisk=x

	070133	/ill,=
	170000	/a,ill
	140011	/b,9
	150010	/c,8
	120000	/d,ill
	130074	/e,upper case
	100072	/f,lower case
	110000	/g,ill
	030006	/h,6
	020007	/i,7
	660004	/lower case,4
	000005	/.,5
	654002	/upper case,2
	240003	/backspace,3
	070020	/ill,0
	040001	/c.r.,1
































                
                                
	074040	/space,colon=center dot
	754100	/"=uc3,ill
	724171	/'=uc4,I
	744170	/dollar sign=~,H
	764177	/>>04<<=uc0,c.r.
	634177	/uc8=>>05<<,index=c.r.
	574136	/^=uc star,tab
	734100	/<,space
	704166	/>,F
	714167	/^,G
	074164	/ill,D
	074165	/ill,E
	074162	/ill,B
	074163	/ill,C
	074120	/ill,.

	074161	/ill,A
	164157	/.,[
	604100	/question mark,ill
	544151	/S,R
	554150	/T,Q
	524175	/U,backspace
	534100	/V,ill
	504100	/W,ill
	514100	/X,ill
	434146	/Y,O
	424147	/Z,P
	074144	/illM
	600145	/=,N
	474142	/black,K
	444143	/red,L
	064140	/tab,.
	074141	/ill,J
































                
                                
	364056	/. ,overbar=semicolon
	374100	/J,ill
	344131	/K,Z
	354130	/L,Y
	324135	/M,red
	334100	/N,ill
	304100	/O,ill
	314134	/P,black
	234126	/Q,W
	224127	/R,X
	074124	/ill,U
	074125	/ill,V
	160122	/+,S
	564123	/],T
	774155	/| ,]
	204106	/[,backarrow=^

	074121	/ill,?
	174100	/A,ill
	144021	/B,/(uc9)=/
	154105	/C,downarrow=>>05<<
	124100	/D,ill
	134074	/E,upper case
	104072	/F,lower case
	114100	/G,ill
	034110	/H,>
	024111	/I,^
	660102	/lower case,'=uc4
	570107	/x=star,<
	654103	/upper case,~=dollar sign
	244101	/backspace,"=rev slash(uc3)
	074104	/ill,>>04<<=uc4=/
	04156	/c.r.|

/end of selectric translation tables


/end of part two
start


























                
                                
/exec, part 3, 7 feb 66

/drum traps

di,	dio i di1	/dia
	jmp ret

dc,	dio dc3		/dcc
	jsp dp8
	dip dc3
	lio i di1
	dio dc2
	jsp dp7
	dip dc2
	lac 0
	lia
	and (70000
	ral 6s
	add (crz
	dap . 2
	lac i cr1
	xct .
	and (70000
	sad (60000
	jmp ill
	rcl 6s
	rir 6s
	lai
	jda drm
dc2,	0
dc3,	0
	jmp .+2		/drum error
	jsp ix1
	jsp ix1
	rpf
	ril 9s
	law xe0
	spi
	dap i xe9
	soq
	jmp re1
	jmp wa1

crz,	rar 3s
	nop
	ral 3s
	ral 6s
	ral 9s
	rar 6s
	jmp ill
	jmp ill














                
                                
db,	soq i		/dba
	jmp wa1
	lio 2
	dio i di1
	lac (dba
	jmp db1

da,	dra		/dra
	lac (dio 2
db1,	dac db2
	dio t
	law 7777
	and t
	add (10000-dvn
	dap t
	lio t
db2,	hlt
	jmp ret















































                
                                
/translate field number

dp7,	dap bck		/check and translate write field
	law 177
	jda dpc

dp8,	dap bck		/check and translate read field
	clc
	jda dpc

dpc,	0
	lai
	and (370000
	sza i
	jmp bck		/field zero is always ok
	dac bc8		/absolute field if necessary
	ral 6s
	sub (27
	sma
	jmp ill		/field number too big
	add (27
	spi i
	jmp dp5		/translate relative field
	add (sd-1
	dap . 1
	lac .		/get entry from system drum table
	and i act	/and off console mask and sign bit
	and dpc		/check console mask bits for write
			/all bits for read
dp6,	sza i
	jmp ill
	lac bc8
bck,	jmp .

dp5,	add i dtr
	dap . 1
	lac .		/translation table entry
	dac bc8
	jmp dp6

bc8,	0
























                
                                
/arq,dsm,wat,call button,illegal instruction

ar,	law 1		/arq
	dac i why
	law 177
	and i act
	ral 7s
	ior adr
	dac adr

wa7,	rpf		/wat
	ril 9s
	law xe0
	spi
	dap i xe9
	jmp wa

end,	law 2
	dac i why
	jmp swt

ill,	law aas		/illegal something
	sad aw1
	jmp .		/console 0
	law 3
	dac i why
	law 4
	and i abf
	sza i
	jmp swt
	law pan
	dap swz
	rpf
	dio i pf1
	clf 7
	jsp xxx
	jsp pav
	jmp swi 1

ube,	xor cbi		/call button
	dac cbi
	jsp rsv
	law 4
	dac i why
	law pa5 1
	dap swz
	law 5
	and i abf
	sza i
	jmp swi		/user was running
	and (1
	cli>>05<<swp
	sni
	law 2200
	dac i pc1
	jmp pa5 1









                
                                
/start ID or MYSTIC at this console

swt,	jsp pav
	law pan
	dap swz
	rpf
	dio i pf1
	clf 7
	jsp xxx
swi,	jsp sw
	law re1 1
	dap i xe9
	law 7777
	and i kfm
	dac i kfm
	dzm i jfm
	law 2
	and i abf
	sza i
	jmp mys

ttu,	law 4		/start ID
	ior i abf
	dac i abf
	law 2200
	dac i pc1
 	law 7474
	dac i qn1
	lac i idc
	dac i cr1
	law d8
	dap i dp1
	law 4000
	ior i spc
	sar 6s
swx,	lio i act	/new field to run for this user
	ril 6s
	rcr 6s
	dio i act
swz,	jmp .		/pan for dsm,bpt,ill
			/pa5+1 for call button

mys,	law 1		/start MYSTIC
	ior i abf
	dac i abf
	law 0
	dac i pc1
	lac adc
	dac i cr1
	law d9
	dap i dp1
	lac c3
	dac i qn1
	law 45		/MYSTIC running field
	jmp swx










                
                                
/bpt handling

bp,	law 5
	dac i why
	law 2
	and i abf
	sza i
	jmp swt		/no ID
	lio 1
	dio t8
	law spa>>05<<sma-skp
	ril 1s
	spi		/extend mode
	law sni-skp
	dap bz3		/bz3 skips on (ext^cycle 0)>>05<<(~ext)
	eem
bz1,	clc>>05<<lia		/non-zero io . cycle 0
	lac i t8
	sni
	jmp bz2		/defer cycle
	sas (bpt
	sad (bpt i
	jmp bz4
bz2,	dap t8
	xct bz3
	dip t8		/change core on (defer^ext)
	ral 5s
	spa
bz3,	spa>>05<<sma
	jmp bz1		/(no i bit)>>05<<(defer^ext)
	cli		/indirect chain, zero io . defer cycle
	jmp bz1 1

bz4,	lem
	lac t8
	and (77777
	dac i b4
	sad i b1		/secondary breakpoint
	isp i b3
	jmp swt		/n-th time through

xe1,	lio i b2		/enter one-instruction-execute mode
	eem
	lac i t8
	dio i t8
	lem
	dac i b2
	rpf
	lai
	ior (400			/xe1 mode bit
	jmp ba2














                
                                
sbp,	dap sbz
	lac i brk
	dac b1			/B
	dac b2	idx b2		/c(B)
	dac b3	idx b3		/n
	dac b4	idx b4		/location of bpt
	dac b5	idx b5		/control
sbz,	jmp .

b1,	0
b2,	0
b3,	0
b4,	0
b5,	0

t8,	0
t9,	0
















































                
                                
/one-instruction-execute trap

xe0,	law re1+1
	dap i xe9
	rpf
	lai
	and (-400
	lia
	lpf
	lac i b5
	sza
	jmp xe3
	lac i b1
	dac t8
	lio i b2
	eem
	lac i t8
	dio i t8
	lem
	dac i b2
	jmp re1

xe3,	and (1
	sza i
	jmp xe4
	law 6		/end of X
	dac i why
	jmp swt

xe4,	lac i b4		/end of P, put back bpt
	dac t8
	lac (bpt
	eem
	dac i t8
	lem
	dzm i b5
	jmp re1




























                
                                
/dismiss from ID

stt,	law pan
	dap swz
	law 7
	and i ac1
	add (stj
	dap .+1
	xct .

	dac i b5
	jsp sw
	law 400		/xe1 mode bit
	ior i pf1
	dac i pf1
stq,	law 73
	and i abf
	dac i abf
	jsp xxx
	law 40
	ior i spc
	jmp swx

stg,	dzm i b5
	jsp sw
	jmp stq

st0,	jsp gav
	lac i b1
	dac tt5 4
	lac i b2
	dac tt5 5
	lac i b3
	dac tt5 6
	lac i b4
	dac tt5 7
	law i 7700
	and i spc
	dac tt5 10
	lac i why
	jmp tte

stj,	jmp stg		/G
	law 2		/P
	law 1		/X
	jmp .
	jmp st0		/get
	jmp st1		/set
	jmp .
	jmp .















                
                                
st1,	law i 10
	jda fsw
	jsp sav
	lac tt5 4
	dac i b1
	lac tt5 5
	dac i b2
	lac tt5 6
	dac i b3
	lac tt5 7
	dac i b4
	jmp re2

sw,	dap sw9		/switch active-inactive variables
	lac i sp2
	dac t8
	lac ac1
	dac t9
	lac i t9
	lio i t8
	dio i t9
	dac i t8
	idx t8
	idx t9
	sas sp2
	jmp .-7
sw9,	jmp .






































                
                                
/dismiss from MYSTIC

tts,	rpf
	dio i pf1
	clf 7
	jsp xxx
	law pan
	dap swz
	law ttj
	add i ac1
	dap . 1
	jmp .

ttj,	jmp ttk
	jmp ttt
	jmp wa
	jmp sqo
	jmp tt0
	jmp tt1
cot,	jmp re2		/suppose to clear typewriter when hung up

sqo,	jsp ix1		/simulated quantum overflow
	jmp pac

ttk,	jsp sw
	law 76
	jmp stq 1

ttt,	law 0
	dac i why
	law 76
	and i abf
	dac i abf
	jmp ttu

tt0,	jsp gav		/get state word for MYSTIC
	lac i spc
	dac tt5 4
	law 2
	and i abf
	dac tt5 5
	law 377
	and i act
	dac tt5 6	/console mask
	lac i why
	dac tt5 7
	law sd		/pointers
	dac tt5 10	/to system
	law sd 26	/drum
tte,	dac tt5+11	/table
	law i 12
	jda dsw
re2,	jsp uav
	jsp ix1
	jmp re1+1










                
                                

tt1,	law i 6
	jda fsw		/get state word from MYSTIC
	jsp sav		/set actives
	lac tt5 4
	dap i spc
	lac tt5+5
	xor i abf
	and (-2
	xor tt5+5
	dac i abf
	jmp re2

/routines to get and set state word

/deposite state word

dsw,	0
	dap dsx
	law tt5		/buffer
	ior xcr			/set to exec core
	dac tt8
	lac i io1	/users pointer
	dac tt9
dsz,	eem
	lac i tt8
	dac i tt9
	idx tt8
	idx tt9
	isp dsw
	jmp dsz+1
	lem
dsx,	jmp .

/fetch state word

fsw,	0
	dap dsx
	lac fsw
	dac dsw
	lac i io1
	dac tt8
 	law tt5
	ior xcr
	dac tt9
	jmp dsz

xcr,	070000	/exec core
tt8,	0
tt9,	0
tt5,	repeat 12, 0

/ac,io,pc,pf,b1,b2,b3,b4,spc,why  for ID
/ac,io,pc,pf,spc,abf,mask,why,sd,sd+26  for MYSTIC











                
                                

/get active variables (ac,io,pc,pf)

gav,	dap gax
	lac i sp2
	dac tt8
	lac i tt8
	dac tt5
	idx tt8
	lac i tt8
	dac tt5 1
	idx tt8
	lac i tt8
	dac tt5 2
	idx tt8
	lac i tt8
	dac tt5 3
gax,	jmp .

/set active variables

sav,	dap sax
	lac i sp2
	dac tt8
	lac tt5		/ac
	dac i tt8
	idx tt8
	lac tt5 1	/io
	dac i tt8
	idx tt8
	lac tt5 2	/pc
	dac i tt8
	idx tt8
	lac tt5 3	/pf
	dac i tt8
sax,	jmp .

pav,	dap pax
	lac 0
	dac i ac1
	lac 1
	dac i pc1
	lac 2
	dac i io1
pax,	jmp .

uav,	dap uax
	lac i ac1
	dac 0
	lac i pc1
	dac 1
	lac i io1
	dac 2
uax,	jmp .











                
                                
/dismiss from extended exec

adf,	jsp ix1
	law adg
 	add 0
	dap . 1
	jmp .

adg,	jmp wa
	lio 2
	lar
	scn
	jsp sat
	jmp .
	lac i if1
	dac i ie1
	psf
	ben
	bff
	lio i aw1
	lar
	jmp re1

ix1,	dap . 4		/routine to index address part of loc 1
	law 1
	add 1
	dap 1
	jmp .





































                
                                
/system resource assignment tables

/drum assignment

sd,	0	/ 1
	0	/ 2
	0	/ 3
	0	/ 4
	400000	/ 5  MYSTIC and ext exec running field
	0	/ 6
	0	/ 7
	0	/10
	0	/11
	0	/12
	0	/13
	0	/14
	0	/15
	0	/16
	0	/17
	0	/20
	400000	/21  et 11a and fcdddt
	400000	/22  possible
	400020	/23  radio astronomy field
	400000	/24  copy of exec and debugger
	400000	/25  copy of ID and utility system (get ts)
	400000	/26  copy of MYSTIC and extended exec

adr,	0	/administrator word
tsb,	0	/switch + button word
srr,	skp	/reader service switch
onn,	0	/mask of consoles on

	jmp ill
	jmp ti
	jmp re1 1
	jmp re9
	jmp d7
	jmp d8
	jmp d9

	0	/reader switch
	0	/punch switch
	0	/ext. reg. switch

	0	/knobs assigned
	0	/buttons assigned

	repeat 6,  0	/ext. eq. 1-6
	400020		/ext. eq 7 (radio astronomy)

adc,	066667	/administrator and mystic core rename














                
                                
/activation variables

aas,	005200	205200	375200	405200	505200	605200

ber,	0	0	0	0	0	0

dmi,	050000	40	20	10	4	2

jdm,	0	0	0	0	0	0

kdm,	0	76	76	76	76	76

pbb,	pb0	pb2	pb3	pb4	pb5	pb6

/private variables - set up with MYSTIC active and user inactive

/console 0

pb0,	0
	0
	0
	1
	0
	400000
	jmp d9
	066667
	0
	pb0 1
	jmp .
	jmp .
	0
	0
	0
	0
	jmp .
	jmp .
	jmp .
	0
	1
	0
	b1	/infinite defer loop if used
	jmp re1 1
	jmp re9
	666666





















                
                                
/console 2

pb2,	0	/assignment register 2
	0	/active AC
	0	/active IO
	0	/active PC
	0	/active PF
	400000	/active quantum word
	jmp d9	/active dispatch table pointer
	066667	/active core rename word
	0	/active drum initial address word
	ss2	/pointer to (pointer to inactive variables)
	jmp ill	/reader switch
	jmp ill	/punch switch
	dd2-1	/drum translation table
	0	/four words
	0	/...of private storage
	0	/...for a tyo-tyi translator
	jmp ti	/tyi dispatch address (used by translator)
	jmp z18	/tyi translator entry
	jmp z51	/tyo translator entry
	0	/why we started MYSTIC/ID
	0	/ID/MYSTIC here/ not here, etc.
	0	/user special fields
	bp2	/pointer to (pointer to breakpoint variables)
	jmp re1 1	/premature xe1 trap switch
	jmp re9	/where to go when reader is ready
	066666	/ID core rename word

ss2,	0	/table for inactive variables
	0	/inactive IO
	0	/inactive PC
	0	/inactive PF
	6374	/inactive quantum word
	jmp d7	/inactive dispatch table pointer
	066666	/inactive core rename word
	0	/inactive drum initial address word

dd2,	repeat 26, 0

bp2,	repeat 5, 0
























                
                                
/console 3

pb3,	0
	0
	0
	0
	0
	400000
	jmp d9
	066667
	0
	ss3
	jmp ill
	jmp ill
	dd3-1
	0
	0
	0
	jmp ti
	jmp z10
	jmp z50
	0
	0
	0
	bp3
	jmp re1 1
	jmp re9
	066666

ss3,	0
	0
	0
	0
	6374
	jmp d7
	066666
	0

dd3,	repeat 26, 0

bp3,	repeat 5, 0
























                
                                
/console 4

pb4,	0
	0
	0
	0
	0
	400000
	jmp d9
	066667
	0
	ss4
	jmp ill
	jmp ill
	dd4-1
	0
	0
	0
	jmp ti
	jmp z18
	jmp z51
	0
	0
	0
	bp4
	jmp re1 1
	jmp re9
	066666

ss4,	0
	0
	0
	0
	6374
	jmp d7
	066666
	0

dd4,	repeat 26, 0

bp4,	repeat 5, 0
























                
                                
/console 5

pb5,	0
	0
	0
	0
	0
	400000
	jmp d9
	066667
	0
	ss5
	jmp ill
	jmp ill
	dd5-1
	0
	0
	0
	jmp ti
	jmp z18
	jmp z51
	0
	0
	0
	bp5
	jmp re1 1
	jmp re9
	066666

ss5,	0
	0
	0
	0
	6374
	jmp d7
	066666
	0

dd5,	repeat 26, 0

bp5,	repeat 5, 0
























                
                                
/console 6

pb6,	0
	0
	0
	0
	0
	400000
	jmp d9
	066667
	0
	ss6
	jmp ill
	jmp ill
	dd6-1
	0
	0
	0
	jmp ti
	jmp z18
	jmp z51
	0
	0
	0
	bp6
	jmp re1 1
	jmp re9
	066666

ss6,	0
	0
	0
	0
	6374
	jmp d7
	066666
	0

dd6,	repeat 26, 0

bp6,	repeat 5, 0
























                
                                
/last page

constants

foo,	0

start


























































                
                                                                                         

