;<* ZCL XX-V01.03 30-July-1985 *> analyZe Character Length utility library .SBTTL ZCLLIB .IDENT /V01.03/ .ENABLE LC ; allow low case characters in messages ; ;+ ; Allen Jay Bennett ; ; written : July 26, 1985 ; revised : July 29, 1985 AJB V01.01 uses SWSTK$ ; revised : July 30, 1985 AJB V01.02 load /64. in KDSAR6 ; revised : July 30, 1985 AJB V01.03 (has /AD & /OF) ;- ; ; .PAGE ; .SBTTL EDMQIO ;+ ; ; EDMQIO -- issue a QIO to display a message on TI0: ; ; input: ; ARGBLK -- arg. block for $EDMSG already set-up ; R1 -- message address ; ;- .MCALL QIOW$S ; queue I/O request & wait (stacked) IOSB:: .WORD 0,0 ; I/O Status Block EDMQIO:: ; display routine JSR R2,$SAVVR ; ;;; INC R1 ; skip line-count-byte MOV #ARGBLK,R2 ; arg. block address MOV #MESBUF,R0 ; message buffer address CALL $EDMSG ; edit message into mess.buff. QIOW$S #IO.WLB,#1,#1,,#IOSB,,<#MESBUF,R1,#40> ; LUN is #1 ; 10$: RETURN ; leave ; ; ; .PAGE ; .SBTTL POKEIT ;+ ; ; POKEIT -- changes the literal in the terminal driver ; associated with the number of bit ; for a character in the LPR of the DHV11 ; ; input: ; BLKVAL -- block value for second word already set-up ; ZTTPAR -- the base address of the TTDRV partition /64. ; ZCHROF -- the offset value in SETLIN at 70$: BIS #,R2 ; ;- .MCALL SWSTK$ ; The switch stack routine to become the EXEC ; POKEIT:: ; Poke It routine NOP ; no-op to use as a break point if you need to 1$: SWSTK$ 3$ ; Switch to system stack MTPS #PR7 ;;; Lock out interrupts .IF DF R$$MPL ;RSX11M+ ;;; KDSAR6 is known MOV KDSAR6,-(SP) ;;; Save old kernel APR 6 .IFF ;RSX11M ;;; KDSAR6 is unknown MOV KISAR6,-(SP) ;;; Save old kernel APR 6 .ENDC MOV ZTTPAR,R0 ;;; Get the TTDRV address /64. pointer .IF DF R$$MPL ;RSX11M+ ;;; KDSAR6 is known MOV R0,KDSAR6 ;;; Map to new address in data space .IFF ;RSX11M ;;; KDSAR6 is unknown MOV R0,KISAR6 ;;; Map to new address in data space .ENDC MOV #140000,R1 ;;; Start of APR 6 ADD ZCHROF,R1 ;;; add in the offset to the char.len. literal 2$: MOV BLKVAL+2,(R1) ;;; Copy to the char.len. literal .IF DF R$$MPL ;RSX11M+ ;;; KDSAR6 is known MOV (SP)+,KDSAR6 ;;; Restore old APR 6 mapping .IFF ;RSX11M ;;; KDSAR6 is unknown MOV (SP)+,KISAR6 ;;; Restore old APR 6 mapping .ENDC MTPS #0 ;;; Lower priority RETURN ;;; From system stack 3$: ; 10$: RETURN ; leave ; ; ; .PAGE ; .SBTTL PEEKIT ;+ ; ; PEEKIT -- displays the literal in the terminal driver ; associated with the number of bit ; for a character in the LPR of the DHV11 ; ; input: ; ; ZTTPAR -- the base address of the TTDRV partition /64. ; ZCHROF -- the offset value in SETLIN at 70$: BIS #,R2 ; ;- .MCALL SWSTK$ ; The switch stack routine to become the EXEC ; PEEKIT:: ; Peek It routine NOP ; no-op to use as a break point if you need to 1$: SWSTK$ 3$ ; Switch to system stack MTPS #PR7 ;;; Lock out interrupts .IF DF R$$MPL ;RSX11M+ ;;; KDSAR6 is known MOV KDSAR6,-(SP) ;;; Save old kernel APR 6 .IFF ;RSX11M ;;; KDSAR6 is unknown MOV KISAR6,-(SP) ;;; Save old kernel APR 6 .ENDC MOV ZTTPAR,R0 ;;; Get the TTDRV address /64. pointer .IF DF R$$MPL ;RSX11M+ ;;; KDSAR6 is known MOV R0,KDSAR6 ;;; Map to new address in data space .IFF ;RSX11M ;;; KDSAR6 is unknown MOV R0,KISAR6 ;;; Map to new address in data space .ENDC MOV #140000,R1 ;;; Start of APR 6 MOV #SAVCOD,R2 ;;; Address of the save area ADD ZCHROF,R1 ;;; add in the offset to the char.len. literal ;;;;;; INC R1 ;;; OM... plus 2 MOV #16,R3 ;;; Current display length 2$: MOVB (R1)+,(R2)+ ;;; Copy to the save area SOB R3,2$ ;;; till display length filled .IF DF R$$MPL ;RSX11M+ ;;; KDSAR6 is known MOV (SP)+,KDSAR6 ;;; Restore old APR 6 mapping .IFF ;RSX11M ;;; KDSAR6 is unknown MOV (SP)+,KISAR6 ;;; Restore old APR 6 mapping .ENDC MTPS #0 ;;; Lower priority RETURN ;;; From system stack 3$: MOV SAVCOD,BLKVAL+2 ; copy the literal word to the alias MOV #SAVCOD,R2 ; set the address of save code MOV #M$DUMP,R1 ; dump message MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display MOV (R2)+,ARGBLK ; load value of the memory location CALL EDMQIO ; display ;;;;;; JSR R2,$SAVVR ; ; ;;;;;; MOV #BLKVAL,R2 ; block value address ;;;;;; QIOW$S #IO.WLB,#1,#1,,#IOSB,,<#MESBUF,R1,#40> ; LUN is #1 ; 10$: RETURN ; leave ; ; ; .PAGE ; .SBTTL IDHOST Identify Host ;+ ; This subroutine copied from pages 13 to 17 ; of the April 1985 issue of the RSX Multi-Tasker newsletter ; in the column written by ; ; Bruce R. Mitchell ; Machine Intelligence and Industrial Magic ; P.O. Box 601 ; Hudson, WI 54016 ;- ; IIIIIIII DDDDDDDD HH HH OOOOOOO SSSSSSSS TTTTTTTTTT ; IIIIIIII DDDDDDDD HH HH OOOOOOO SSSSSSSSS TTTTTTTTTT ; II DD DD HH HH OO OO SS TT ; II DD DD HH HH OO OO SS TT ; II DD DD HHHHHHHHHH OO OO SSSSSSS TT ; II DD DD HHHHHHHHHH OO OO SSSSSSS TT ; II DD DD HH HH OO OO SS TT ; II DD DD HH HH OO OO SS TT ; II DD DD HH HH OO OO SS TT ; II DD DD HH HH OO OO SS TT ; IIIIIIII DDDDDDDD HH HH OOOOOOO SSSSSSSS TT ; IIIIIIII DDDDDDDD HH HH OOOOOOO SSSSSSSS TT ; IDHOST -- Identify Host System's Processor Type ; ; This subroutine attempts to identify the type of processor on ; which the host system is running via various instructions unique ; to each PDP-11 processor and special Exec calls. ; ; NOTE. It is assumed that no PDP-11/45 uses 22 bit addressing, and ; all PDP-11/70's use 22 bit addressing. ; ; Inputs: None ; ; Outputs: R0 - Processor type, one of: ; 0 - Unknown ; 2324 - LSI-11/23, 23-Plus, PDP-11/24 ; 34 - PDP-11/34 ; 3540 - PDP-11/35, PDP-11/40 ; 44 - PDP-11/44 ; 4555 - PDP-11/45, PDP-11/55 ; 60 - PDP-11/60 ; 7384 - PDP-11/73, LSI-11/83, PDP-11/84 ; 70 - PDP-11/70 ; ; Register dispositions: R0, R1 destroyed ; ; Variable dispositions: None modified .MCALL SVTK$S, GPRT$S ; GPRT$ data buffer GPRBUF: .WORD 0, 0, 0 ; SST trap table TRPTBL: .WORD 0, 0, 0, 0, RSRVED, 0, 0, 0 TRTLEN = . - TRPTBL ; GEN partition name GENPAR: .RAD50 %GEN % ; Trap catcher RSRVED: INC R1 RTT ; Subroutine code IDHOST:: MOV R1, -(SP) ; Save R1 of the stack CLR R0 ; Clear processot type register CLR R1 ; Clear the trap flag register SVTK$S #TRPTBL, #TRTLEN ; Set up trapping ; We start hoping that it's an easy one, and do a MFPT MFPT ; Move from processor type TST R1 ; Did it trap? BNE 10$ ; If so, on to next text ; It didn't trap; it must be a processor which supports MFPT CMPB R0, #1 ; Is it a PDP-11/44? BNE 1$ ; If not, go see next one MOV #44., R0 ; It's an 11/44 BR 100$ ; Go clear trapping and return ; Not a PDP-11/44; is it a 23 or 24? ; hi byte 0 for 24 1$: CMPB R0, #3 ; Is it a 11/23B or a 11/24 BNE 2$ ; If not, go see next one MOV #2324., R0 ; It's an 11/23 or 11/24 BR 100$ ; Go clear trapping and return ; Not a PDP-11/44, 11/23 or 11/24; is it a J11 based CPU? 2$: CMPB R0, #5 ; Is it J11 based? BNE 100$ ; If not, we don't know what it is MOV #7384., R0 ; It's an 11/73, 11/83 or 11/84 BR 100$ ; Go clear trapping and return ; Check for PDP-11/60 using MED 10$: CLR R1 ; Clear the trapping flag .WORD 076600 ; First half of an 11/60 MED. On 11/60s ; a CPU internal register is read into ; into R0. If not a 60, trap catcher ; gets it. The second half of the MED ; is then be executed as a: .WORD 000400 ; BR .+2 (effectively, a NOP) TST R1 ; Did it trap? BNE 20$ ; If so, on to next text ; It didn't trap; it must be an 11/60 MOV #60., R0 ; It's an 11/6- BR 100$ ; Go clear trapping and return ; Check for PDP-11/34 using an MFPS 20$: CLR R1 ; Clear the trapping flag MFPS R0 ; Try to move from prcessot status TST R1 ; Did it trap? BNE 30$ ; If so, in to next text ; It trapped; it must be an 11/34 MOV #34., R0 ; It's an 11/34 BR 100$ ; Go clear trapping and return ; Check for PDP-11/35 or PDP-11/40 using an SPL 30$: CLR R1 ; Clear the trapping flag SPL 0 ; Try to set priority level TST R1 ; Did it trap? BEQ 40$ ; If so, on to next text ; It trapped; it must be an 11/35 or 11/40 MOV #3540., R0 ; It's an 11/35 or 40 BR 100$ ; Go clear trapping and return ; 45/55 and 70 architecture is identical. Assume that all 70s run ; in 22-bit aeeressing mode and do a GPRT$S. 40$: GPRT$S #GENPAR, #GPRBUF ; Get partiton parameters on GEN BCS 100$ ; If it failed, esit now MOV #70., R0 ; Assume it's an 11/70 (or 74) ADD GPRBUF, GPRBUF+2 ; Add base of GEN to size of GEN CMP GPRBUF+2, #7700 ; 126 Kwords or greater? BGE 100$ ; If not, it's a 45 "for sure" (ha) MOV #4555., R0 ; It's an 11/45, 50 or 55 ; Clear the trap catcher and return to the caller 100$: CLR TRPTBL+8. ; Clear reserved instruction vector SVTK$S #TRPTBL, #TRTLEN ; Clear trapping MOV (SP)+, R1 ; Restore R1 from the stack RETURN ; Return to the caller .END