                                
invisible debugger

xx=hlt
sdl=iot 3477

l=0
r=1
nbp=4

define disp low,upp
[upp-uc 44]x1000 low-uc 44
termin

define letter a,b
[b-uc 44]x1000 a
termin

out=tyo
in=tyi

define init a,b

law b
dap a
termin

define index a,b,c
idx a
sas b
jmp c
termin

define setup a,b
law i b
dac a
termin

define count a,b
isp a
jmp b
termin

define move a,b
lio a
dio b
termin

define feed a
law i a
jda fee
termin

define assign a
law a
arq
jmp bsy
termin

define dismiss a
law i a
arq
termin

define this a
a"	a
termin
                
                                
1637/
low,	this i	/low end initial symbol table
	this and
	this ior
	this xor
	this xct
	this jdp
	this cal
	this jda
	this lac
	this lio
	this dac
	this dap
	this dip
	this dio
	this dzm
	this adm
	this add
	this sub
	this idx
	this isp
	this sad
	this sas
	this mul
	this div
	this jmp
	this jsp
	this spq
	this szm
	this clo
	this szo
	this spi
	this sni
	this sma
	this sza
	this spa
	this szf
	this skp
	this szs
	this sft
	this ral
	this ril
	this rcl
	this sal
	this sil
	this scl
	this rar
	this rir
	this rcr
	this sar
	this sir
	this scr
	this law
	this iot
	this tyi
	this ckn
	this rrb
	this cks
	this dsc
	this asc
	this isb
	this cac
	this lsm
	this esm
	this cbs
	this dia
	this dba
	this dcc
	this dra
	this lem
	this eem
	this rbt
	this bpt
	this arq
	this dsm
	this wat
	this sdl
	this lei
	this lea
	this rer
	this nmn
	this nmf
	this ioh
	this rpa
	this rpb
	this tyo
	this ppa
	this ppb
	this dpy
	this lat
	this swp
	this lap
	this clc
	this cli
	this cla
	this cma
	this lia
	this lai
	this hlt
	this stf
	this clf
	this opr
	this nop
	this xx
	this 9s
	this 8s
	this 7s
	this 6s
	this 5s
	this 4s
	this 3s
	this 2s
	this 1s

est,	low	/end of symbol table, pointer to low end
                
                                
2200,
tsw,	0	/ac
	0	/io
	0	/pc
	0	/pf
	0	/dia word
bpl,	0	/location of first breakpoint
cn1,	0	/proceed counter
why,	0

2210,	jmp ent	/entry from user
2211,	jmp err	/illegal inst. in ID
2212,	jmp lse	/hit call in ID

ent,	jsp bpo
	lac tsw
	dac ac
	lac tsw 1
	dac io
	lac tsw 2
	dac pc
	lac tsw 3
	dac fg
	lac tsw 4
	dac diw
	lac why
	add (. 3
	dap . 1
	jmp .

	jmp cll	/hit call
	jmp 1bp	/breakpoint
	jmp cl	/dsm
	jmp ii	/illegal inst.

xe2,	-0	/location of last execute
nms,	0	/switch for interpret bpt
                
                                
bpi,	lio (-0	/breakpoints in
	jmp .+2
bpo,	cli	/breakpoints out
	dap p8
	dio dff
	dap bp6
	lac bp6+2
	dac bp2+1
	law bp5
	dap dpx
	spi i
	idx dpx
bp1,	law bk1
	dap bp3
bp2,	add (nbp
	0
	lac bp3
	xor p8
	sad dff
	jmp bp5 1	/ignore this
bp3,	lac .
	spa
	jmp bp5+1
	dac tas
	ral 6s
	and (17
	dac ts2
bp4,	lac .
	dac dep
	jmp dp0-2
bp5,	dac i bp4
	idx bp3
	sas (lac bk1 nbp
	jmp bp2
	cla
	sad dff
bp6,	jmp .
	law x1 1
bp6+2,	dap bp4		/used as a constant above
	dzm dff
	idx dpx
	lac .
	dac bp2+1
	jmp bp1
                
                                
so1,	rpb		/skip over input routine
soi,	rpb		/enter here
	spi i
	jmp so1

rbk,	dap rbx		/read a block into buffer
	law buf
	dac rb1
	dac la
	dzm chi
	rpb
	dio t2
	dio t
	spi
	jmp ls2	/start block
	rpb
	dio ch

	law i 1		/check for block format
	add ch
	sub t2
	and (777700
	sza
	jmp err
	law i 1
	add ch
	xor t2
	and (770000
	sza
	jmp err

rb0,	rpb
	dio i rb1
	lac i rb1
	adm chi
	idx rb1
	index t2,ch,rb0
	add chi
	add t
	rpb
	dio chi
	sas chi
	jmp cse
	lio t
	ril 1s
	cla
	spi
	dip t
	spi
	dip ch
rbx,	jmp .

rb1,	0
                
                                
bsy,	jsp lct
	lac (356224
	jda tys
	lac (223034
	jda tys
	jmp pn2

aa,	746100	0	/A
	747100	0	/I
	742700	0	/X
	746700	0	/G
	742600	0	/W
	746600	0	/F
	744400	0	/M
	744454	007201	/M+1
	744454	007202	/M+2
	746200	0	/B
b=1
repeat nbp-1,746254	7200 b	b=b 1

ac,	0		/Internal registers.
io,	0
xrg,	7775
pc,	0
diw,	0
fg,	0
msk,	-0
ll,	0
ul,	7777
bk1,repeat nbp,-0
nir=.-ac

.+nbp/
                
                                
pr0,	lac bkf
	xor pc
	and (177777
	sza	/proceed from bpt?
	jmp p1 2	/no
	init p8,bk1
p8,	lac .
	sad bpl	/one still there?
	jmp p9	/yes
	index p8,(lac bk1 nbp,p8
	jmp p1 2

p9,	lio (-0	/must interpret bpt
	jsp bpi 4
	law 1
	dac nms
	jmp p2

p1,	clc	/start user
	dac xe2
	jsp bpi
	dzm nms
	lac (add
	dac cn1
p2,	jsp lcc
	lac ac
	dac tsw
	lac io
	dac tsw 1
	lac pc
	dac tsw 2
	lac fg
	dac tsw 3
	lac diw
	dac tsw 4
	lac nms
	dsm	/go

xe0,	law xrg
	spi
	jmp n0
	move pc,opc
	move bkf,obf
	move bpl,obp
	lac xrg
	xct xsw
	dac fa
	law 7
	dip fa
	and lc2
	sas lc2
	jmp err
	rar 6s
	ior fa
	dac xe2	/execute address
	xor pc
	and (177777
	xor pc	/save overflow,extend
	dac pc
	ior (add
	dac tas
	ral 6s
	and (17
	dac ts2
	dzm tsp
	jda trc
	xct pvs
	jmp xc	/in core
	move wrd,x1
	lac xe2
	dap pvp
	lio pvp
	dia
	lio (3
	law x1
	dcc
	jmp dre
	jmp p1 2

x1,	0	/word to be executed
	bpt
	bpt

xc,	lac wrd
	jda dep
	idx tas
	lac x1 1
	jda dep
	idx tas
	jsp dep 1
	jmp p1 2

1bp,	lac xe2	/breakpoint
	sad (-0	/X in progress?
	jmp 2b	/no
	xor pc
	and (jda
	sza
	jmp 2b	/returned to wrong core
	lac pc
	and (177777
	sub xe2
	spa
	add (i
	sad (1
	jmp cl	/returned,no skip
	sas (2
	jmp 2b	/incorrect return
	jsp lcc	/skipped
	jmp cl

2b,	lac bpl
	b=0
repeat nbp-1,sad bk1 b	jmp 3b	b=b 1
	sas bk1 b
	jmp ii	/bpt not assigned
3b,	law 7255
	dac lwt
	move pc,bkf
	jmp pb

cll,	lio (7255	/call button
	jmp . 2

ii,	lio (741010	/illegal instruction
	clc
	dac bkf
	dac bpl

3bp,	dio lwt
	lac xe2
	sad (-0
	jmp pb	/X not in progress
	xor pc
	and (177777
	sza
	jmp pb
	law 7427	/this was an X
	jda tys
	lac lwt
	jda tys
	jsp lct
	lac xe2
	ior (add
	dac tas
	ral 6s
	and (17
	dac ts2
	dzm tsp
	jsp fet
	jda lwt

cl,	move obf,bkf	/dsm
	move obp,bpl
	lac opc
	xor pc
	and (177777
	xor pc
	dac pc
	clc
	dac opc
	dac obf
	dac obp
	jmp lse

ff,	lac iif
	sza
	jmp err
	lac sym l
	sza i
	lac sym r
	jdp spv
	lio let
	law syl
	spi i
	law tys
	dap sgn
	lac wrd
	xct sgn
	dac sys
	jsp lcc
	lio fa
	xct xsw
	cli
	lac sys
	arq
	jda ff2
	dac ff2
	jsp lcc
ff3,	lac ff2
	sad sys
	jmp lse
	ral 6s
	jda opt
	jmp lse
ff2,	0
	jmp ff3

start
                
                                                                                                                                                                                        

