;************************************************************************
; *
; DSPVER - Display File Version Information *
; *
;************************************************************************
;
; NOTICE
;
; COPYRIGHT (C) 1985 - Distributed Management Systems, Inc.
; ALL RIGHTS RESERVED.
;
; THIS PROGRAM HAS BEEN COPYRIGHTED BY DISTRIBUTED MANAGEMENT SYSTEMS, INC.
; THE RECEIPT OR POSSESSION OF THIS PROGRAM DOES NOT CONVEY ANY RIGHTS TO
; MANUFACTURE OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART,
; WITHOUT THE SPECIFIC WRITTEN CONSENT OF DISTRIBUTED MANAGEMENT SYSTEMS, INC.
;
; Program usage:
;
; .DSPVER filename{.ext}
;
; where
;
; filename is any valid AMOS/L program file specification.
; {.ext} defaults to .LIT.
;
; Edit History:
;
;[101] 01/15/86 Added PH$M20 flag to characteristics table. /BRH
;[100] 10/03/85 Designed and implemented by Brett R. Halle.
;
;****************
; DSPVER *
;****************
; Display file version information.
;
DSPVER: PHDR -1,0,PH$REE!PH$REU ; Program header.
GETIMP S..IMP, A5 ; Get impure area.
; Display program title.
;
TYPE <DSPVER - Version Display Utility, Version >
VCVT DSPVER+PH.VER, OT$TRM ; Output our version number to CRT.
CRLF
TYPECR < Copyright (c) 1985 - DMSI. All Rights Reserved.>
CRLF
; Get filespec and read in the program header.
;
BYP ; Bypass leading spaces and tabs.
FSPEC DV.DDB(A5), LIT ; Get file specification.
INIT DV.DDB(A5) ; Init the DDB.
OPENI DV.DDB(A5) ; Open up the file.
MOV #PH.SIZ-1, D0 ; Get size of program header.
LEA A2, DV.VER(A5) ; Index the version buffer.
10$: FILINB DV.DDB(A5) ; Read in a byte.
TST DV.DDB+D.SIZ(A5) ; End of file?
JEQ BADHDR ; Yes, bad file header.
MOVB D1, (A2)+ ; No, add byte to version buffer.
DBF D0, 10$ ; Get the entire program header.
CLOSE DV.DDB(A5) ; Close the file.
; Check for valid program header.
;
CMPW DV.VER+PH.FLG(A5), #-1 ; Valid program header?
BEQ DSPHDR ; Yes, display info.
CMPW DV.VER+PH.FLG(A5), #-2 ; Maybe, can it be run logged out?
JNE BADHDR ; No, bad file header.
PAGE
;****************
; DSPHDR *
;****************
; Display file header.
;
DSPHDR: DIM ; Enter reduced intensity.
TYPE <Program header options set for >
UNDIM ; Back to normal intensity.
PFILE DV.DDB(A5) ; Display filename.
TYPE <: > ; Pretty things up.
; Tell user if file may be run logged out.
;
CMPW DV.VER+PH.FLG(A5), #-2 ; Can file be run logged out?
BNE 10$ ; No.
UNLN ; Yes, start underline mode.
TYPE <May be run logged out>
UNUNLN ; End underline mode.
; Finish up with file name.
;
10$: CRLF ; End of line.
CRLF ; Blank line.
; Display version.
;
DIM ; Enter reduced intensity.
TYPE < Version: >
UNDIM ; Back to normal intensity.
VCVT DV.VER+PH.VER(A5), OT$TRM ; Display version number.
CRLF ; End of line.
;****************
; DSPPRV *
;****************
; Display privilege options.
;
DSPPRV: DIM ; Enter reduced intensity.
TYPE < Privileges: >
UNDIM ; Back to normal intensity.
TSTW DV.VER+PH.PRV(A5) ; Any privilege options specified?
BNE 10$ ; Yes.
TYPE <None> ; No.
BR 90$ ; We're done with privileges.
; Display all the privileges needed.
;
10$: LEA A0, PRVTBL ; Index the privilege table.
CLR D0 ; Clear enabled options counter.
20$: TSTW @A0 ; End of table?
BEQ 90$ ; Yes.
MOVW DV.VER+PH.PRV(A5), D6 ; No, get privilege bits.
ANDW @A0, D6 ; Is this option set?
BEQ 40$ ; No.
TST D0 ; Is this the first item?
BEQ 30$ ; Yes, no prefixing needed.
TYPECR <,> ; No, terminate the previous line.
TYPE < >
30$: ADD #1, D0 ; Bump item count.
TTYL 2(A0) ; Output item description.
40$: ADD #S..FDC, A0 ; Bump to the next item.
BR 20$ ; Go check it out.
90$: TYPECR <.> ; Make sure we end the line.
;****************
; DSPCHR *
;****************
; Display program characteristics.
;
DSPCHR: DIM ; Enter reduced intensity.
TYPE < Characteristics: >
UNDIM ; Back to normal intensity.
TSTW DV.VER+PH.CHR(A5) ; Any characteristics specified?
BNE 10$ ; Yes.
TYPE <None> ; No.
BR 90$ ; We're done with characteristics.
; Display all the characteristics.
;
10$: LEA A0, CHRTBL ; Index the characteristic table.
CLR D0 ; Clear enabled options counter.
20$: TSTW @A0 ; End of table?
BEQ 90$ ; Yes.
MOVW DV.VER+PH.CHR(A5), D6 ; No, get characteristics bits.
ANDW @A0, D6 ; Is this option set?
BEQ 40$ ; No.
TST D0 ; Is this the first item?
BEQ 30$ ; Yes, no prefixing needed.
TYPECR <,> ; No, terminate the previous line.
TYPE < >
30$: ADD #1, D0 ; Bump item count.
TTYL 2(A0) ; Output item description.
40$: ADD #S..FDC, A0 ; Bump to the next item.
BR 20$ ; Go check it out.
90$: TYPECR <.> ; Make sure we end the line.
;****************
; BADHDR *
;****************
; Bad file header detected.
;
BADHDR: TYPE <?>
PFILE DV.DDB(A5) ; Display filename.
TYPECR < does not have a valid program header.>
EXIT
PAGE
;****************
; DATA *
;****************
; Data used by this program.
;