Trailing-Edge
-
PDP-10 Archives
-
bb-bt99h-bb
-
dnmop.p11
There are 4 other files named dnmop.p11 in the archive. Click here to see a list.
.IF NE FT.MOP
;COPYRIGHT (C) 1978,1979,1980,1981,1984 BY DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
;
; MOP MODE FUNCTION CODE DEFINITIONS
;
M.PRMD=4. ;REQUEST MEMORY DUMP
M.PEMM=6. ;ENTER MOP MODE
M.PMMR=12. ;MOP MODE RUNNING
M.PMDP=14. ;MEMORY DUMP DATA
MOPDTY==12. ;MOP DEVICE CODE
KISAR0=172340 ;MAP REGISTER
REBOOT==173004 ;ADDRESS OF THE DECNET ROM
MOPBSZ=374 ;MAX SIZE OF DUMP DATA
MOPDMP: MOV FLBDMC+LB.SLA,R1;BOOT FROM THE FIRST DMC
MOV #MOPPDL,SP
CLR R0 ;START AT ZERO
MOV #10$,@#4 ;HAVE NXM'S COME HERE
6$: TST (R0) ;CHECK IF LOCATION EXISTS
ADD #2,R0 ;NEXT ADDRESS TO CHECK
CMP R0,#160000 ;MAXIMUM
BNE 6$ ;CONTINUE CHECKING
10$: MOV R0,MOPMSZ ;STORE MEMORY SIZE IN MMR MSG
MOPINI: MOV #MOPPDL,SP ;INIT THE STACK
JSR PC,MOPDIN ;INIT THE DMC
MOV #MOPMMR,R4 ;MOP-MODE-RUNNING MSG
MOV #MOPMML,R2 ;LENGTH OF SAME
JSR PC,MPDXMT ;SEND IT OUT
BNE MOPINI ;FAILED, START OVER
MOPRCV: MOV #MOPMSG,R4 ;RECEIVE BUFFER
MOV #7,R2 ;RECIEVE BUFFER LENGTH
MOV #1,MOPTMR ;TIME THIS OUT
JSR PC,MPDRCV ;GO RECIEVE A MSG
BNE MOPINI ;FAILED,START OVER
CMPB #7,R2 ;BETTER BE 7 BYTES
BNE MOPXIT ;NOT SO
CMPB #M.PRMD,MOPMSG ;PROGRAM DUMP REQUEST?
BNE MOPINI ;NO
MOV MOPMSG+5,R0 ;REQUESTED DUMP COUNT
MOV R0,-(SP) ; AND REMEMBER IT
MOV MOPMSG+1,R3 ;WHERE TO START DUMPING
MOV #MOPMSG+5,R2 ;WHERE TO MOVE THE DUMP DATA
20$: MOVB (R3)+,(R2)+ ;MOVE TO MSG
DEC R0 ;DECREMENT COUNT
BNE 20$ ;DO UNTIL DONE
MOV (SP)+,R2 ;COUNT FOR DMC DRIVER
ADD #5,R2 ;ACCOUNT FOR FCN AND ADDRESS
MOVB #M.PMDP,MOPMSG ;SET THE FUNCTION CODE
MOV #MOPMSG,R4 ;ADDRESS OF MESSAGE TO SEND
JSR PC,MPDXMT ;GO SEND IT
BNE MOPINI ;FAILED , RESTART
BR MOPRCV ;LOOP
MOPXIT: CMPB #M.PEMM,MOPMSG ;ENTER MOP MODE?
BNE MOPINI ;NO
JMP @#REBOOT ;TRIGGER ROM
;MOPDIN - DEVICE INITIALIZATION
;CALL R1 := CSR ADDRESS OF DMC
; JSR PC,MOPDIN
MOPDIN: CLR MOPTMR
MOPDI1: BIS #40000,(R1) ;MASTER CLEAR DMC
MOV #100000,(R1) ;TURN DMC ON
MOV #BASE,R4 ;GET BASE ADDRESS
CLR R3 ;NO HI ORDER ADDRESS BITS
MOVB #43,(R1) ;RQI + BASE
JSR PC,MOPTIN ;GIVE TO DMC
MOV #2400,R3 ;SET MOP & HALF DUPLEX
CLR R4 ;FILLER REG
MOVB #41,(R1) ;RQI + CNTLI
; PJSP MOPTIN ;DO THE CONTROL OUT AND RETURN
;MOPTIN ROUTINE TO PERFORM AN INPUT TRANSACTION TO THE DMC
;CALL R4 = CSR 4
; R3 = CSR 6
; JSR PC,MOPTIN ;RETURNS WITH RTS
MOPTIN: TSTB (R1) ;RDYI SET ?
BMI 10$ ;YES
TSTB 2(R1) ;RDYO SET ?
BPL MOPTIN ;NO
JSR PC,MPDOUT ;CHECK COMPLETION
BR MOPTIN ;AGAIN
10$: MOV R4,4(R1) ;TO FIRST HALF DMC PORT
MOV R3,6(R1) ;TO SECOND HALF DMC PORT
BIC #40,(R1) ;CLEAR RQI-GIVE TO DMC
20$: TSTB (R1) ;RDYI CLEAR ?
BMI 20$ ;NOT YET
CLZ ;FORCE AN ERROR RETURN CONDITION
RTS PC ;RETURN TO CALLER
; MPDRCV-RECEIVE A BLOCK FROM THE DEVICE
; MPDXMT-TRANSMIT A BLOCK ON THE DEVICE
;
; INPUTS:
; R1 = CSR ADDRESS
; R2 = MAXIMUM BLOCK LENGTH TO RECEIVE, OR
; BLOCK LENGTH TO TRANSMIT
; R4 = ADDRESS OF THE MESSAGE
; OUTPUTS:
; Z-BIT SET:
; R2 = ACTUAL LENGTH OF BLOCK RECEIVED
; (SP) = BUFFER ADDRESS
;
; Z-BIT CLEAR:
; AN ERROR WAS DETECTED ON THE DEVICE
; THE STACK IS AS DESRIBED ABOVE
.ENABL LSB
MPDRCV::MOVB #44,(R1) ;RQI + BA/CC + RCV
BR 10$ ;
MPDXMT::MOVB #40,(R1) ;RQI + BA/CC + XMT
10$: CLR R3 ;CLEAR FIRST TO ZERO ADDRESS HI BITS
BIS R2,R3 ;SET BUFFER SIZE
JSR PC,MOPTIN ;GIVE TO DMC
CLR R5
MOV R3,-(SP)
MOV #10.,R3 ;IN CASE WE NEED LOOP
20$: TSTB 2(R1) ;TEST RDYO SET
BMI 21$
TST MOPTMR ;NOT YET, NEED TIMER?
BEQ 20$ ;NO
DEC R5 ;YES
BNE 20$
DEC R3
BNE 20$ ;
BR MPDOT1
; CHECK COMPLETION FROM DMC-11
21$: CLR MOPTMR
MPDOT1: MOV (SP)+,R3
MPDOUT: MOV 6(R1),R2 ;GET LENGTH OR ERROR BITS
BIC #140000,R2 ;CLEAR MEMORY ENTENSION BITS
TST MOPTMR ;TIMER ERROR?
BEQ 22$ ;NO
CLR MOPTMR ;YES, CLEAR IND.
BR MOPDI1
22$: BITB #3,2(R1) ;BA/CC OR CTLO
BEQ 30$ ;IF EQ, BA/CC COMPLETION
BIT #1730,R2 ;IS IT FATAL ERROR ?
BNE MOPDI1 ;IF NE, CLEAR AND REINITIALIZE THE DEVICE
30$: CLRB 2(R1) ;CLEAR RDYO (SETS Z-BIT)
RTS PC ;RETURN
.DSABL LSB
.SBTTL DATA
MOPTMR: .WORD 0 ;TIMER INDICATOR FOR PANIC
.BYTE 0 ;ALLIGN
MOPMMR: .BYTE M.PMMR ;MOP-MODE-RUNNING CODE
.BYTE MOPDTY ;DEVICE TYPE, SHOULD BE DMC
.BYTE 1 ;MOP VERSION #
MOPMSZ: .WORD 0,0 ;MEMORY SIZE IN BYTES
.BYTE 2 ;FEATURES SUPPORTED
MOPMML=.-MOPMMR ;LENGTH OF MOP-MODE-RUNNING MESSAGE
;AREA TO READ/WRITE FROM
MOPMSG: .BLKB MOPBSZ+5 ;FUNCTION, ADDRESS & DATA
MOPPDL: .BLKW 10 ;STACK
BASE: .BLKB 200 ;DMC BASE TABLE
.ENDC; FT.MOP