Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/sys/libsim.mic
There is 1 other file named libsim.mic in the archive. Click here to see a list.
! --- LIBSIM ---
! --------------
; LIBSIM MICro by Lars Enderin and Mats Ohlin FOA, Ph. (08) 63 15 00
; Date 75-10-31
.IF ($T+$U+$V+$W+$X+$Y+$Z#"") .GOTO OVFLW
.IF ($A#"") .GOTO START
HELP::
.REVIVE
; LIBSIM
; ======
;
; The LIBSIM MICro is designed for maintenance of LIBSIM files.
;
; Adding modules to LIBSIM (creates LIBSIM.ATR and LIBSIM.REL if necessary):
;
; ./LIBSIM ADD,b
; ./LIBSIM ADD,c,d,e,f      etc.
;
; Replacing modules b and c :
;
; ./LIBSIM REP,b,c
;
; Deleting b,c,d :
;
; ./LIBSIM DEL,b,c,d
;
; Inserting a,b,c before x :
;
; ./LIBSIM INS,x,a,b,c
;
; Extracting b.atr and b.rel, c.atr and c.rel as separate files
; from LIBSIM[123,456] :
;
; ./LIBSIM EXT[123,456],b,c
;
; Creating index blocks on LIBSIM.ATR, LIBSIM.REL (required for LIBSIM.ATR) :
;
; ./LIBSIM X
;
; May be necessary if another operation on LIBSIM destroyed the index.
;
; Listing size of modules in your own LIBSIM:
;
; ./LIBSIM LST
;
; Listing entry point names of SYS:LIBSIM :
;
; ./LIBSIM SYS:S   (equivalent to ./LIBSIM S[1,4])
;
; Creating a sorted directory of the library contents
; of the library LIBSIM[123,345] in the file LIBSIM.DIR:
;
; ./LIBSIM P[123,345]
;
;
;
.GOTO EXIT
START::
.ERROR ?
; Store action parm in X
.LET X=$A.[1,"["]+$A.["]",999]
; Store ppn in Y
.LET Y=$A.[1,$X]+$A.[$X,999]
.IF ($X.[1,":"]="'X") .GOTO NODEV
.IF ($X.[1,":"]="SYS") .LET Y="[1,4]"
.IF ($X.[1,":"]="sys") .LET Y="[1,4]"
.LET X=$X.[":",999]
NODEV::
; ACTION(X)='X, PPN(Y)='Y
.IF ($X.[1]<="Z") .GOTO UC
.IF ($X.[1]="a") .LET X="A"
.IF ($X.[1]="d") .LET X="D"
.IF ($X.[1]="e") .GOTO EXT
.IF ($X.[1]="i") .LET X="I"
.IF ($X.[1]="h") .BACKTO HELP
.IF ($X.[1]="l") .GOTO LST
.IF ($X.[1]="r") .LET X="R"
.IF ($X.[1]="p") .GOTO DIR
.IF ($X.[1]="s") .GOTO LST
.IF ($X.[1]="x") .GOTO INDEX
UC::
.IF ($X.[1]="E") .GOTO EXT
.IF ($X.[1]="H") .BACKTO HELP
.IF ($X.[1]="L") .GOTO LST
.IF ($X.[1]="S") .GOTO LST
.IF ($X.[1]="X") .GOTO INDEX
.IF ($X.[1]="P") .GOTO DIR
.IF ("'B"="") .BACKTO HELP
.LET W=$B+".ATR",U=$B
.LET Z=0
.IF ($X.[1]#"I") .LET T="'B"+".REL"
.IF ($X.[1]="I") .LET U="<"+"'B"+">"
.IF ($X.[1]="I") .LET W="<"+"'B"+">"
COUNT::
.LET Z=Z+1
.LET V="''"+"CDEFGHIJKLMNOPQRS".[Z]
.IF ("'V"="") .GOTO ENDCNT
.IF ($X.[1]#"D") .LET W=$W+","+"'V"+".ATR"
.LET U=$U+","+"'V"
.LET T=$T+","+"'V"+".REL"
; 'T
.BACKTO COUNT
ENDCNT::
.IF ($X.[1]="A") .GOTO ADD
.IF ($X.[1]="D") .GOTO DEL
.IF ($X.[1]="I") .GOTO INS
.IF ($X.[1]="R") .GOTO REP
! ? Illegal 1st parameter: 'X
! Available args: A(DD), D(ELETE), R(EPLACE), I(NSERT), E(XTRACT),
! L (list modules with sizes), S (list modules with entry names),
! X (make an index)
.GOTO EXIT
ADD::
.ERROR %
.dir/F LIBSIM.REL'Y
.IF (NOERROR) .GOTO ADDREL
.IF ($Y#"") .GOTO NOLIB
.REVIVE .ERROR ?
.RENAME LIBSIM.REL='B.REL
.IF (ERROR) .COP LIBSIM.REL='B.REL
.LET T=$T.[",",999],U=$U.[",",999]
ADDREL::
.IF ($T="") .GOTO CRELIB
.ERROR ?
.REVIVE
.r fudge2
*LIBSIM'Y=LIBSIM'Y,'U/A
.IF (NOERROR) .delete 'T
.IF (ERROR) .
CRELIB::
.ERROR %
.dir/F LIBSIM.ATR
.IF (NOERROR) .GOTO ADDATR
.REVIVE .ERROR ?
.ren LIBSIM.ATR='B.atr
.IF (ERROR) .COP LIBSIM.ATR='B.atr
.LET W=$W.[",",999]
ADDATR::
.IF ($W="") .GOTO INDEX
.ERROR ?
.REVIVE
.r fudge2
*LIBSIM.ATR'Y=LIBSIM.ATR'Y,'W/A
.IF (NOERROR) .delete 'W
.IF (ERROR) .GOTO INDEX
.GOTO INDEX
DEL::
.NOERROR
.REVIVE
.r fudge2
*LIBSIM'Y=LIBSIM'Y<'U>/D
*LIBSIM.ATR'Y=LIBSIM.ATR'Y<'U>/D
.GOTO INDEX
INS::
.ERROR %
.LET T=$T.[",",999]
.LET V="0"+"''"+"<JOB>LIB.TMP"
.REVIVE
.dir/F 'T
.IF (ERROR) .GOTO INSATR
.ERROR ?
.COP 'V(B)='T
.r fudge2
*LIBSIM'Y=LIBSIM'Y<'B>,'V/I
.IF (NOERROR) .del 'T
.IF (ERROR) .
INSATR::
.ERROR %
.LET U=$W.[",",999]
.dir/F 'U
.IF (ERROR) .GOTO XREL
.ERROR ?
.COP 'V(B)='U
.r fudge2
*LIBSIM.ATR'Y=LIBSIM.ATR'Y<'B>,'V/I
.IF (NOERROR).del 'U,'V
.IF (ERROR) .GOTO INDEX
.GOTO INDEX
REP::
.LET Z=0,U=$B
.ERROR ?
LREP::
.REVIVE .r fudge2
*LIBSIM'Y=LIBSIM'Y<'U>,'U/R
.IF (NOERROR) .del 'U.rel
.IF (ERROR) .
.r fudge2
*LIBSIM.ATR'Y=LIBSIM.ATR'Y<'U>,'U.atr/R
.IF (ERROR) .GOTO INDREL
.del 'U.atr
.SILENCE
.LET Z=Z+1,U="''"+"CDEFGHIJKLMNOPQRS".[Z]
.IF ("'U"="") .GOTO INDEX
.BACKTO LREP
EXT::
.LET Z=0,U=$B
LEXT::
.REVIVE .r fudge2
*'U.REL=LIBSIM.REL'Y<'U>/E
*'U.ATR=LIBSIM.ATR'Y<'U>/E
.SILENCE
.PROT <157> 'U.REL,'U.ATR
.LET Z=Z+1,U="''"+"CDEFGHIJKLMNOPQRS".[Z]
.IF ("'U"="") .GOTO EXIT
.BACKTO LEXT
LST::
.REVIVE
.r fudge2
*tty:=LIBSIM'Y/'X
*tty:=LIBSIM.ATR'Y/'X
.GOTO EXIT
DIR::
.ERROR %
.DIR/F LIBSIM.REL'Y
.IF (ERROR) .GOTO NOLIB
.let Z="00"+$JOB,Z=$Z.[-3,3]
.ERROR ?
.r fudge2
*'ZATR.TMP=libsim.atr'Y/s
*'ZREL.TMP=libsim'Y/s
.r teco
*er'ZATR.TMPEy
*ew'ZTOT.TMP
*0u00u10u2
*<N^I;i(A%0-9"G0u0%1-9"G0u1%2''''q2\q1\q0\i) l>p
*ER'ZREL.TMPEY
*0u00u10u2
*<N^I;i(R%0-9"G0u0%1-9"G0u1%2''''q2\q1\q0\i) l>ex
.IF ($Y="") .LET Y="["+$PROJECT+","+$PROGRAMMER+"]"
.r pip
**.*/w/t='ZTOT.TMP
*sort!
*LIBSIM.DIR='ZTOT.TMP/REC:80/KEY:1:6/KEY:10:1/CORE:10K/RUN:TECO
*ERLIBSIM.DIREy
*AAAAA
*j<s(;((1a)-^^^^R)"E0l-2d9i9is''dl>
*EWLIBSIM.DIR
*ji	Contents of LIBSIM'Y at ^^O61u33<q3,^^O11^^gu2q2-10"li0''q2\i:%3>-d
*.u4^^O56,^^O11^^gU1^^O57,^^O11^^gU2^^O60,^^O11^^gU3
*ZJ.U0IJanFebMarAprMayJunJulAugSepOctNovDecQ0j(Q2-1)*3C.,.+3X2Q0,ZK
*ZJQ3-10"LI0''Q3\I-2-(Q1-1900)\
*Q0J.,ZX0.,ZKQ4Ji g0i
*
*	LIBSIM.ATR			LIBSIM.REL
*	Module	(Seq)	Entry		Module	(Seq)	Entry
*
*
*1ua<qa\i	%al-(1a);>
*EDPIPEX
**.*<177>/r='Z???.TMP
*dsk:/d='Z???.TMP
! LIBSIM.DIR now created
.GOTO EXIT
INDEX::
.REVIVE
.r fudge2
*LIBSIM'Y=LIBSIM'Y/x
*LIBSIM.ATR'Y=LIBSIM.ATR'Y/x
.
.GOTO EXIT
INDREL::
.r fudge2
*LIBSIM'Y=LIBSIM'Y/x
.GOTO EXIT
OVFLW::
! Too many parameters
.GOTO EXIT
NOLIB::
! ? Cannot find LIBSIM'Y
EXIT::
! End of MICRO
.