
Microflit II

	define
	word N, V
	repeat 13, N=N+N
	N=N+trn-2000+20
	N+V
	term

	define
	routine V, N
	word N, V-lis
	term

	define
	number V, N
	word N, -V
	term

lis,	llr bki		|entry point
bk1,	opr		|opr or slr break addr

lse,	cal
	add crt
lss,	pno 40
	sto chc

lsp,	slr num
pls,	llr ls1
lsq,	slr sgn
	cla

lsr,	sto syl
	load lsa, add cht
	cal

ls1,	lcc
	trn ls1

lsa,	xx		|add cht
	trn lst

ls2,	clad lsa
	add one
	sto lsa
	add (-add-cht-nch+1
	trn ls1

err,	cal
	add (flex x
	pnt
	pnt
	tra lss

cht,	number 0, 76		|character table
	number 1, 25
	number 2, 17
	number 3, 7
	number 4, 13
	number 5, 23
	number 6, 33
	number 7, 27

	routine pls, 15
	routine pls, 10
	routine min, 35
	routine cr, 51
	routine ta, 45
	routine bar, 5
	routine bs, 43
	routine pra, 54
	routine beg, 64
	routine dot, 21
	routine q, 56
	routine ser, 46
	routine bk, 62
	routine eql, 11
	routine lc, 75
	routine alm, 6
	routine alm+1, 44
	routine alm+2, 70

lst,	add (2000
	trn ls2
	add (-20
	trn lsd
	add tls
	sto lsx
	llr syl

sgn,	xx
	add num
	sto num
	alo
	add chc
	trn .+2
	tra .+2
	llr t
lsx,	xx

alm,	add one		|a,l,m logic
	add one
	add (-msk

lsd,	alo		|digits
	sto chc
	add syl
	cyl
	cyl
	cyl
	lad
	tra lsr

ta,	trn ta3		|tab

tas,	tra lse

ta3,	add crt
	pno
	add c4
	ana
	llr .
	tra opt		|print addr
	add hcn
	pno
	llr t

ta5,	slr baa

ta6,	lac
	add c5
	sto tas
	sto crs
	sto bss
	add c5
	sto ta4

tab,	cla+101
	add tab
	pno

ta4,	xx
	llr .
	tra opt		|print contents
	add tab
	tra lss

bs,	trn .+2		|backspace
bss,	opr
	add one
	add baa
	alo
	tra ta3

bar,	add c4		|examine
	ano
	add chc
	trn ta6
	tra ta5

cr,	trn .+2		|carriage return
crs,	opr
	llr hcn
	slr crs
	cal+com-opr
	tra lss+1

min,	llr c1		|minus
	tra lsq

dot,	llr baa

q,	lcc
	tra lsd

bk,	trn ebk		|breakpoint
	add c4
	ana
	add (llr
	sto bk4
	add c3

bk3,	sto bk1
	sto bk5
	tra lse

ebk,	add bk1
	trn err
	clad hcn
	sto bk4
	tra bk3

tr,	slr lr		|break trap
	alo
	add chc
	add one
	trn pr2
	cla
	print flex ac 
	add bk1
	add (tra-slr+1
	sto prc
c1,	lac
	sto ac
	llr bki
	slr bix
	llr .
	tra opt
	add tab
	pno
	print flex lr 
	add lr
	llr .
	tra opt

tls,	tra lis

pra,	trn bg1		|proceed

pr1,	add crt
	pno
	lcc
	add one
bk4,	opr		|llr bka
	slr bki
	llr (tra tr
bk5,	opr
	llr ac

pr2,	sto chc
	lac
	llr lr

bix,	tra err

prc,	tra err

beg,	trn err		|go to routine
	add c4
	ana
	add (tra
	sto bix

bg1,	cal
	tra pr1

eql,	lac		|equal sign
	llr .
	tra opt

eq2,	add tab
	pno
	tra pls

lc,	lac		|lower case
	pnt
	pnt
	pno
	tra eq2

ser,	trn err		|word search
	add msk
	ano
	add crt
	pno
	slr num
	add ll
	tra sr4

sr,	cla
	llr msk

t,	xx
	ano
	add num
	lpd
	trn sr3
	amz
	trn sr2

sr3,	clad chc
	add one

sr4,	sto t
	sto chc
	add ul
	trn sr
	tra lse

sr2,	add t
	add c3
	llr .
	tra opt
	add hcn
	pnt
	pno

chc,	xx
	llr .
	tra opt
	add crt
	pno
	tra sr3

|Octal print subroutine.


opt,	sto t
	lac
	add (tra-llr+2
	sto opx
	load opu, trn opj

opq,	llr t
	lal
	cyl
	cyl
	sto t
	llr (7
	ana
	llr opj+2
	add (add fch
	sto .+1
	xx

opu,	xx
	slr opu

bpj,	pno
	add opc
	cyr
	sto opc
	trn opq
	cyl
	trn opq-1
	cal
opx,	xx

opc,	171717

fch,	flex  0t-add-.
	flex 11 -add-.
	flex 22 -add-.
	flex 33 -add-.
	flex 44 -dadd-.
	flex 55 -add-.
	flex 66 -add-.
	flex 77 -add-.

|Constants and variable storage

	nch=lst-cht

c2,	add
c3,	-add
c4,	17777
c5,	slr

constants

one,	1
hcn,	opr 307
crt,	char r


num,	0
syl,	0
bki,	0
baa,	0
ac,	0
lr,	0
msk,	-0
ll,	add
ul,	-add-17777

start add lis
