.MCALL .MODULE .MODULE RESAUD,VERSION=2,COMMENT=,IDENT=NO ; 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. ; ; Edit History: ; 001 George Stevens Overlaid version of RESORC. Created from RESORC ; Version 97 ; 002 Bill Gavin Change display line tag from 'Version(s)' to ID(s) ; .NLIST .INCLUDE /SRC:RESPFX.MAC/ .LIST .SBTTL AUDIT - Show file version numbers ;+ ; This subroutine shows the release and version numbers of ; a .SAV or a .SYS file. ;- ORIGIN RESAUD .ENABL LSB AUDIT:: TST A$$ ; Is this a show all? BEQ 10$ ; No, then do this. RETURN ; Yes, then don't do the audit. 10$: MOV R0,-(SP) ; Save R0. MOV R1,-(SP) ; Save R1. MOV R2,-(SP) ; Save R2. MOV R3,-(SP) ; Save R3. MOV INBUFF,R1 ; R1 = address of input buffer. .DSTAT R1,#P.AUDIT ; Find out how big the handler is? BCS 30$ ; Oops, no such device. MOV INBUFF,R0 ; R0 = first address of input buffer. TST 4(R0) ; Do we have to fetch anything? BNE 40$ ; No, then go do the lookup. ADD 2(R0),R0 ; Add in the size of the handler. ADD #256.,R0 ; Add some extra for the I/O buffer. .SETTOP R0 ; Ask for that much memory. BCC 20$ ; Did we get it? .PRINT #AUDMEM ; No, report not enough memory. BR 100$ ; And return to the caller. 20$: .FETCH INBUFF,#P.AUDIT ; Fetch the device on which it resides. BCC 40$ ; Branch if all ok. 30$: .PRINT #AUDNSD ; Tell him no such device or file. BR 100$ ; No device or file so just return. 40$: MOV R0,R1 ; R1 -> first location above handler. .LOOKUP #AREA,#0,#P.AUDIT ; Lookup the file. BCS 30$ ; Take error exit on lookup errors. .READW #AREA,#0,R1,#256.,#0 ; Read block 0 of the file. .PURGE #0 ; Now release the channel lest we forget. .RELEAS #P.AUDIT ; And release the handler lest we forget. ADD #110,R1 ; R1 -> Audit information. TST @R1 ; Is there any audit information? BNE 50$ ; Yes, then go process it. .PRINT #AUDNIN ; No, then tell him and exit. BR 100$ ; Return to the caller. 50$: FORMAT #BUFFER,, TST (R1)+ ; Move to the version field. MOV #16,R3 ; R3 = maximum number of version values. 60$: MOV (R1)+,R2 ; R2 = a version number. CMP R2,#-1 ; Is this the end of the information? BEQ 90$ ; Yes, print terminator and exit. CMP R2,#100000 ; Module not included? BNE 70$ ; No, then print real version number. FORMAT , ; Yes, then say module not included. BR 80$ ; Merge below. 70$: FORMAT ,<[D] >,R2 ; Include the version value. 80$: SOB R3,60$ ; Don't print more than 32 values. 90$: .PRINT #BUFFER ; Print the buffer. 100$: MOV (SP)+,R3 ; Restore R3. MOV (SP)+,R2 ; Restore R2. MOV (SP)+,R1 ; Restore R1. MOV (SP)+,R0 ; Restore R0. RETURN ; Return to the caller. .DSABL LSB .END