Trailing-Edge
-
PDP-10 Archives
-
BB-4157D-BM
-
sources/forque.mac
There is 1 other file named forque.mac in the archive. Click here to see a list.
TITLE FORQUE %4B.(407) SUBROUTINE TO SWAP AND MAINTAIN HIGH SEQMENTS
SUBTTL D. TODD /DRT/DMN/MD 24-OCT-1974
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;COPYRIGHT (C) 1973,1977 BY DIGITAL EQUIPMENT CORPORATION
EXTERNAL .JBSA,.JBREN
SEARCH FORPRM
SEGMEN
ENTRY FORQU%
;GETTAB INDEX VALUES
.GTSGN==14 ;HIGH SEGMENT TABLE INDEX
SN%SHR==1B1 ;SHRARABEL SEGMENT
.GTDEV==24 ;NAME OF THE DEVICE THE HIGH SEGMENT IS LOCATED ON
.GTPPN==02 ;THE DIRECTORY THE HIGH SEGMENT IS FROM
.GTPRG==03 ;NAME OF THE HIGH SEGMENT
;FLAGS
L.PHYS==1B0 ;PHYSICAL GETSEG
L.HISG==1B1 ;GET HIGH SEGMENT FROM POINTER
L.PDLN==1B2 ;DO NOT RELOCATE THE PDL
DEFINE QCODE (N),<
XCT N,QUERR
>
DEFINE GCODE (N),<
XCT N,GERR(L)
>
SALL
SUBTTL REVISION HISTORY
;310 (Q2045) REPLACE ALL HALTS WITH UNIQUE ERROR MESSAGE
;317 ----- DO NOT ISSUE SETUWP UUO IF SEGMENT IS SHARABLE
;**** BEGIN VERSION 4B
;407 (14414) FIX TO EDIT # 310
SUBTTL ERROR CODES
COMMENT /
FRSEQF Error #* trying to queue file
ERROR CODE:
WRITING OUT CURRENT HIGH SEGMENT
1 SETUWP UUO FAILED
2 GETTAB .GTSGN FAILED
3 OPEN UUO FAILED
4 ENTER UUO FAILED
5 OUT UUO FAILED
6 GETTAB .GTPPN FAILED
7 GETTAB .GTPRG FAILED
READING BACK PREVIOUS HIGH SEGMENT
10 SETUWP UUO FAILED
11 OPEN UUO FAILED
12 LOOKUP UUO FAILED
13 RENAME UUO FAILED
FRSQGE QUEUE GETSEG ERROR #*
ERROR CODE:
FROM LOW SEGMENT
1 GETSEG UUO FAILED
2 CORE UUO FAILED
3 GETSEG UUO FAILED
/
PAGE
SUBTTL SAVE THE CURRENT HIGH SEGMENT STATUS
FORQU%:: ;ENTRY TO THE QUEUE ROUTINE
PUSH P,L ;SAVE A RELOCATION POINTER
MOVEI L,1(P) ;SET UP A BLT TO SAVE THE ACS
ADD P,[XWD P4+1,P4+1] ;ALLOCATE ENOUGH ROOM
BLT L,(P) ;SAVE THE AC'S
MOVEI T0,QUESIZ ;GET THE SIZE OF THE LOW SEG
PUSHJ P,GMEM%%## ;GET THE SPACE FROM THE HEAP
MOVEI L,(T1) ;SAVE THE LOW SEG ORGIN
PUSH P,L ;SAVE THE HEAP ADDRESS
PUSH P,.JBSA ;SAVE THE STARTING ADDRESS
PUSH P,.JBREN ;SAVE THE REENTER ADDRESS
MOVEM P,QUEPDP(L) ;SAVE THE BASE OF THE PUSH DOWN POINTER
MOVSI T2,QUELOW ;GET THE LOW SEG CODE
HRRI T2,(L) ;AND THE LOW SEG ADDRESS
BLT T2,QUEEND(L) ;PUT THE CODE IN THE LOW SEG
SETZB T3,T5 ;CLEAR INCASE NO HIGH SEGMENT
HRROI T2,.GTSGN ;GET THE SEGMENT INDEX
GETTAB T2, ;
QCODE 2 ;[310] ERROR #2
JUMPLE T2,FORQU2 ;JUMP IF NO HIGH SEGMENT INDEX
TLNE T2,(SN%SHR) ;IS THE SEGMENT SHARABLE
JRST FORQU1 ;YES, SAVE THE SPECS
SETZ T2, ;[317] NO-SET THE UMP BIT TO ZERO
SETUWP T2, ;[317] CLEAR WRITE PROTECTION
QCODE 1 ;[310] + [317] ERROR #1
MOVEM T2,QUEUWP(L) ;[317] SAVE THE OLD WRITE PROTECT BIT
OPEN 0,QUEOPN(L) ;NO, MUST SAVE THE HIGH SEGMENT
QCODE 3 ;[310] ERROR #3
PJOB T2, ;GET THE JOB NUMBER
HRLM T2,QUEFIL(L) ;STORE IN THE FILE NAME FOR UNIQUE
ENTER 0,QUEFIL(L) ;ENTER THE SAVE FILE NAME
QCODE 4 ;[310] ERROR #4
MOVEI T0,^D128 ;GET A DSK BUFFER
PUSHJ P,GMEM%%## ;OUT OF THE HEAP
MOVEI G3,-1(T1) ;BUILD A DUMP IOWD FOR THE WRITE
SETZB G4,G1 ;SET THE END OF THE IOWD
HRLI G3,-^D128 ;SET THE WORD COUNT
HLRZ T5,.JBHRL## ;GET THE END OF THE HIGH SEG
HRLZM T5,400003 ;STORE IN THE HIGH SEGMENT
FORQU0: MOVSI G2,400000(G1) ;GET THE NEXT BUFFER FULL
HRRI G2,(T1) ;BLT THIS BUFFER TO THE LOW SEG
BLT G2,^D127(T1) ;MOVE THE BUFFER DOWN
OUT 0,G3 ;WRITE THE BUFFER
SKIPA ;GOOD WRITE
QCODE 5 ;[310] ERROR #5
ADDI G1,^D128 ;UPDATE THE HIGH SEG ADDRESS
CAIGE G1,(T5) ;END OF THE HIGH SEG
JRST FORQU0 ;NO,CONTINUE
CLOSE 0, ;CLOSE THE SAVE FILE
RELEAS 0, ;RELEASE THE CHANNEL
PUSHJ P,PMEM%%## ;RETURN THE BUFFER SPACE
JRST FORQU4 ;COMMON ROUTINE
FORQU1: HRLZI T3,(T2) ;GET THE HIGH SEGMENT DEVICE
HRRI T3,.GTDEV ;GET THE HIGH SEGMENT DEVICE
GETTAB T3, ;
MOVSI T3,'DSK' ;DISK IF NO TABLE
HRLZI T4,(T2) ;GET THE HIGH SEGMENT DIRECTORY
HRRI T4,.GTPPN ;
GETTAB T4, ;
QCODE 6 ;[310] ERROR #6
HRLZI T5,(T2) ;GET THE HIGH SEGMENT NAME
HRRI T5,.GTPRG ;
GETTAB T5, ;
QCODE 7 ;[310] ERROR #7
JUMPGE T4,FORQU2 ;IF .GTPRG TABLE IS ABSENT, IT IS THE PPN
CAMN T3,[SIXBIT /DSK/];IF THE PPN.LT.0 AN