.MCALL .MODULE .MODULE ST,VERSION=05,COMMENT=,AUDIT=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ;++ ; Facility: DBGSYM - .STB file manipulation utility ; ; Author: Joe Worrall ; ; Created: 09-Feb-83 ; ; Abstract: STDRV - Prototype .SYS file ; ; Externals Description ; --------- ----------- ; ; NONE This module creates a prototype .SYS file which is ; appended to DBGSYM.SAV to create DBGSYM's output file. ; ; Edit Who Date Description of modification ; ---- --- ---- --------------------------- ; ; 0.1(V5.5) I.B. Sokari 19-Apr-88 Change version number from 5.4 to 5.5 ; ;-- ; Mcalls .MCALL .DRDEF,.PRINT,.ASSUME,.ADDR,...CMV ...CMV PART=ALL,TYPE=V ; Define the ST handler .DRDEF ST,63,,0,0,0,DMA=NO .DRPTR FETCH=*NO*,LOAD=LOAD,UNLOAD=UNLOAD .DREST CLASS=DVC.PS SYSPTR =: 054 ;-> Base of RMON SYSGEN =: 372 ;-> SYSGEN options word PNPTR =: 404 ;-> Base of PNAME$ table $QCOMP =: 270 ; I/O complete entry to monitor SYSVER =: 276 ;-> System version as .BYTE major,.BYTE minor ; RT-11 Version number SYSVN = 5 ;For Version 5.5 .SBTTL STINST - ST handler Installation routine ;+ ; STINST ; This is the simple installation code for ST:. We allow installation ; of ST: as a data device ONLY, as ST: can clearly never be a SYSTEM ; HANDLER! ;- .DRINS ST STINST: BR 10$ ;OK to install as data device BR 20$ ;Error, can't install as system device. 10$: CALL MONCHK ;Verify correct monitor and version BCS 20$ ;Branch on mismatch TST (PC)+ ;C=0, ok to install. 20$: SEC ;C=1, Error, invalid system. RETURN ;Return to KMON ;+ ; MONCHK ; This routine checks the type and version of the currently running ; monitor to verify if this version of DBG should work. ; ; CALL MONCHK ; ; R0 -> $RMON ; C=0 Monitor type and version match ; C=1 Monitor type or version mismatch ;- MONCHK: MOV @#SYSPTR,R0 ;R0 -> $RMON ; Make sure we were assembled with same RT-11 that is running now CMPB SYSVER(R0),#RT$REL ; Monitor major version match ? BNE 10$ ; No, don't allow installation CMPB SYSVER+1(R0),#RT$VER ; Monitor minor version match ? BNE 10$ ; No, don't allow installation TST (PC)+ ;C=0, ok to install. 10$: SEC ;C=1, Error, invalid system. RETURN ;Return to KMON .SBTTL SLOT - Find a handler in $PNAME table ;+ ; SLOT ; This routine finds the handler given, in the system handler tables. ; ; CALL SLOT ; ; C-BIT clear R2 -> Beginning of handler in high memory ; C-BIT set Handler not found in memory. ; ;- .ENABL LSB .DSTATUS =: 342 ;EMT Code for .DSTATUS request SLOT: .ADDR #DEVNAM,R0 ;R0 -> Device name .ADDR #DAREA+1,-(SP) ;(SP)-> .DSTATUS info area(+physical) EMT .DSTATUS ;*** (.DSTAT #DAREA+1,#DEVNAM) *** BCS 40$ ;Branch if not found MOV DAREA+4,R2 ;R2 -> Handler load address BEQ 40$ ;Branch if not loaded TST (PC)+ ;C=0 40$: SEC ;C=1 50$: RETURN ;Return to caller, or callers caller. .DSABL LSB DAREA: .BLKW 4 ;.DSTAT Information block DEVNAM: .BLKW 1 ;Device name to find .ASSUME . LE 356 ;Must be below this. .SBTTL SET OPTIONS for ST handler .DRSET SYSGEN,-1,SETSGN,NO ;+ ; SETSGN ; Auto-configures ST for the current system configuration. ;- SETSGN: NOP CLR R3 ;-> Flag SET ST SYSGEN (R3=0) ;-> SET ST NOSYSGEN (R3 = -1) CALL MONCHK ;Check current monitor type and version BCS 20$ ;Branch if bad news for user ;R0 -> Base of RMON MOVB SYSGEN(R0),60 ;R0 = Configuration bits that matter to hndlr TST R3 ;SET ST SYSGEN? BEQ 10$ ;Branch if so, ok. COMB 60 ;Else prevent future handler installs 10$: TST (PC)+ ;C=0, ok. 20$: SEC ;C=1, error. RETURN ;Return to caller. .SBTTL LOAD - Entry point for .LOAD .SBTTL UNLOAD - Entry point for .UNLOAD .ENABL LSB LOAD: TST (PC)+ ;Clear carry - setup UNLOAD: SEC ;Set carry - reseting ROR (PC)+ ;Save state of C-BIT 10$: .WORD 0 ; DEBUG:: NOP ;place to patch for debugging MOV R5,R0 ;R0 -> $ENTRY table entry for this handler SUB R2,R0 ;R0 -> $PNAME table entry for this handler CMP @R0,#<^RST> ;Load/Unload of ST:? BEQ 20$ ;Branch if so, ok. ;+ ;ERROR JSR R0,ERRPRT ;Print error message that follows .ASCIZ /?ST-F-Handler must be named ST/ ;- .EVEN 20$: MOV @R5,R2 ;Save -> xxLQE MOV #STCQE-ZERO,R0 ;calc address of STCQE ADD R2,R0 ;in memory MOV R0,STQFIX-ZERO(R2) ;and put into memory resident code MOV @#SYSPTR,R0 MOV $QCOMP(R0),QCPFIX-ZERO(R2) ;Fill in hand coded .DRFIN MOV R2,R0 ;R0 -> Our base ADD #$SYMS-ZERO,R2 ;R2 -> First symbol MOV R2,(PC)+ ;Save location SYMLOC: .BLKW 1 ;-> First symbol in ST: handler MOV R2,STSYMS-ZERO(R0) ;Stuff location for SD to pickup ;on .LOAD SD MOV #<^RSD>,DEVNAM ;Look for SD: handler CALL SLOT ;Find it BCC 30$ ;Branch if we found DBG MOV #<^RJD>,DEVNAM ;Look for debug version too CALL SLOT ;Find it BCS 40$ ;Branch if not there, thats ok with me. 30$: CLR STSYMS-ZERO(R2) ;Assume .UNLOAD TST 10$ ;Loading us? .LOAD BMI 40$ ;Branch if not, done. MOV SYMLOC,STSYMS-ZERO(R2) ;Stuff location of our symbols in SD: 40$: CLC ;No errors. RETURN ;Return to KMON ERRPRT: TST 10$ ;Was the command .LOAD? BMI 140$ ;Branch if not, was .UNLOAD .PRINT ;Print error message in -> R0 140$: CLR R0 ;Don't print a .UNLOAD message TST (SP)+ ;Clean stack of saved R0 C=0 RETURN .DSABL LSB .ASSUME . LT 1000 ;**************** .DRBEG ST ZERO =:.-6 ;Account for new NOP instruction MOV #0,R4 ;Get addr of CQE STQFIX =:.-2 ;filled in by load code MOV @R4,R5 ;-> Q element 3rd word. TST Q$WCNT(R5) ;Test if read or write BMI STEXIT ;Write - done go to complete BIS #EOF$,@-(R5) ;Read - EOF then go to complete STEXIT:: ;;; .DRFIN ST ;Exit (R5 loaded above) JMP @#0 ;Filled in by load code as address QCPFIX =:.-2 ; of QCOMP in RMON STSYMS::.WORD 0 ;-> ST driver symbols (If in memory) ;**************** ;+ ; $SYMS ; This location is where SYMBOLS start being appended by DBGSYM. This ; global symbol is passed to DBGSYM via a .STB file. ;- $SYMS:: .SBTTL STINT - Fake interrupt label for ST handler STINT: ;Fake interrupt entry point .DREND ST,FORCE=7,PSECT=ZZDVR .END