Trailing-Edge
-
PDP-10 Archives
-
AP-D480B-SB_1978
-
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 AND DEV=DSK
MOVE T3,T4 ;THEN DEV WAS THE PPN
SETZ T4, ;SHIFT IT
;SAVE THE HIGH SEGMENT INFORMATION IS THE SAVE AREA
FORQU2:
MOVEM T3,QUEDEV(L) ;SAVE THE DEVICE
MOVEM T4,QUEPPN(L) ;SAVE THE DIRECTORY
MOVEM T5,QUEFIL(L) ;SAVE THE FILENAME
SETZM QUEEXT(L) ;CLEAR THE EXT FOR A SHR FILE
;HERE TO DO THE GET SEG
FORQU4:
MOVE T1,-<P4+T1+1>(P);RELOAD THE ARGUEMNT
MOVEI T2,T3 ;GET THE SEGMENT POINTER
MOVSI T3,'SYS' ;GET FROM DEVICE SYS
TLNE T1,(L.HISG) ;IS THERE A SEGMENT NAME
SKIPA T4,(T1) ;YES, GET IT
MOVE T4,[SIXBIT /QMANGR/];USE THE QUEUE MANGER
SETZB T5,G1 ;CLEAR THE REST OF THE AREA
SETZB G2,G3 ;
;HERE TO SWITCH THE STARTING ADDRESS
HRRM L,FAKREL(L) ;SAVE THE RELOCATION ADDRESS
MOVEI P2,FAKSA(L) ;FAKE STARTING ADDRESS
HRRM P2,.JBSA
MOVEI P2,FAKREN(L) ;FAKE REENTER ADDRESS
HRRZ P3,.JBREN ;IS THERE AN ADDRESS
JUMPE P3,(L) ;NO, DON'T STORE ONE
HRRM P2,.JBREN ;YES, STORE ONE
JRST (L) ;GO TO THE LOW SEG CODE
;RETURN FROM LOW SEGMENT
FORQU5: JRST 1,.+1 ;[310] MAY BE KI-10 CONCEALED MODE
POP P,.JBREN ;RESTORE THE REENTER ADDRESS
POP P,.JBSA ;RESTORE THE STARTING ADDRESS
SKIPN QUEEXT(L) ;WAS HTIS A SHR FILE
JRST FORQU6 ;YES,...
MOVE T2,QUEUWP(L) ;[317] GET THE WRITE PROTECT BIT
SETUWP T2, ;[317] SET IT
QCODE 10 ;[310] + [317] ERROR #10
OPEN 0,QUEOPN(L) ;REOPEN THE TEMP FILE
QCODE 11 ;[310] ERROR #11
LOOKUP 0,QUEFIL(L) ;GET THE FILE BACK
QCODE 12 ;[310] ERROR #12
SETZM QUEFIL(L) ;CLEAR THE FILE NAME
RENAME 0,QUEFIL(L) ;DELETE THE FILE
QCODE 13 ;[310] ERROR 13
RELEASE 0, ;RELEASE THE CHANNEL
FORQU6:
POP P,T1 ;GET THE HEAP ADDRESS
MOVE P4,(P) ;GET THE LOW SEG BASE POINTER
PUSHJ P,PMEM%%## ;PUT THE MEM BACK
MOVSI L,-P4(P) ;RESTORE THE ACS
BLT L,P4 ;
SUB P,[XWD P4+1,P4+1];REMOVE THE AC SAVE FROM THE STACK
POP P,L ;RESTORE THE LINK
POPJ P, ;RETURN
;ERROR CONDITION FOUND
QUERR: JSP P1,.+1 ;[310] SAVE CALLER PC
OUTSTR [ASCIZ /?FRSEQF Error #/] ;[310]
LDB P1,[POINT 4,-1(P1),12] ;[310] GET ACC FIELD
IDIVI P1,8 ;[310] SEPARATE TWO POSSIBLE DIGITS
JUMPE P1,.+3 ;[310] NO EIGHTS
ADDI P1,"0" ;[310]
OUTCHR P1 ;[310] OUTPUT
ADDI P2,"0" ;[310]
OUTCHR P2 ;[310]
OUTSTR [ASCIZ / trying to queue file/] ;[310]
EXIT ;[310]
HALT
SUBTTL LOW SEGMENT CODE FOR FORQUE
QUELOW: ;THE FOLLOWING CODE IS EXECUTED IN THE LOW SEGMENT
PHASE 0
SRTLOW: MOVSI P4,1 ;SET UP TO KILL THE HIGH SEGMENT
CORE P4, ;REMOVE THE HIGH SEGMENT
JFCL ;ERROR DON'T CARE
HRRM L,QUELO1(L) ;SAVE THE RELOCATION REGISTER
HRRM L,GERR1(L) ;[310] INCASE OF ERROR
ADDM L,.+2(L) ;[310] FIXUP ERROR RETURN SINCE L GETS DESTROYED
GETSEG T2, ;GET THE NEW HIGH SEGMENT
JRST GERR1+.-. ;[310] ERROR #1, NO HIGH SEGMENT
QUELO1:!MOVEI L,.-. ;RESTORE L
HRRM L,QUELO2(L) ;SAVE THE RELOCATION
MOVE P,QUEPDP(L) ;RESTORE THE STACK POINTER
MOVE T1,-<P4+T1+1>(P);RELOAD THE QMANGR ARG POINTER
PUSHJ P,400010 ;GO TO THE HIGH SEGMENT
QUELO2:!MOVEI L,.-. ;RESTORE THE LINK
QUELO3:!MOVE P,QUEPDP(L) ;RELOAD THE STACK POINTER
MOVE T4,QUEFIL(L) ;RESTORE THE FILE NAME
MOVE G2,QUEPPN(L) ;RESTORE THE PPN
MOVE T3,QUEDEV(L) ;RSTORE THE DEVICE
SETZB T5,G1 ;CLEAR THE REST
SETZ G3, ;
MOVSI P4,1 ;SET UP TO REMOVE THE HIGH SEG
CORE P4, ;REMOVE IT
GCODE 2 ;[310] ERROR #2
JUMPE T3,FORQU5 ;CHECK FOR THE DEVICE
QUELO4:!
MOVEI T2,T3 ;GET THE GETSEG POINTER
HRRM L,QUELO5(L) ;STORE THE RELOCATION
HRRM L,GERR3(L) ;[310] IN CASE OF ERROR
ADDM L,.+2(L) ;[310] SINCE L GETS DESTROYED
GETSEG T2, ;GET THE OLD HIGH SEGMENT
;**;[407],QUELO4+5,MD,10/24/74
JRST GERR3+.-. ;[407] [310] ERROR # 3
QUELO5:!MOVEI L,.-. ;RESTORE THE RELOCATION
MOVE P,QUEPDP(L) ;RESTORE THE PUSH DOWN LIST
JRST FORQU5 ;RETURN
FAKREN:!MOVEI T2,-1 ;SET THE REENTER FLAG
SKIPA ;SKIP
FAKSA:! SETO T2, ;SET THE START FLAG
FAKREL:!MOVEI L,.-. ;GET THE RELOCATION
MOVEM T2,QUEFLG(L) ;SET THE ALT ADDRESS FLAG
JRST QUELO3(L) ;GET THE ORIGIONAL HIGH SEGMENT
;ERROR CONDITION FOUND
GERR:! JSP P1,.+1(L) ;SAVE CALLER PC
OUTSTR QGEMES(L)
LDB P1,GERPT(L) ;LOAD ACC FIELD
IDIVI P1,8 ;SEPARATE TWO POSSIBLE DIGITS
JUMPE P1,.+3(L) ;NO EIGHTS
ADDI P1,"0"
OUTCHR P1 ;OUTPUT
ADDI P2,"0"
OUTCHR P2
EXIT
GERR1:! MOVEI L,.-. ;RESTORE L
GCODE 1 ;ERROR #1, NO HIGH SEGMENT
GERR3:! MOVEI L,.-. ;RESTORE L
GCODE 3 ;ERROR #3
GERPT:! POINT 4,-1(P1),12 ;GET ACC FIELD
QGEMES:!ASCIZ /?FRSQGE Queue getseg error #/
QUEOPN:!OCT 17 ;DUMP MODE FOR HIGH SEG WRITE
QUEDEV:!SIXBIT /DSK/ ;DSK IF WRITTING
0
QUEFIL:!SIXBIT /000DRT/ ;TEMP FILE NAME FOR SAVED SEGMENT
QUEEXT:!SIXBIT /HGH/ ;TEMP EXTENSION
OCT 111000000000 ;PROTECTION CODE SO THE FILE CAN BE DELETED
QUEPPN:!XWD 3,3 ;BORROW THE QUE AREA NO QUOTA CONFLICTS
QUEEND==.-1
QUEALC==0 ;FIND THE ALOCATED STORAGE AREA
QUEFLG==.+QUEALC
QUEALC==QUEALC+1
QUEUWP==.+QUEALC ;SAVE THE HIGH SEGMENT WRITE PROTECT BIT
QUEALC==QUEALC+1
QUEPDP==.+QUEALC ;SAVE THE BASE OF THE PUSH DOWN LIST
QUEALC==QUEALC+1
QUESIZ==.+QUEALC
DEPHASE
END