; ************************** AMUS Program Label ******************************
; Filename: PPNS.M68 Date: 03/25/92
; Category: UTIL Hash Code: 432-131-151-562 Version: 1.0(103)
; Initials: ULTR/AM Name: DAVID PALLMANN
; Company: ULTRASOFT CORPORATION Telephone #: 5163484848
; Related Files: None
; Min. Op. Sys.: AMOSL 1.0 Expertise Level: BEG
; Special:
; Description: Displays PPNs and ERSATZ for ppns a screen at a time.
; Now works with 2.x extended devices and traditional devices.
;
; ****************************************************************************
;*; Updated on 25-Mar-92 at 1:38 AM by James A. Jarboe I V; edit time: 1:31:49
;****************************************************************************
;* *
;* PPNS *
;* PPN display utility *
;* *
;****************************************************************************
;Copyright (C) 1990 UltraSoft Corporation. All Rights Reserved.
;
;Written by: David Pallmann
;Modified by: James A. Jarboe I V
;
;Edit History:
;1.0(100) 24-Aug-90 created. /DFP
;1.0(101) 27-Aug-90 fix bug where count got reset if MFD was more than
; one block long. Thanks to Ami Bar-Yadin for finding
; and reporting this. /DFP
;1.0(102) 19-Nov-90 fix bug where device wasn't taken into account. /DFP
;1.0(103) 24-Mar-92 Now works on extended disks. /JAJ
; Fixed bug where 377,377 was displayed on traditional
; format disks on AMOS 2.x which is a delete directory.
;
VMAJOR =1
VMINOR =0
VSUB =0
VEDIT =103.
VWHO =0
LONG.SYMBOL.1 =1
LONG.SYMBOL.2 =2
IF EQ,LONG.SYMBOL.1-LONG.SYMBOL.2,ASMERP "?Can't assemble - the 2.x assembler is required"
NOTES:
MOVW FLAGS(A5), D7 ; Set flags. [103]
ANDW #F$EXT, D7 ; Extended directory? [103]
BEQ 10$ ; No..never mind. [103]
CURSOR #1, #56. ; Set cursor. [103]
TYPE <Extended Directory> ; Tell em. [103]
BR 20$ ; Then quit.. [103]
; Extendeds are always sorted. [103]
; Traditional directories can be out of sequence. They are not sorted
; using the PSORT routine. The thought is, if the traditional directory
; is out of sequence, inform the user so that they can do a MFDSEQ on that
; device if it is out of sequence. Extended devices ppns can be found even
; if not sequenced thus we sort them if they are out of sequence for good
; display.
10$:
MOVW FLAGS(A5),D7 ;
ANDW #F$OUT,D7 ;
BEQ 20$ ;
CURSOR #1,#56. ;
TYPE PPNs are not in sequence
20$:
CURSOR #24.,#1 ;
EXIT ;
REDMFD: READ DISK(A5) ;
MOV DISK+D.BUF(A5),A0 ;
MOV #63.,D0 ;
10$: TSTW @A0 ;
BEQ 20$ ;
CMPB 1(A0), #^O377 ; Is project number 377? [103]
BNE 12$ ; No..never mind [103]
CMPB @A0, #^O377 ; Is Programmer number 377? [103]
BNE 12$ ; No..never mind. [103]
MOVW FLAGS(A5), D7 ; Get flags. [103]
ANDW #F$20X, D7 ; Is this AMOS 2.x? [103]
BNE 18$ ; Yes..then bypass 377,377. [103]
;**************
;* EXTENDED *
;**************
;Function: Get extended directory PPns.
EXTENDED:
;;; TYPECR ?PPNS does not support extended disks [103]
;;; CRLF ; [103]
;;; EXIT ; [103]
ORW #F$EXT,FLAGS(A5) ; Set extended directory. [103]
DIRACC DISK(A5),#DA$INI!DA$NEW ; Get directory access [103]
10$:
DIRSCH DISK(A5),#DS$DIR ; Search for next PPn. [103]
TSTW D6 ; End of entries? [103]
BMI 30$ ; Branch if yes [103]
INCW COUNT(A5) ; Bump count. [103]
MOVW D.FIL+DISK(A5), (A3)+ ; Save ppn. [103]
CMPW COUNT(A5),#1 ; First ppn? [103]
BEQ 10$ ; Yes..bypass test. [103]
CMMW -2(A3),-4(A3) ; Greater than last PPN? [103]
BHIS 20$ ; Yes..never mind. [103]
ORW #F$OUT,FLAGS(A5) ; No..set not sequenced. [103]
20$:
BR 10$ ; Next ppn. [103]
30$:
MOVW COUNT(A5),D0 ; Get ppn count. [103]
BEQ 99$ ; No ppns. [103]
MOVW FLAGS(A5), D7 ; Get flags. [103]
ANDW #F$OUT, D7 ; Any ppns out of sequence? [103]
BEQ 40$ ; No..never mind. [103]
CALL PSORT ; Yes..sort PPNs. [103]
40$:
LEA A3, PPNTBL(A5) ; Index ppn table. [103]
50$: MOVW (A3)+, D3 ; Setup PPN. [103]
BEQ 99$ ; Quit if no more. [103]
CALL GET.ERSATZ ; See if ersatz exists. [103]
MOV D4, (A4)+ ; Yes..set it. [103]
60$: SOB D0, 50$ ; Do for all PPNs. [103]
99$: RTN ; Return to caller. [103]
;**************
;* PSORT *
;**************
;Function: Simple PPN sort for extended device. [103]
;
; Extended directories are sorted, traditional directories are not.
; They could be, but then it would defeat the purpose of informing the
; user that at traditional device's ppns are out of sequence.
;
PSORT:
SAVE A3,A4, D0 ; Save registers.
10$: CLR D0 ; Clear PPN counter.
LEA A3, PPNTBL(A5) ; Index PPN table.
MOV A3, A4 ; Duplicate PPN table address.
ADD #2, A4 ; Bump to next PPn entry.
MOVW COUNT(A5), D0 ; Set PPn count.
SUBB #1, D0 ; Offset ppn count for compare.
BEQ 99$ ; Quit if only 1.
20$: CMMW @A4, @A3 ; Next PPn greater than last?
BHIS 30$ ; Yes..all ok.
MOVW @A3, D7 ; No..save ppn
MOVW @A4, @A3 ; Write it to last place.
MOVW D7, @A4 ; Put larger ppn ahead of previous.
BR 10$ ; Start over.
30$: ADD #2, A3 ; Bump previous ppn.
ADD #2, A4 ; Bump current ppn.
SOB D0,20$ ; Do for all ppns.
99$: REST A3,A4, D0 ; Restore all registers.
RTN ; Return to caller.
DIM:
CRT 11. ; Set low intensity. [103]
RTN ; Return to caller. [103]
BRIGHT:
CRT 12. ; Set normal intensity. [103]
RTN ; Return to caller. [103]
;****************
;* GET.ERSATZ *
;****************
;Function: Return ersatz name for an account
;
;Inputs: D3 - PPN
;
;Outputs: D4 - ersatz name RAD50 (0 if no ersatz name)