Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - utilities/filsiz.fai
There are no other files named filsiz.fai in the archive.
title filuse
search monsym

;This hack compliments of Daniel S. Blom

;Simple insertion sort of file group on basis of numeric key.
;insert key obtaining code starting at label KGET:

a=1
b=2
c=3
d=4
t=5
t1=t+1
pt=10
fpt=11
h=12
r=13
p=17

base==100000
.key==1
.name==2

loc 1000
head:	0
pdl:	-10,,.
	block 10

jfnblk:	gj%old+gj%fns+gj%cfm+gj%ifg
	.priin,,.priou
	0
	0
	0
	[asciz/EXE/]
	block 3



start:	reset
	move p,pdl
	hrroi a,[asciz/
Files: /]
	psout
	movei a,jfnblk
	movei b,
	gtjfn
	 jrst .err
	movei fpt,base
	setzm head
	move h,a		;save indexable handle
build:	hrrz b,a
	hrroi a,.name(fpt)
	move c,[byte (3) 0,0,1,1,1,0,0 (15) js%paf]
	jfns
	movei b,
	idpb b,a
	hrrzi d,1(a)

;Insert key obtainer here.  JFN is in H, return key in A.
KGET:
	hrrz a,h
	sizef
	 movei c,
	move a,c
;End of key insertion.

	movem a,.key(fpt)
	movei r,head
	pushj p,insert
	move fpt,d
	move a,h
	gnjfn
	 jrst list
	jrst build
list:	caie a,gnjfx1	;no more "error"?
	 jrst .err
	movei r,head
	pushj p,print
	hrroi a,[byte (7) 15,12]
	psout
	haltf
	jrst start

insrt1:	caml a,.key(t)	;in decreasing order
	 jrst insrt2
	hrrzi r,(t)
insert:	hrrz t,(r)
	jumpn t,insrt1
insrt2:	hrrzm t,(fpt)
	hrrzm fpt,(r)
	popj p,

print1:	hrroi a,.name(r)
	psout
	hrroi a,[byte (7) 11]
	psout
	movei a,.priou
	move b,.key(r)
	movei c,12
	nout
	 jrst .err
	hrroi a,[byte (7) 15,12]
	psout
print:	hrrz r,(r)
	jumpn r,print1
	popj p,

.err:	hrroi a,[byte (7) 15,12]
	psout
	movei a,.priou
	hrloi b,400000
	movei c,
	erstr
	 jfcl
	 jfcl
	haltf
	jrst start

asuppr
end start