Trailing-Edge
-
PDP-10 Archives
-
cuspjul86upd_bb-jf24a-bb
-
10,7/snoopy/tatsub.mac
There are 6 other files named tatsub.mac in the archive. Click here to see a list.
TITLE TATSUB - SUBROUTINES FOR TATTLE V2 AND FORTRAN-10
SEARCH UUOSYM
ENTRY SYMSRC, SYMINT
CH=0
N=1
N1=2
L=16
P=17
BLKSIZ==200 ;SIZE OF A DISK BLOCK
EXELEN==40 ;MAXIMUM LENGTH OF .EXE DIRECTORY
SUBTTL SYMINT - LOADS A SYMBOL TABLE INTO CORE
;CALLING SEQUENCE
; CALL SYMINT(FILE)
;FILE IS ADDRESS OF COMPLETE FILESPEC (DEV,FILE,EXT,PPN,SFD1,SFD2,...)
SYMINT: MOVEI 10,@1(L) ;ADDRESS OF FILE SPEC
MOVEI 1,11 ;LOOP COUNT
MOVE 2,10 ;COPY OF FILE SPEC ADDRESS
MOVEI 3,SYMFSP+.FOFDV ;FILE SPEC FROM LAST CALL
SYMIN1: MOVE 0,(2) ;GET NEXT WORD OF FILE SPEC
CAMN 0,(3) ;SAME AS STORED COPY?
SOJG 1,SYMIN1 ;YES, LOOP BACK FOR ENTIRE SPEC
JUMPN 1,SYMGET ;IF ANY DIFFERENCES, GET SYMBOL TABLE
POPJ P, ;ELSE RETURN
SYMGET: HRLI 0,0(10) ;MAKE A COPY OF SUPPLIED SPEC
HRRI 0,SYMFSP+.FOFDV ;...
BLT 0,SYMFSP+.FOFSF+4 ;...
REINIT: SETZM SYMFIL ;FLAG NO SYMBOL TABLE IN CORE
MOVEI 0,.IODMP ;SET UP OPEN BLOCK
MOVEM 0,SYMOPN+.OPMOD ;...
MOVE 0,SYMFSP+.FOFDV ;...
MOVEM 0,SYMOPN+.OPDEV ;...
MOVE 0,SYMFSP+.FOFFN ;SET UP LOOKUP BLOCK
MOVEM 0,SYMLKP+0 ;...
MOVE 0,SYMFSP+.FOFEX ;...
MOVEM 0,SYMLKP+1 ;...
MOVE 0,SYMFSP+.FOFPP ;GET PPN
SKIPE SYMFSP+.FOFSF ;ANY SFDS?
MOVEI 0,SYMPTH ;YES, GET POINTER TO PATH BLOCK
MOVEM 0,SYMLKP+3 ;STORE IN LOOKUP BLOCK
HRLI 0,SYMFSP+.FOFPP ;SET UP PATH BLOCK
HRRI 0,SYMPTH+.PTPPN ;...
BLT 0,SYMPTH+.PTSFD+4 ;...
OPEN SYMOPN ;OPEN SYMBOL FILE
JRST E.INIT ;ERROR
LOOKUP SYMLKP ;LOOKUP FILE
JRST E.LOOK ;ERROR, ASK FOR FILE NAME
MOVE 0,[2,,1] ;ASK MONITOR FOR EXACT FILE SPEC
MOVE 1,[0,,.FOFIL] ;...
MOVE 2,[11,,SYMFSP] ;...
FILOP. 0, ;...
JFCL ;...
SKIPE 3,OJOBFF ;BEEN HERE BEFORE?
JRST .+3 ;YES
MOVE 3,.JBFF ;NO, RESET FIRST FREE
MOVEM 3,OJOBFF ;SAVE IT FOR NEXT TIME
HRRM 3,CL1 ;SET UP ADDRESS OF DUMP I/O LIST
SOS CL1 ;MAKE IT AN IOWD
ADDI 3,BLKSIZ ;ONE BLOCK BUFFER
CAMG 3,.JBREL ;NEED MORE SPACE?
JRST .+3 ;NO
CORE 3, ;YES, ASK FOR IT
JRST E.CORE ;ERROR
INPUT CL1 ;READ THE FIRST BLOCK
MOVE 3,OJOBFF ;GET ADDRESS OF BUFFER
HLRZ 1,0(3) ;GET FIRST WORD OF FILE
SETZM EXEFLG ;ASSUME NOT .EXE FORMAT
CAIE 1,.SVDIR ;EXE FILE?
JRST NOEXE1 ;NO
HRRZ 1,0(3) ;GET WORDS
TRNN 1,1 ;MUST BE ODD
JRST E.DIRE ;NOPE
SUBI 1,1 ;MAKE EVEN
CAILE 1,EXELEN ;TOO BIG?
JRST E.DIRL ;YEP
MOVSI 2,1(3) ;SET TO COPY DIRECTORY
HRRI 2,EXEDIR ; TO HERE
BLT 2,EXEDIR-1(1) ;COPY IT
MOVNS 1 ;MAKE AN AOBJN POINTER
HRLI 1,EXEDIR ;...
MOVSM 1,DIRPTR ;SAVE POINTER
SETOM EXEFLG ;REMEMBER AN EXE FILE
USETI 5 ;SET FOR FIRST DATA BLOCK
INPUT CL1 ;READ FIRST REAL BLOCK OF FILE
NOEXE1: SKIPN 1,.JBSYM(3) ;GET SYMBOL TABLE POINTER
JRST E.SYMT
JUMPL 1,NOTEXT ;NON-EXTENDED
MOVE 10,1 ;SAVE A PERMANENT COPY
AOS 4,10 ;COPY AND BUMP PROCESS ADDRESS
PUSHJ P,PA2FA ;GET FILE ADDRESS
IDIVI 4,BLKSIZ ;CONVERT TO A BLOCK NUMBER
USETI 1(4) ;POSITION
INPUT CL1 ;READ THE BLOCK
HRRZ 1,CL1 ;GET ADDRESS OF BLOCK READ
LDB 2,[POINT 7,10,35] ;GET OFFSET FOR OUR WORD
ADD 1,2 ;WORD WE WANT (LENGTH OF S.T.)
HRRZ 1,1(1) ;GET IT
MOVEM 1,STLEN ;SAVE IT
AOS 4,10 ;COPY AND BUMP PROCESS ADDRESS
PUSHJ P,PA2FA ;GET FILE ADDRESS
IDIVI 4,BLKSIZ ;CONVERT TO A BLOCK NUMBER
USETI 1(4) ;POSITION
INPUT CL1 ;READ THE BLOCK
HRRZ 1,CL1 ;GET ADDRESS OF BLOCK READ
LDB 2,[POINT 7,10,35] ;GET OFFSET FOR OUR WORD
ADD 1,2 ;WORD WE WANT (ADDRESS OF S.T.)
MOVE 1,1(1) ;GET IT
MOVE 2,STLEN ;GET LENGTH
JRST GOTPTR ;HANDLE IT
NOTEXT: HRRZS 1 ;CLEAR LH
HLRO 2,.JBSYM(3) ;GET -VE LENGTH
MOVNS 2 ;MAKE +VE
GOTPTR: MOVE 3,OJOBFF ;GET OLD JOBFF AGAIN
ADD 3,2 ;ADD IN SIZE OF SYMBOL TABLE
MOVEM 3,.JBFF ;SAVE NEW FIRST FREE
CORE 3, ;ASK FOR MORE CORE
JRST E.CORE
MOVE 4,1
SKIPN EXEFLG ;EXE FILE?
JRST GETSYM ;NO
PUSHJ P,PA2FA ;CONVERT PROCESS ADDRESS TO FILE ADDRESS
GETSYM: IDIVI 4,BLKSIZ
USETI 1(4)
INPUT CL1
MOVE 4,OJOBFF
ADDI 4,BLKSIZ-1
SUB 4,5
JUMPE 5,NOBLT
MOVE 6,OJOBFF
ADD 6,5
HRLS 6
HRR 6,OJOBFF
BLT 6,(4)
NOBLT: HRRM 4,CL2
SUBI 5,BLKSIZ
ADD 5,2
MOVNS 5
HRLM 5,CL2
INPUT CL2
RELEASE 0
MOVE 4,OJOBFF
ADD 4,2
SOS 4
MOVEM 4,SYMST
SETOM @0(L)
MOVEI 1,@1(L)
HRLI 0,SYMFSP+.FOFDV
HRRI 0,0(1)
BLT 0,10(1)
SETOM SYMFIL ;FLAG SYMBOL TABLE SETUP
POPJ P,
OJOBFF: 0
EXEFLG: 0
EXEDIR: BLOCK EXELEN
DIRPTR: 0
STLEN: 0
SYMST: 0
CL1: IOWD 200,.-.
0
CL2: 0
0
SYMOPN: BLOCK 3
SYMLKP: BLOCK 4
SYMPTH: BLOCK 10
SYMFSP: BLOCK 15
SYMDFS: SIXBIT /SYS/
SIXBIT /SYSTEM/
SIXBIT /EXE/
0
BLOCK 5
;ROUTINE TO CONVERT PROCESS ADDRESS TO FILE ADDRESS.
;CALLED WITH PROCESS ADDRESS IN 4, RETURNS FILE ADDRESS IN 4.
PA2FA: MOVE 7,4 ;SAVE A COPY
LSH 4,-9 ;GET PAGE NUMBER
MOVE 6,DIRPTR ;GET POINTER TO DIRECTORY
GETEX1: LDB 3,[POINT 9,1(6),8] ;GET RPT CNT
HRRZ 5,1(6) ;GET PROCESS PAGE #
ADD 3,5 ;GET HIGHEST PAGE # IN HUNK
CAML 4,5 ;S.T. IN THIS HUNK?
CAMLE 4,3 ;...
JRST GETEX2 ;NO
SUB 4,5 ;GET PAGE OFFSET IN 4
HRRZ 3,0(6) ;GET FPN
ADD 4,3 ;ADD TO OFFSET
LSH 4,9 ;NOW MAKE IT AN ADDRESS
DPB 7,[POINT 9,4,35] ;FOR OUTSIDERS TO USE
POPJ P, ;RETURN
GETEX2: AOBJN 6,.+1 ;2 WORD ENTRIES IN DIRECTORY
AOBJN 6,GETEX1 ;KEEP LOOKING
JRST E.CFST ;ERROR, CAN'T FIND S.T.
E.INIT:
E.LOOK: OUTSTR [ASCIZ /?LOOKUP failure for /]
ERRFIL: PUSH P,L
MOVEI L,[EXP SYMFSP+.FOFDV, AZNAM]
PUSHJ P,TRANFS
POP P,L
OUTSTR AZNAM
OUTSTR [ASCIZ /
/]
PUSH P,L
MOVEI L,[EXP [ASCIZ/Monitor file: /], NULFLG, SYMDFS, SYMFSP+.FOFDV]
PUSHJ P,GETFSP
POP P,L
SKIPN NULFLG ;NULL RESPONSE?
JRST REINIT ;TRY AGAIN
SETZM SYMFIL ;YES, USE NO SYMBOLS
HRLI 0,SYMFSP+.FOFDV ;CLEAR SAVED FILE SPEC
HRRI 0,SYMFSP+.FOFDV+1 ;...
SETZM SYMFSP+.FOFDV ;...
BLT 0,SYMFSP+.FOFSF+4 ;...
SETZM @0(L)
MOVEI 1,@1(L) ;GET ADDRESS OF ARGUMENT FILE SPEC
HRLI 0,0(1) ;CLEAR
HRRI 0,1(1) ;...
SETZM (1) ;...
BLT 0,10(1) ;...
POPJ P,0
E.SYMT: OUTSTR [ASCIZ /?Can't find symbol table in /]
JRST ERRFIL
SYMFIL: 0
AZNAM: BLOCK 15
E.CORE: OUTSTR [ASCIZ /?Insufficient core to read /]
PUSH P,L
MOVEI L,[EXP SYMFSP+.FOFDV, AZNAM]
PUSHJ P,TRANFS
POP P,L
OUTSTR AZNAM
OUTSTR [ASCIZ / symbol table
/]
SETZM SYMFIL ;FLAG NO SYMBOL TABLE
POPJ P,0
E.DIRE: OUTSTR [ASCIZ /?Bad directory format in /]
JRST ERRFIL
E.DIRL: OUTSTR [ASCIZ /?Directory too long in /]
JRST ERRFIL
E.CFST: OUTSTR [ASCIZ /?Can't find symbol table in /]
JRST ERRFIL
SUBTTL SYMSRC - SEARCHES SYMBOL TABLE LOADED BY SYMINT
;CALLING SEQUENCE
; CALL SYMSRC(ADDR, GLOBAL, LOCAL, VALUE)
;ADDR IS INPUT
;GLOBAL IS MODULE NAME CONTAINING ADDR
;LOCAL IS HIGHEST VALUED SYMBOL WITH VALUE LESS OR EQUAL ADDR
;VALUE IS VALUE OF LOCAL
SYMSRC: MOVE 10,@(L) ;PICK UP SEARCH ADDRESS
SKIPN SYMFIL ;DO WE HAVE A SYMBOL TABLE?
JRST SYMERR ;NO, RETURN BLANKS
MOVE 6,SYMST ;END OF SYMBOL TABLE
SETZ 5, ;INIT BEST VALUE SEEN TO ZERO
SYMSR1: MOVE 7,6 ;SAVE POINTER
HLRO 1,(6) ;-VE LENGTH OF THIS MODULE
ADD 6,1 ;POSITION TO NEXT MODULE
HRL 1,6 ;BUILD AN AOBJN POINTER TO MODULE
MOVSS 1 ;...
ADD 1,[2,,1] ;SKIP MODULE NAME
SYMSR2: MOVE 0,0(1) ;GET NAME AND FLAGS
TLNE 0,(40B5) ;SUPPRESSED ON OUTPUT?
JRST SYMSR3 ;YES, IGNORE THIS SYMBOL
MOVE 0,1(1) ;GET VALUE
CAMLE 0,5 ;BETTER THAN BEST SO FAR?
CAMLE 0,10 ; BUT NOT GREATER?
JRST SYMSR3 ;NOPE
MOVE 3,1 ;SAVE POINTERS
MOVE 4,7 ;...
MOVE 5,0 ;...
CAMN 5,10 ;EXACT MATCH?
JRST SYMSR4 ;YES, ALL DONE
SYMSR3: AOBJN 1,.+1 ;ADVANCE POINTER
AOBJN 1,SYMSR2 ;LOOP
CAMLE 6,OJOBFF ;GONE PAST THE END?
JRST SYMSR1 ;NO, KEEP LOOKING
SYMSR4: JUMPE 5,SYMERR ;ERROR IF NO MATCH
MOVE -1(4) ;GET MODULE NAME
JSP 2,R50 ;CONVERT IT
MOVEI 1,@1(L) ;ARG LIST ADDRESS
DMOVEM 11,(1) ;STORE
MOVE (3) ;GET SYMBOL NAME
JSP 2,R50 ;CONVERT IT
MOVEI 1,@2(L) ;ARG LIST ADDRESS
DMOVEM 11,(1) ;STORE
MOVE 1(3) ;VALUE
MOVEM @3(L) ;STORE
POPJ P, ;RETURN
SYMERR: MOVEI 1,@1(L) ;OTHERWISE , RETURN BLANK
MOVE [ASCII/ /]
MOVEM (1)
MOVEM 1(1)
SYMER1: MOVEI 1,@2(L)
MOVE [ASCII/ /]
MOVEM (1)
MOVEM 1(1)
MOVEM 10,@3(L)
POPJ P,0
;ROUTINE TO CONVERT RADIX-50 SYMBOL NAME TO ASCII. CALLED WITH
;RADIX-50 NAME IN AC 0, RETURNS ASCII NAME IN AC'S 11 AND 12.
R50: SETZB 11,12
MOVE 13,[POINT 7,11]
MOVEI 14,6
TLZ 740000
LOOP3: IDIVI 50
JUMPE 1,R5BLNK
CAIN 1,46
JRST R5$
CAIN 1,47
JRST R5%
CAIN 1,45
JRST R5.
CAIGE 1,13
JRST R5NUMB
ADDI 1,266
R51: PUSH P,1
SOJG 14,LOOP3
MOVEI 14,6
LOOP4: POP P,1
IDPB 1,13
SOJG 14,LOOP4
JRST (2)
R5BLNK: MOVEI 1,240
JRST R51
R5$: MOVEI 1,244
JRST R51
R5%: MOVEI 1,245
JRST R51
R5.: MOVEI 1,256
JRST R51
R5NUMB: ADDI 1,257
JRST R51
;READ A DEV:FILE.EXT[P,PN] FROM TTY
GETFSP: OUTSTR @0(L) ;OUTPUT PROMPT STRING
SETZM @1(L) ;ASSUME NON-NULL RESPONSE
MOVEI 10,@3(L) ;GET ADDRESS OF FILE SPEC TO STORE
HRLI 0,@2(L) ;PRESET DEFAULT
HRR 0,10 ;...
BLT 0,10(10) ;...
PUSHJ P,SIXBN ;TRY TO READ DEVICE/FILENAME
JUMPGE CH,.+2 ;IF TERM NOT BREAK, OK
JUMPE N,NULRET ;ELSE, IF NO NAME, RETURN NULL
CAIE CH,":"
JRST NODEV ;NOT A NEW DEVICE
MOVEM N,0(10) ;RETURN NEW DEVICE NAME
PUSHJ P,SIXBN ;AND COLLECT NEXT WORD
NODEV: JUMPE N,.+2 ;DON'T STORE ZERO
MOVEM N,1(10) ;SAVE NAME
CAIE CH,"." ;CHECK FOR EXT SPECIFIED
JRST FILPPN ;NO, LOOK FOR PPN
PUSHJ P,SIXBN
TRZ N,-1 ;THREE CHARS ONLY
MOVEM N,2(10) ;SAVE EXT
JUMPL CH,RETNAM ;IF EOL, RETURN
FILPPN: CAIE CH,"[" ;IS THERE A PPN?
JRST EOLCHK ;NO, CHECK FOR BREAK TERMINATOR
PUSHJ P,OCTN ;COLLECT PROJECT
MOVEI N1,(N) ;SAVE IT
CAIE CH,"," ;CHECK ITS A COMMA
JRST WHAT ;SOMETHINGS WRONG
PUSHJ P,OCTN ;GET PROGRAMMER
HRLI N,(N1) ;COMBINE
GETPPN 3, ;GET ACTUAL PPN
JFCL ;...
TLNN N,777777 ;DEFAULT PROJECT?
HLL N,3 ;YES
TRNN N,777777 ;DEFAULT PROGRAMMER?
HRR N,3 ;YES
MOVEM N,3(10) ;STORE PPN
MOVEI 11,5 ;GET SFD COUNT
MOVEI 10,4(10) ;POINT TO FIRST SFD IN FILE SPEC
FILPTH: CAIE CH,"," ;STILL IN SFD LIST?
JRST EOPCHK ;NO, GO CHECK FOR END OF PPN
PUSHJ P,SIXBN ;GET NEXT SFD
JUMPE N,.+2 ;DON'T STORE ZERO
MOVEM N,0(10) ;STORE NEXT SFD
AOJ 10, ;UPDATE SFD LIST ADDRESS
SOJG 11,FILPTH ;LOOP BACK FOR MAX PATH SPEC
EOPCHK: CAIN CH,"]" ;CHECK TRAILING BRACKET
PUSHJ P,INCH ;ELSE PICK UP BREAK CHAR
EOLCHK: JUMPGE CH,WHAT ;ASK AGAIN IF NOT <CR>
RETNAM: POPJ P,0
WHAT: OUTSTR [ASCIZ /?Syntax error in file specification
/]
PUSHJ P,INCH ;SEARCH FOR END OF LINE
JUMPGE CH,.-1
JRST GETFSP ;THEN ASK AGAIN
NULRET: SETOM @1(L) ;FLAG NULL RESPONSE
POPJ P,0
NULFLG: 0
SIXBN: SETZ N, ;CLEAR RESULT
MOVE N1,[POINT 6,N]
SIXBL: PUSHJ P,INCH
CAIL CH,"0"
CAILE CH,"Z"
POPJ P,
CAIGE CH,"A"
CAIG CH,"9"
JRST .+2
POPJ P,
SUBI CH,40 ;CONVERT TO SIXBIT
TLNE N1,(77B5) ;WORD FULL?
IDPB CH,N1 ;NO, STORE ANOTHER CHAR
JRST SIXBL
OCTN: SETZ N, ;CLEAR ACCUMULATOR
OCTL: PUSHJ P,INCH
CAIL CH,"0"
CAILE CH,"7" ;IS IT AN OCTAL DIGIT?
POPJ P,
LSH N,3 ;YES, SHIFT LEFT FOR IT
ANDI CH,7 ;STRIP EXTRA BITS
ADD N,CH
JRST OCTL ;GET NEXT
INCH: INCHWL CH ;GET A CHAR
CAIN CH,15 ;CR WILL BE FOLLOWED BY LF
JRST INCH ;SO USETHAT AS TERMINATOR
CAIL CH,140 ;CHECK FOR LOWER CASE
TRZ CH,40 ;AND FORCE UPPER
CAIL CH,12 ;LOOK FOR BREAKS
CAILE CH,15
CAIN CH,33 ;INCLUDING ALTMODE
SETO CH, ;SET BREAKS NEGATIVE
POPJ P,
SUBTTL MINOR UTILITIES
ENTRY RHIST,RHISTN,TRAN67,TRAN6B
KLU67: 0
PUSHJ P,TRAN67
JRA L,2(L)
TRAN6B: MOVSI (JFCL) ;SET TO STORE BLANKS
JRST TRAN
TRAN67: MOVE [JUMPE BHJ] ;SET TO STORE NULLS
TRAN: MOVEM BHAN
MOVEI 1,@(L)
HRLI 1,(<POINT 6>)
MOVEI 2,@1(L)
HRLI 2,(<POINT 7>)
MOVEI 3,6
LOOP67: ILDB 1
BHAN: JUMPE .+2
ADDI 40
BHJ: IDPB 2
SOJG 3,LOOP67
IDPB 3,2 ;STORE TRAILING NULL
POPJ P,0
RHISTN: MOVEI 10,@0(L) ;GET ADDRESS OF FILE SPEC
MOVE 1,[XWD -3,[ POINT 6,2(10),17
POINT 6,2(10),11
POINT 6,2(10),5 ]]
RHISTL: LDB 2,0(1) ;GET LOW ORDER CHARACTER FROM EXT
CAIL 2,'0'
CAILE 2,'9' ;IS IT NUMERIC?
MOVEI 2,'0'-1 ;NO, MAKE IT SO
AOJ 2, ;INCREMENT IT
DPB 2,0(1) ;STORE AWAY
CAIG 2,'9' ;IF NO CARRY,
JRST RHNXIT ;QUIT NOW
MOVEI 2,'0' ;OTHERWISE, RESET TO ZERO
DPB 2,0(1)
AOBJN 1,RHISTL ;AND CARRY TO NEXT DIGIT
SETZM CYCFLG ;UNLESS 999, IN WHICH CASE WE LOOSE
POPJ P,0
RHNXIT: SETOM CYCFLG ;ENABLE AUTOMATIC NAME SELECTION
POPJ P,0
RHIST: MOVEI @(L)
SOS
HRRM CL
MOVN @1(L)
HRLM CL
HRLI 0,@2(L) ;MAKE A COPY OF SUPPLIED SPEC
HRRI 0,HSTFSP+.FOFDV ;...
BLT 0,HSTFSP+.FOFSF+4 ;...
SKIPE CYCFLG ;ENABLED FOR AUTOMATIC NEXT FILE?
JRST INIT2 ;YES, DO NOT ASK FOR NAME, IT'S ALREADY THERE
HISTFL: PUSH P,L
MOVEI L,[EXP [ASCIZ/Histogram file: /], NULFLG, HSTDFS, HSTFSP+.FOFDV]
PUSHJ P,GETFSP
POP P,L
SKIPE NULFLG ;ANY INPUT GIVEN?
JRST NOMORE ;NO, RETURN ZERO TO STOP
INIT2: MOVEI 0,.IODMP ;SET UP OPEN BLOCK
MOVEM 0,HSTOPN+.OPMOD ;...
MOVE 0,HSTFSP+.FOFDV ;...
MOVEM 0,HSTOPN+.OPDEV ;...
MOVE 0,HSTFSP+.FOFFN ;SET UP LOOKUP BLOCK
MOVEM 0,HSTLKP+0 ;...
MOVE 0,HSTFSP+.FOFEX ;...
MOVEM 0,HSTLKP+1 ;...
MOVE 0,HSTFSP+.FOFPP ;GET PPN
SKIPE HSTFSP+.FOFSF ;ANY SFDS?
MOVEI 0,HSTPTH ;YES, GET POINTER TO PATH BLOCK
MOVEM 0,HSTLKP+3 ;STORE IN LOOKUP BLOCK
HRLI 0,HSTFSP+.FOFPP ;SET UP PATH BLOCK
HRRI 0,HSTPTH+.PTPPN ;...
BLT 0,HSTPTH+.PTSFD+4 ;...
OPEN HSTOPN ;OPEN FILE
JRST E.INT2 ;ERROR
LOOKUP HSTLKP ;LOOKUP FILE
JRST E.LOK2 ;ERROR, ASK AGAIN
MOVE 0,[2,,1] ;ASK MONITOR FOR EXACT FILE SPEC
MOVE 1,[0,,.FOFIL] ;...
MOVE 2,[11,,HSTFSP] ;...
FILOP. 0, ;...
JFCL ;...
INPUT CL
RELEAS
SETZM CYCFLG ;MUST GENERATE NEW NAME TO DO AUTO AGAIN
MOVEI 1,@2(L) ;RETURN FILE SPEC OF FILE
HRLI 0,HSTFSP+.FOFDV ;...
HRRI 0,0(1) ;...
BLT 0,10(1) ;...
POPJ P,0
E.INT2:
E.LOK2: OUTSTR [ASCIZ /?LOOKUP failed for /]
PUSH P,L
MOVEI L,[EXP HSTFSP+.FOFDV, AZNAM]
PUSHJ P,TRANFS
POP P,L
OUTSTR AZNAM
OUTSTR [ASCIZ/
/]
JRST HISTFL
NOMORE: SETZM @(L)
SETZM CYCFLG ;JUST PRECAUTION
POPJ P,0
HSTOPN: BLOCK 3
HSTLKP: BLOCK 4
HSTPTH: BLOCK 10
HSTFSP: BLOCK 15
HSTDFS: SIXBIT /DSK/
SIXBIT /SNOOPY/
SIXBIT /HST/
0
BLOCK 5
CL: .-.
0
CYCFLG: 0
ENTRY STCODE
STCODE: MOVEI 2,@(L) ;ADDRESS OF STATES ARRAY
HRLI 2,-^D32 ;LENGTH OF IT
SETZ 3,
STLOOP: MOVEI 1,.GTWSN ;GETTAB CODE FOR STATES TABLE
HRLI 1,(3) ;DESIRED TRPILET
GETTAB 1,
STRET: POPJ P,0
MOVEI 4,3 ;CODES PER TABLE WORD
STLUP2: SETZ 0,
LSHC 0,6 ;GET CHAR IN 0
ADDI 0,40 ;MAKE ASCII
DPB 0,PNT1
SETZ 0,
LSHC 0,6 ;GETSECOND OF PAIR
ADDI 0,40
DPB 0,PNT2
AOBJP 2,STRET ;QUIT AT END OF ARRAY
SOJG 4,STLUP2 ;OR GET ANOTHER PAIR
AOJA 3,STLOOP ;OR A TRIPLET
PNT1: POINT 7,(2),6
PNT2: POINT 7,(2),13
ENTRY TRANFS
; CALL TRANFS (FILESP, FILE)
;CONVERTS FILESPEC (DEV,FIL,EXT,PPN,SFDS) TO FILE STRING
TRANFS: MOVEI 10,@0(16) ;GET ADDRESS OF FILE SPEC
MOVEI 11,@1(L) ;GET ADDRESS TO STORE FILE STRING
HRL 0,11 ;CLEAR STRING STORAGE
HRRI 0,1(11) ;...
SETZM (11) ;...
BLT 0,14(11) ;...
HRLI 11,(POINT 7) ;CONVERT TO BYTE POINTER
MOVE 1,0(10) ;GET FILESPEC DEVICE
PUSHJ P,TRANSX ;OUTPUT
MOVEI 1,":" ;ADD COLON
IDPB 1,11 ;...
MOVE 1,1(10) ;GET FILESPEC FILENAME
PUSHJ P,TRANSX ;OUTPUT
MOVEI 1,"." ;ADD DOT
IDPB 1,11 ;...
HLLZ 1,2(10) ;GET FILESPEC EXTENSTION
PUSHJ P,TRANSX ;OUTPUT
SKIPN 3(10) ;EMPTY PPN?
JRST TRNFS3 ;YES, SKIP PPN
MOVEI 1,"[" ;ADD BRACKET
IDPB 1,11 ;...
HLRZ 1,3(10) ;GET PROJECT NUMBER
PUSHJ P,TRANOX ;OUTPUT
MOVEI 1,"," ;ADD COMMA
IDPB 1,11 ;...
HRRZ 1,3(10) ;GET PROGRAMMER NUMBER
PUSHJ P,TRANOX ;OUTPUT
MOVEI 6,5 ;GET MAX SFD COUNT
MOVEI 7,4(10) ;GET ADDRESS OF FIRST SFD
TRNFS1: SKIPN 0(7) ;SFD PRESENT?
JRST TRNFS2 ;NO, EXIT LOOP
MOVEI 1,"," ;ADD COMMA
IDPB 1,11 ;...
MOVE 1,0(7) ;GET SFD NAME
PUSHJ P,TRANSX ;OUTPUT
ADDI 7,1 ;INCREMENT ADDRESS
SOJG 6,TRNFS1 ;LOOP BACK FOR ALL SFDS
TRNFS2: MOVEI 1,"]" ;ADD BRACKET
IDPB 1,11 ;...
TRNFS3: POPJ P, ;AND RETURN
TRANSX: MOVEI 2,6 ;GET LOOP COUNTER
MOVE 3,[POINT 6,1] ;SET UP BYTE POINTER
TRNSX1: ILDB 4,3 ;GET NEXT BYTE
JUMPE 4,[POPJ P,] ;RETURN ON NULL
ADDI 4," "-' ' ;CONVERT TO ASCII
IDPB 4,11 ;STORE
SOJG 2,TRNSX1 ;LOOP FOR ENTIRE WORD
POPJ P, ;RETURN
TRANOX: IDIVI 1,10 ;DIVIDE
PUSH P,2 ;SAVE REMAINDER
SKIPE 1 ;MORE DIGITS?
PUSHJ P,TRANOX ;YES, RECURSE
POP P,1 ;GET BACK NEXT DIGIT
ADDI 1,"0" ;CONVERT TO ASCII
IDPB 1,11 ;STORE
POPJ P, ;AND RETURN
END