Trailing-Edge
-
PDP-10 Archives
-
BB-Y393N-SM
-
monitor-sources/postld.mac
There are 51 other files named postld.mac in the archive. Click here to see a list.
;Edit 2971 to POSTLD.MAC by MOSER on Mon 13-Jun-83 - MORE OF 2970
;EDIT 2971 - MORE OF 2970
;Edit 2970 to POSTLD.MAC by MOSER on Thu 9-Jun-83 - CHANGE OVERFLOW MESSAGE
;EDIT 2970 - CHANGE OVERFLOW MESSAGE
;<4-1-FIELD-IMAGE.MONITOR>POSTLD.MAC.2, 25-Feb-82 20:45:49, EDIT BY DONAHUE
;UPDATE COPYRIGHT DATE
; UPD ID= 719, FARK:<4-WORKING-SOURCES.MONITOR>POSTLD.MAC.3, 19-Aug-81 10:28:59 by ZIMA
;Edit 1925 - put edit 1827 in standard form. No code changes.
; UPD ID= 373, FARK:<4-WORKING-SOURCES.MONITOR>POSTLD.MAC.2, 20-Jan-81 09:28:08 by DONAHUE
;Edit 1827 - Add label BUGD
;<4.MONITOR>POSTLD.MAC.16, 3-Jan-80 08:10:20, EDIT BY R.ACE
;UPDATE COPYRIGHT DATE
;<4.MONITOR>POSTLD.MAC.15, 30-Oct-79 11:37:18, EDIT BY MILLER
;<4.MONITOR>POSTLD.MAC.14, 30-Oct-79 10:31:48, EDIT BY MILLER
;GET SYS TIME AND DATE FROM FDB OF VERSIO.MAC
;<4.MONITOR>POSTLD.MAC.13, 20-Aug-79 02:45:20, EDIT BY GILBERT
;Re-implement BUGSTF and HIDSYM conditionals after edit 12.
;<4.MONITOR>POSTLD.MAC.12, 17-Aug-79 03:40:47, EDIT BY GILBERT
;TCO 4.2408: MAKE TYPEOUT FORMAT EASIER TO READ, ADD VARIOUS CHECKS TO
;SEE IF THE MONITOR WILL RUN, DISPLAY ALL PSECTS INCLUDING POSTCD.
;<4.MONITOR>POSTLD.MAC.11, 15-Jun-79 01:38:41, EDIT BY GILBERT
;REMOVE CODE TO GET AROUND MACRO BUG WHICH IS NOW FIXED.
;<4.MONITOR>POSTLD.MAC.10, 9-Apr-79 14:29:33, EDIT BY DBELL
;TCO 4.2227 - FIX SSEG MACRO WHICH SOMETIMES FAILED TO SAVE A PAGE.
;<4.MONITOR>POSTLD.MAC.9, 6-Mar-79 09:43:00, EDIT BY KONEN
;UPDATE COPYRIGHT FOR RELEASE 4
;<4.MONITOR>POSTLD.MAC.8, 18-Jan-79 13:35:19, EDIT BY GILBERT
;REALLY FIX BUG IF SYMBOL TABLE STARTS ON SAME PAGE THAT INCOD ENDS.
;<4.MONITOR>POSTLD.MAC.6, 15-Jan-79 07:46:33, EDIT BY GILBERT
;More TCO 4.1255:
; Re-arrange the PSECTs.
; Fix bug if symbol table starts in same page that INCOD ends.
;<4.MONITOR>POSTLD.MAC.5, 8-Jan-79 06:56:36, EDIT BY GILBERT
;TCO 4.2155 - Implement hidden symbol tables:
; Make PSECT end names uniform.
; Remove all symbol table processing code.
; Clean up PSECT overlap typeout and teach about new PSECT order.
;<4.MONITOR>POSTLD.MAC.4, 22-Jun-78 16:25:36, EDIT BY MILLER
;ADD AN "XPUNGE"
;<1BOSACK>POSTLD.MAC.1001, 15-Jun-78 15:36:36, EDIT BY BOSACK
;<1BOSACK>POSTLD.MAC.1000, 1-Jun-78 21:06:27, EDIT BY BOSACK
;CHANGES FOR MORE PSECTS
;<4.MONITOR>POSTLD.MAC.2, 14-Jun-78 06:41:41, Edit by JBORCHEK
;ADD BUGSTF FLAG TO PUT BUGSTRINGS IN MONITOR VAS
;<3A.MONITOR>POSTLD.MAC.7, 7-Mar-78 18:54:08, EDIT BY BOSACK
;<3A.MONITOR>POSTLD.MAC.6, 7-Mar-78 18:34:40, EDIT BY BOSACK
;<3A.MONITOR>POSTLD.MAC.5, 7-Mar-78 18:33:50, EDIT BY BOSACK
;OUTPUT TYPE OF BUGXXX IN BUGXXX LISTING
;<3A.MONITOR>POSTLD.MAC.4, 23-Jan-78 20:56:36, EDIT BY BOSACK
;<3A.MONITOR>POSTLD.MAC.3, 23-Jan-78 20:36:30, EDIT BY BOSACK
;MOVE BUGSTRINGS/POINTERS TO OVERLAP SWP PAGE VARS
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976,1977,1978,1979,1980,1981,1982 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
SEARCH PROLOG
TTITLE(POSTLD,, - POST-LOADING ONE-SHOT INIT)
EXT <NBUGP> ;NUMBER OF BUGPOINTERS
NPDL==100 ;SIZE OF LOCAL PDL
DEFINE TSTR ($MSG)<
HRROI A,[ASCIZ \$MSG\]
PSOUT>
DEFINE JSERR <
JSP 2,JSEX0>
;GET FINAL VALUE OF LOAD PC'S
DEFINE PEND(PSECT),<
IRP PSECT,<
.PSECT PSECT
PSECT'Z=:.-1
PSECT'L==:PSECT'Z_-PGSFT
.ENDPS PSECT
>
>
PEND <RSCOD,INCOD,PPVAR,RSVAR,SYVAR,PSVAR>
PEND <JSVAR,NPVAR,NRCOD,BGSTR,BGPTR,NRVAR>
;LOAD POSTLD WHERE IT WILL GET OVERLAYED BY RUNTIME STORAGE
.ENDPS RSCOD
.PSECT POSTCD
;START HERE AT COMPLETION OF LOADING
SYSG0: MOVE P,[IOWD NPDL,PDL]
SETZM T3 ;ASSUME MON: IS KNOWN
HRROI T1,[ASCIZ /MON/]
STDEV ;SEE IF MON: IS DEFINED
ADDI T3,1 ;NOT
MOVX T1,GJ%OLD!GJ%SHT ;GET THE SOURCE FILE
HRRO T2,[[ASCIZ /MON:VERSIO.MAC/]
[ASCIZ /VERSIO.MAC/]](T3)
GTJFN ;GET HANDLE
ERJMP [HRROI T1,[ASCIZ /
%VERSIO.MAC not found. Current time and date used
/]
PSOUT
GTAD ;GET TIME AND DATE
JRST SYSG00] ;AND PROCEED
MOVEI T2,T2 ;WHERE TO PUT DATE AND TIME WORD
MOVEI T3,1 ;ONE WORD IS ALL WE NEED
RFTAD ;GET TIME AND DATE WORD
RLJFN ;RELEASE JFN OF FILE
NOP
MOVE T1,T2 ;STASH WORD IN T1
SYSG00: MOVEM T1,SYSTAD ;REMEMBER IT IN SWPMON
HLRE T1,.JBSYM ;GET LENGTH OF SYMBOL TABLE
MOVN T1,T1 ;MAKE POSITIVE
MOVEI T2,SYVARZ ;FIRST WORD OF RUNTIME TABLE (-1)
ADD T2,T1 ;LAST WORD
MOVEM T2,RSTLU ;SAVE FOR PRINTOUT
ADD T1,.JBSYM ;ADD IN BEGINNING OF TABLE
SUBI T1,1 ;CONVERT FIRST FREE TO LAST USED
HRRZM T1,SYMLU ;REMEMBER IT
SKIPL T1,.JBUSY ;FIRST USED IF UNDEFINED SYMBOLS
HRRZ T1,.JBSYM ;GET FIRST USED
HRRZM T1,SYMFU ;REMEMBER IT TOO
SETZM FPAGES ;NO FREE PAGES YET
HRROI 1,[ASCIZ /
Monitor address space:
Psect Start End Length Free Limit
/]
PSOUT
;DEFINE LOCAL MACRO FOR SPACE PRINTOUTS
DEFINE PRPSC($PSECT,$NEXT,$BEGA,$ENDA,$NEXTA,$LIMIT)<
XLIST
HRROI T1,[ASCIZ \
$PSECT\]
PSOUT%
..N==0
IRPC <$PSECT>,<..N==..N+1>
MOVEI T1," "
REPEAT <^D16-..N>,<PBOUT%>
IFNB <$BEGA>,<MOVE P1,$BEGA>
IFB <$BEGA>,<MOVEI P1,$PSECT>
MOVE T2,P1
CALL OCTOUC
IFNB <$ENDA>,<MOVE T2,$ENDA>
IFB <$ENDA>,<MOVEI T2,$PSECT'Z>
CALL OCTOUC
SUBM T2,P1
EXCH T2,P1
ADDI T2,1
CALL OCTOUC
IFNB <$NEXTA>,<MOVE T2,$NEXTA>
IFB <$NEXTA>,<MOVEI T2,$NEXT>
SUB T2,P1
SUBI T2,1
CALL OCTOUC
HRROI T1,[ASCIZ \ \]
PSOUT%
IFNB <$LIMIT>,<HRROI T1,[ASCIZ \$LIMIT\]
PSOUT%>
;**;[2971] CHANGE 1 LINE AT DEFINE PRPSC+29L TAM 9-JUN-83
;**;[2970] CHANGE 1 LINE AT DEFINE PRPSC+29L TAM 9-JUN-83
HRROI T1,[ASCIZ \
? PSECT Overflow\] ;[2970][2971]
SKIPGE T2
PSOUT%
ASH T2,-9
ADDM T2,FPAGES
LIST
>
;THIS CODE NEEDS SOME WORK (FREE PAGE ACCOUNTING, CASES WHERE THE UPPER
;BOUND OF A PSECT COULD BE EITHER OF TWO OTHER OVERLAPPING PSECTS) IF
;BUGSTF=0.
PRPSC (RSCOD,INCOD)
PRPSC (INCOD,PPVAR)
PRPSC (PPVAR,RSVAR)
PRPSC (RSVAR,SYVAR)
SKIPN HIDSYF ;HIDING SYMBOLS?
JRST PRPSC1 ;NO, DIFFERENT MESSAGE
PRPSC (SYVAR,PSVAR)
JRST PRPSC2 ;RE-JOIN MAIN FLOW
PRPSC1: PRPSC (SYVAR,<Loaded symbols>,,,SYMFU)
PRPSC (<Loaded symbols>,PSVAR,SYMFU,SYMLU)
PRPSC2: PRPSC (PSVAR,JSVAR)
PRPSC (JSVAR,NRVAR)
PRPSC (NRVAR,NRCOD)
SKIPN BUGTP ;BUGSTRINGS IN MONITOR VAS?
JRST PRPSC3 ;NO, DIFFERENT MESSAGE
PRPSC (NRCOD,BGSTR)
PRPSC (BGSTR,BGPTR)
PRPSC (BGPTR,POSTCD)
JRST PRPSC4 ;RE-JOIN MAIN FLOW
PRPSC3: PRPSC (NRCOD,POSTCD)
PRPSC4: PRPSC (POSTCD,NPVAR,,[PSTEND])
PRPSC (NPVAR,<Section 0 end>,,,[1000000],777777)
TSTR <
>
PUSH P,FPAGES
SKIPN HIDSYF ;NEED MORE INFO?
JRST PRPSC5 ;NO, SKIP THIS
PRPSC (<Loaded symbols >,,SYMFU,SYMLU,[NRCOD],NRCOD)
PRPSC (<Runtime symbols>,,[SYVARZ+1],RSTLU,[NPVAR],NPVAR)
TSTR <
The symbols will be moved to their runtime area right after
the SYVAR psect by STG early in the monitor's initialization.
>
; ..
PRPSC5: SKIPE BUGTP ;NEED MORE INFO?
JRST PRPSC6 ;NO, DONE
PRPSC (BGSTR,BGPTR)
PRPSC (BGPTR,POSTCD,,,,POSTCD)
TSTR <
>
PRPSC6: POP P,FPAGES
TSTR <
There are >
MOVE T2,FPAGES
CALL OCTOUT
TSTR < (octal) free pages, not counting symbols.
>
HRROI T1,[
ASCIZ \% Runtime symbols must end by 360000 in order to run on a 128K system.
\]
MOVEI T2,360000-1 ;IN ORDER TO LEAVE 20P FOR BOOT
SUB T2,RSTLU
SKIPGE T2
PSOUT%
HRROI T1,[
ASCIZ \% End of resident free pool (RESFRZ) overlaps BOOT area at 760000.
\]
MOVEI T2,RESFRZ ;LAST 20P OF VAS RESERVED FOR BOOT
CAIL T2,760000 ;RESFRP SHOULD REALLY BE IN ITS OWN PSECT
PSOUT%
;SET ENTRY VECTOR AND START ADDRESS
MOVEI 1,.FHSLF
MOVE 2,[JRST EVGO] ;MAIN START LOCATION
HRRM 2,.JBSA
SEVEC
; ..
;DUMP BUG STRINGS TO FILE, SETUP BUGTABLE IN SWPMON
BUGSR3: MOVX T1,GJ%FOU+GJ%SHT
HRROI 2,[ASCIZ /BUGSTRINGS.TXT/]
GTJFN
JSERR
PUSH P,T1 ;SAVE JFN
MOVE T2,T1 ;JFN IN T2
TSTR <Writing sorted bug list to file >
MOVEI T1,.PRIOU ;TO TERMINAL
POP P,T2 ;FILE DESCRIBED BY THIS JFN
SETZ T3, ;USUAL TEXT
JFNS ;TYPE THE FILESPEC
MOVE T1,T2 ;JFN TO T1 FOR OPENF
MOVE 2,[7B5+1B20]
OPENF
JSERR
SETZ 3,
HRROI 2,TSVN ;SYSTEM VERSION TEXT
SOUT
HRROI 2,[ASCIZ /
BUGHLT and BUGCHK names and descriptions
/]
SOUT
;SORT THE BUG TABLE BY SIXBIT NAME
MOVSI 7,-NBUGP
JUMPE 7,BUGEND ;NO BUGPOINTERS LOADED?
BUGSR4: MOVSI 5,-NBUGP(7) ;SCAN FROM HERE TO END
HRRI 5,0(7)
HRLOI 3,377777 ;INITIAL MINIMUM
BUGSR1: HLRZ 6,BGPTR(5) ;BUG ADDRESS
JUMPE 6,BUGSR2 ;IGNORE ZEROS
BUGSR5: MOVE 2,1(6) ;GET NEXT WORD FROM BLOCK
TLNN 2,770000 ;FOUND THE SIXBIT NAME?
AOJA 6,BUGSR5 ;NO, LOOP BACK UNTIL FOUND
TXC 2,1B0 ;SO COMPARE WORKS ON SIXBIT NAME
CAML 2,3 ;MIN SO FAR?
JRST BUGSR2 ;NO
MOVE 3,2 ;YES, REMEMBER THIS VALUE
MOVEI 4,0(5) ;AND LOCATION
BUGSR2: AOBJN 5,BUGSR1
CAMN 3,[377777,,777777] ;FOUND A MIN?
;**;[1925] Change 1827 lines at BUGSR2: +2L JGZ 19-AUG-81
;**;[1827] Change 1 line at BUGSR2:+2L PED 20-JAN-81
JRST BUGD ;[1827] NO, NOTHING BUT ZEROS LEFT
MOVE 6,BGPTR(4) ;INTERCHANGE MIN WITH TOP OF TABLE
EXCH 6,BGPTR(7)
MOVEM 6,BGPTR(4)
AOBJN 7,BUGSR4 ;(ALWAYS JUMP)
;PRINT STRINGS TO BUGSTRINGS.TXT
;**;[1925] Change 1827 lines at BUGD1: -1L JGZ 19-AUG-81
;**;[1827] Add label at BUGD1:-1L PED 20-JAN-81
BUGD: MOVSI 7,-NBUGP ;[1827] LOOP OVER ALL OF THE MESSAGES
BUGD1: MOVE 6,BGPTR(7) ;TABLE ENTRY
HLRZ 2,6 ;ADDRESS
BUGD2: MOVE 3,1(2) ;GET NEXT WORD FROM BLOCK
TLNN 3,770000 ;FOUND THE SIXBIT NAME YET?
AOJA 2,BUGD2 ;NO, LOOP UNTIL IT IS FOUND
BUGD4: SETZ 2, ;NOW TYPE OUT NAME
LSHC 2,6 ;GET NEXT CHARACTER
ADDI 2," " ;MAKE IT ASCII
BOUT ;OUTPUT IT
JUMPN 3,BUGD4 ;LOOP UNTIL NAME IS FINISHED
HLRZ 3,6 ;GET ADDRESS
HRRZ 3,(3) ;GET BUGXXX ADDRESS
HRROI 2,[ASCIZ / [UNK] /]
CAIN 3,BUGHLT ;BUGHLT?
HRROI 2,[ASCIZ / [HLT] /]
CAIN 3,BUGCHK ;BUGCHK
HRROI 2,[ASCIZ / [CHK] /]
CAIN 3,BUGINF ;BUGINF?
HRROI 2,[ASCIZ / [INF] /]
MOVEI 3,0
SOUT ;OUTPUT DESCRIPTION
HRROI 2,0(6)
SETZ 3,
SOUT ;PRINT THE STRING
HRROI 2,[ASCIZ /
/]
SOUT
AOBJN 7,BUGD1
CLOSF ;CLOSE BUGSTRINGS.TXT
JFCL
;CREATE THE EXE FILE CONTAINING THE MONITOR
BUGEND: MOVX A,GJ%FOU+GJ%SHT ;GET NEXT VERSION OF MONITOR FILE
HRROI B,MONSNM ;GET NAME TO SAVE AS
GTJFN
JSERR
PUSH P,A
TSTR <
Saving monitor as >
MOVEI A,101
HRRZ B,0(P)
SETZ C,
JFNS
MOVE A,SYMFU ;BEGINNING OF SYMBOL TABLE
MOVEI B,INCODZ ;END OF INIT CODE
IORI B,777 ;END OF THAT PAGE
CAMLE A,B ;SYMS ON SAME PAGE AS INCOD?
JRST BUGEN2 ;NO, PROCEED
AOS A,B ;YES, START AT FIRST PAGE AFTER INIT CODE
MOVEM A,SYMFU ;STORE FOR SSEG MACRO BELOW
BUGEN2: POP P,A
HRLI A,.FHSLF ;CONSTRUCT FORKH,,JFN FOR SSAVE
MOVEI B,1(P) ;BUILD SSAVE LIST ON STACK
DEFINE SSEG($START,$END)<
XLIST
..NSG==..NSG+1
HRRZ C,$END ;;GET LAST ADDRESS OF A REGION
HRRZ D,$START ;;AND THE FIRST ADDRESS OF THE REGION
LSH C,-PGSFT ;;GET ENDING PAGE NUMBER
LSH D,-PGSFT ;;AND BEGINNING PAGE NUMBER
SUB C,D ;;SEE HOW MANY PAGES BETWEEN THEM
MOVNI C,1(C) ;;GET NEGATIVE OF NUMBER OF PAGES IN REGION
HRL D,C ;;PUT COUNT IN LEFT HALF
TRO D,1B18!1B20!1B22 ;;SET FLAGS
PUSH P,D ;;STORE THE WORD
LIST
>
;USE THE ABOVE MACRO TO GENERATE AN ARGUMENT LIST ON THE STACK
..NSG==0
SSEG([EXP 0],[EXP RSCODZ])
SSEG([EXP INCOD],[EXP INCODZ])
SSEG(SYMFU,SYMLU)
SKIPE BUGTP ;WANT THE BUGSTRINGS?
JRST SAVBUG ;YES, GO SAVE THEM
SSEG([EXP NRCOD],[EXP NRCODZ])
JRST SAVEND ;DONE
SAVBUG: SSEG([EXP NRCOD],[EXP BGPTRZ])
SAVEND: PUSH P,[0] ;TERMINATE LIST WITH 0
SETZ C,
SSAVE
SUB P,[XWD ..NSG+1,..NSG+1] ;FLUSH ARG LIST FROM STACK
TSTR <
> ;NOTE SUCCESSFUL COMPLETION
;ALL USEFUL STUFF HAS BEEN WRITTEN, FLUSH THIS ADR SPACE
SETO T1,
MOVE T2,[.FHSLF,,1] ;FLUSH PAGES 1-777
MOVE T3,[1B0+777]
MOVE 16,[CLRPRG,,5] ;THIS CODE WILL VANISH IN THE CLEARING,
BLT 16,16 ;SO PUT THE CLEAR LOOP IN THE AC'S
JRST 5
CLRPRG: PHASE 5
PMAP
HALTF
JRST .-1
DEPHASE
;JSYS ERROR
JSEX0: HRROI 1,[ASCIZ /
?JSYS ERROR: /]
PSOUT
MOVEI 1,101 ;PRINT ERROR STRING ON PRIMARY OUTPUT,
HRLOI 2,400000 ; THIS FORK ,, LAST ERROR
SETZ 3,
ERSTR
JFCL
JFCL
HRROI 1,[ASCIZ /
/]
PSOUT
HALTF
OCTOUT: SKIPA T3,[FLD(8,NO%RDX)] ;FREE FORMAT
OCTOUC: MOVX 3,NO%LFL+FLD(8,NO%COL)+FLD(8,NO%RDX) ;8 COLUMNS
MOVEI T1,.PRIOU ;PRIMARY OUTPUT
NOUT
JSERR
RET
SYMFU: BLOCK 1 ;FIRST WORD OF SYMBOL TABLE
SYMLU: BLOCK 1 ;LAST WORD OF SYMBOL TABLE
RSTLU: BLOCK 1 ;LAST WORD OF RUNTIME SYMBOL TABLE
FPAGES: BLOCK 1 ;FREE PAGE COUNT
PDL: BLOCK NPDL
TNXEND
PSTEND: END SYSG0