;   EXTENDED STATUS PROGRAM WITH DIRECTORY TEST
;
;	rev 00.00 RLR 07/77
;	rev 01.01 krs fix login bug, interleaved read
;	rev 01.02 krs fix problem for BIG disk
;	REV 01.05 KRS 07/20/81	NEW BIGMAP LOGIC
;	REV 01.06 KRS 07/24/81	LABELED DISKETTE BUG
;	REV 01.07 KRS 08/18/81	DELETED FILE BUG
;	REV 01.08 KRS 08/26/81	SWITCHES, BUG IN LABEL
;	REV 01.09 KRS 3/82	IOS 2.37, L.C. MSG ERROR
;	REV 01.10 SCJ 06/07/82	changed JM to JC, did cosmetic changes
;	REV 01.11 SCJ 06/18/82	Uses bigmap 00.17, invalid cluster # trap
;		12/01/82 scj Change ICL to reference $:(DCOM)
;
	NAM	XST111
;
; SMALL DIR SCHEME:
;	EXPAND ALLOCATION VECTOR TO 1 BYTE PER BIT, IN 'ALCBF'
;	EACH REPRESENTING A 1K CLUSTER OF 'N' CONTIGIOUS SECTORS. 
;	COUNT BITS USED AND CLEAR TO 0.
;
; FOR EACH DIRECTORY ENTRY DO
;     FOR EACH CLUSTER DO
;	IF THAT CLUSTER IS ALLOCATED & FREE (=0)
;		THEN CLAIM BY FILLING IN DIRECTORY ENTRY NUMBER ;
;	ELSE IF CLUSTER IS CLAIMED(<>0) THEN ERROR('LINKED CLUSTER')
;
; ON ERRORS: USE 'PRTFIL' TO CONVERT FILE NUMBER
;	TO NAME FROM DIRECTORY BUFFER
;
	LST	NASC
;
	ENT	XSCAL,LBLSV,NOTBG,DSKTYP		;01.05
;
	EXT	BINDB,BINH2
	EXT	MAXUX,XPSDT,BIGDSK,BIGMP,FILCNT		;01.05
	EXT	NEGHL,MUL32,DIV16
	EXT	BINUB,BINXUB
;
DOS	EQU	5 
FCBRC	EQU	15	; FCB RECORD COUNT
CR	EQU	13
LF	EQU	10
DLR	EQU	'$'
UFCB1	EQU	5CH
SDTDTY	EQU	0BH
SDTLN	EQU	28	; rev 2 only
SDTCSZ	EQU	4
SDTMLN	EQU	9
SDTNCL	EQU	26
BM$CT	EQU	5
READ	EQU	20
OPEN	EQU	15
SETDMA	EQU	26
;
BEGIN:	JMP	START
;
	ICL	$:COPYRT
;
IDENT:	DB	'InfoSoft Disk Status Utility (XSTAT 01.11)',CR,LF,CR,LF,'$'
;
START:	LXI	H,0
	DAD	SP
	SHLD	SAVSP
	LXI	SP,STACK
	LXI	D,IDENT		;* IDENTIFY PROGRAM
	MVI	C,9
	CALL	DOS
;
;		============ SWITCH LOGIC ADDED AT 01.08
	LXI	H,81H
SWLOOP:	MOV	A,M
	CPI	'/'
	JEQ	ISSWTC
	ORA	A
	JZ	NOSWTC
	INX	H
	JMP	SWLOOP
;
ISSWTC:	INX	H
	MOV	A,M
	CPI	'A'
	JLT	NOTATZ
	CPI	'Z'+1
	JGE	NOTATZ
	SUI	'A'
	PUSH	H
	MOV	E,A
	MVI	D,0
	LXI	H,SWTABL
	DAD	D
	MVI	M,-1
	POP	H
	JMP	ISSWTC
;
NOTATZ:	ORA	A
	JZ	NOSWTC
	CPI	' '
	JNE	ISSWTC
	JMP	NOSWTC
;
SWTABL:	DW	0,0,0,0,0,0,0,0,0,0,0,0,0	; A-Z
;		============ END OF SWITCH LOGIC - 01.08
;
NOSWTC:	MVI	C,81H	; GET USER REG
	CALL	DOS
	LXI	H,5	; SDT OFFSET
	DAD	B
	MOV	E,M
	INX	H
	MOV	D,M
	LDAX	D	;				01.04
	INR	A	;				01.04
	STA	MAXUX	; UNITS + 1 FOR TESTING		01.05
	INX	D
	XCHG
	SHLD	XPSDT	; SAVE SDT POINTER
	MVI	C,25	; GET CURRENT DISK
	CALL	DOS
	STA	SVCUR	; SAVE CURRENT DISK
	STA	CURDK	; FOR BIG DISK LOGIC
	MOV	E,A
	LDA	UFCB1
	ORA	A
	JNZ	SAVSD
	MOV	A,E
	INR	A
SAVSD:	PUSH	PSW	;				01.04
	LDA	MAXUX	;				01.05
	MOV	E,A	;				01.04
	POP	PSW	;				01.04
	CMP	E	; IS CURR >= HIGH+1		01.04
	JGE	DERR	;				01.04
	STA	MAXUX	;				01.05
	LXI	D,SDTLN
	LHLD	XPSDT
;
DCRIT:	DCR	A
	JZ	DADED
	DAD	D
	JMP	DCRIT
;
DERR:	ADI	'A'-1	;				01.04
	STA	BDDSK+1	;				01.04
	LXI	D,BDDSK	;				01.04
	MVI	C,9	;				01.04
	CALL	DOS	;				01.04
	JMP	0	;				01.04
;
BDDSK:	DB	'"X" is an invalid disk specifier',13,10,'$'
;
DADED:	SHLD	XPSDT
	MVI	C,13
	CALL	DOS	; UL˜Ÿû ALL DISKS
	LDA	MAXUX	; GET DISK NUMBER			01.05
	DCR	A	; DEC DISK #
	MOV	E,A	; SELECT DISK
	MVI	C,14
	CALL	Dåååå	MVI	C,0A0H	; rev 2 only
	CALL	DOS	; FORCE LOGIN
	LXI	D,SDTDTY
	LHLD	XPSDT
	DAD	D	; ADDRESS DIR TYPE
	MOV	A,M
	STA	DSKTYP						;01.05
;
	CALL	PRNTVER	; PRINT VERSION NUMBER
	CALL	PRNTLAB	; "	DISK LABEL
	CALL	PDIRTYP	; PRINT DIRECTORY TYPE
	CALL	PRNTMEM	; "	MEMORY AVAILABLE
;
	LDA	DSKTYP
	ANI	1						;01.05
	JNZ	DONEXT
	CALL	SSIZE	; GET SIZE OF SMALL DISK
	JMP	NEXT
;
DONEXT:	CALL	BSIZE
NEXT:	CALL	PRNTCSZ	; PRINT CLUSTER SIZE
	CALL	PRTTSEC	; PRINT TOTAL SECTORS
;
	LDA	DSKTYP
	ANI	1						;01.05
	JZ	SMLDSK	; CHECK ALLOCATION FOR SMALL DISK	 01.05
	LDA	SWTABL+'N'-'A'	; SWITCH 'N'			 01.08
	ORA	A						;01.08
	JZ	NONSW						;01.08
	MVI	A,91H	; FAKE 'SUB-DIR'			 01.08
	STA	DSKTYP						;01.08
NONSW:	CALL	BIGDSK	; CHECK ALLOCATION FOR BIG DISK		 01.05
	JMP	PRTSTAT						;01.05
	EJECT
;
;  ROUTINES FOR VALUE GETTING AND DISPLAYING
;

;
;	PRINT I/OS VERSION NUMBER
;
PRNTVER: MVI	C,8DH	; GET VERSION NUMBER
	CALL	DOS
	PUSH	B	; SAVE USR AREA
	LXI	D,VERSLIN					;01.05
	ORA	A						;01.05
	JZ	NOTMU						;01.05
	LXI	D,VERSMU					;01.05
NOTMU:	MVI	C,9						;01.05
	CALL	DOS
	MOV	A,B
	LXI	H,VERNO
	CALL	BINH2
	POP	B
	INX	H
	MOV	A,C
	CALL	BINH2
	LXI	D,VERNO						;01.05
PRNTLIN: MVI	C,9
	JMP	DOS
;
VERSMU:	DB	'MultI/OS Version               ',DLR		;01.05
;
VERSLIN: DB	'I/OS Version        		',DLR		;01.05
VERNO:	DB	'  .  ',CR,LF,DLR
;
;	PRINT DISK LABEL
;
PRNTLAB: MVI	C,95H	; READ IN LABEL
	LXI	D,LABEL				;01.08
	CALL	DOS
	LXI	H,LABEL				;01.08
	MVI	M,'/'				;01.08
	LXI	D,LABLIN
	ANI	10H	; ANY LABEL?
	JNZ	PRNTLIN
	LXI	D,UNLABL
	JMP	PRNTLIN
;
LABLIN:	DB	'Disk Label : 			'	;01.08
LABEL:	DB	0,'        /',CR,LF,DLR			;01.08
;
UNLABL:	DB	' --------- Disk is unlabeled',CR,LF,DLR
;
;	PRINT USER MEMORY AVAILABLE
;
PRNTMEM: LHLD	6	; GET HIGH BYTE OF MEMTOP	 01.09
	DCX	H	; PROPERLY ADJUSTED		 01.09
	MOV	A,H	; FOR SIZE			 01.09
	RRC
	RRC
	ANI	63	; ROUND UP TO NEXT 1K!!!
	INR	A
	MVI	B,0
	MOV	C,A
	LXI	H,MEMTOP
	CALL	BINDB
	LXI	D,MEMLIN
	JMP	PRNTLIN
;
MEMLIN:	DB	'User Memory Size : 		'
MEMTOP:	DB	'      kbytes',CR,LF,CR,LF,DLR
;
;	PRINT CLUSTER SIZE
;
PRNTCSZ: LHLD	XPSDT
	LXI	D,SDTCSZ
	DAD	D
	MVI	B,0
	MOV	C,M
	PUSH	B					;01.05
	POP	H					;01.05
	SHLD	CLSSIZ					;01.05
	LXI	H,CLUSTER
	CALL	BINDB
	LXI	D,CSZLIN
	JMP	PRNTLIN
;
CSZLIN:	DB	'Cluster Size : 			'
CLUSTER: DB	'      ',CR,LF,DLR
;
;	PRINT ENTRIES IN DIRECTORY
;
PRNTENT: LHLD	XPSDT
	LXI	D,SDTMLN
	DAD	D
	MVI	B,0
	MOV	C,M
	MOV	H,B
	MOV	L,C
	SHLD	MAXENT
	LXI	H,ENTRIES
	CALL	BINDB
	LXI	D,ENTLIN
	JMP	PRNTLIN
;
ENTLIN:	DB	'Directory Length (Entries) :	'
ENTRIES: DB	'      ',CR,LF,DLR
;
;	PRINT TOTAL SECTORS
;
PRTTSEC: LHLD	XPSDT
	LXI	D,SDTNCL
	DAD	D
	MOV	E,M	;
	INX	H	; # of clusters
	MOV	D,M	;
	LHLD	CLSSIZ				;01.05
	MOV	C,L				;01.05
	MOV	B,H	;	DE*BC		;01.05
	CALL	MUL32	;	TO DEHL		;01.05
	XCHG					;01.05
	MOV	C,L		NOW TO		;01.05
	MOV	B,H	;	BCDE		;01.05
	LXI	H,TSEC
	CALL	BINXUB
	LXI	D,TSECLIN
	JMP	PRNTLIN
;
CLSSIZ:	DW	0					;01.05
;
TSECLIN: DB	'Total Sectors :               '
TSEC:	DB	'        ',CR,LF,CR,LF,DLR
;
;	PRINT DIRECTORY TYPE
;
PDIRTYP: LDA	DSKTYP					;01.05
	OßÿëÇÿÿóf%Æ¡¡A(j	!'&)!!!!'f%Æ¡¡A)Hª!*‰*A!!!!'f%Æ¡¡A(j	!'	!!!!'f%Æ¡¡A)Hª!*‰*A!!!!'f%Æ¡¡A)‹	!(…ˆŠi(ˆ¡!!!!'f%åååå.05
	CPI	50H					;01.05
	JEQ	PDIR					;01.05
	CPI	40H					;01.05
	JEQ	PDIR					;01.05
	LXI	D,NORM					;01.05
	ANI	01H					;01.05
	JZ	PDIR					;01.05
	LDA	DSKTYP					;01.05
	LXI	D,BIGDS					;01.05
	ANI	40H					;01.05
	JNZ	PDIR					;01.05
	LXI	D,BIG					;01.05
PDIR:	PUSH	D
	LXI	D,DIRLIN
	MVI	C,9
	CALL	DOS
	POP	D
	JMP	DOS
;
NORM:	DB	'  Standard ',CR,LF,CR,LF,DLR
BIGDS:	DB	'  Big, Double-Sided ',CR,LF,CR,LF,DLR
BIG:	DB	'  Big',CR,LF,CR,LF,DLR
DSIDE:	DB	'  Double-Sided',CR,LF,CR,LF,DLR
SUB:	DB	'  Sub-Directory',CR,LF,CR,LF,DLR
;
DIRLIN: DB	'Directory Type :   		',DLR
	EJECT
;
;   LOGIC TO FIND USED CLUSTERS ON A BIG DISK
;
;	DETERMINE SIZE OF BIG DISK
;
BSIZE:	LXI	D,BMPFCB
	MVI	C,OPEN
	CALL	DOS
;
	LDAX	D
	ANI	3FH	; CLEAR READ PROTECT		 01.05
	STAX	D
	LXI	H,8					;01.09
	DAD	D					;01.09
	MOV	A,M					;01.09
	ANI	7FH					;01.09
	MOV	M,A					;01.09
	INX	H					;01.09
	MOV	A,M					;01.09
	ANI	7FH					;01.09
	MOV	M,A					;01.09
;
	MVI	C,SETDMA
	LXI	D,BMPBUF
	CALL	DOS
	LXI	B,0
;
SETLOOP: LXI	D,BMPFCB
	PUSH	B
	MVI	C,READ
	CALL	DOS
;
	LXI	H,BMPBUF
	MOV	A,M
	ANI	80H	; CHECK FOR FULL BLOCK
	STA	EOM	; END OF MAP
	MOV	A,M
	ANI	40H
;
	POP	B
	LXI	D,BM$CT
	DAD	D
	JNZ	FULL
;
	MOV	E,M	; # OF BYTES OF BITS
;
LOOP:	INX	H
	MOV	A,M
	MVI	D,8
ADDLOP:	RLC
	JNC	DONT
	INX	B
DONT:	DCR	D
	JNZ	ADDLOP
	DCR	E
	JNZ	LOOP
ENDLOP:	LDA	EOM	; ARE WE DONE ?
	ORA	A
	JNZ	DONECNT
	JMP	SETLOOP
;
FULL:	MOV	A,M	; # OF BYTES OF BITS
	MVI	H,0
	MOV	L,A
	DAD	H
	DAD	H
	DAD	H	; *8
	DAD	B	; MAKE COUNT CURRENT
	MOV	B,H
	MOV	C,L
	JMP	ENDLOP
;
;	COMMON 'PRINT DIR SIZE' ROUTINE
;
DONECNT: 	; BC=# USED CLUSTERS
	MOV	H,B
	MOV	L,C
	SHLD	USECLS
	LHLD	XPSDT
	LXI	D,SDTCSZ
	DAD	D
	MOV	A,M
	RRC		; DIV CLUSTER SIZE BY 8
	RRC
	RRC
	ANI	15
	MOV	E,A
	MVI	D,0
	PUSH	D
	LHLD	USECLS
	PUSH	H
	POP	B
	CALL	MUL32	; USED CLUSTERS * (CLUS SIZE / 8)
	XCHG		; DEHL -> HLDE
	MOV	B,H
	MOV	C,L	; NOW BCDE
	LXI	H,USEVAL
	CALL	BINXUB
;
	LHLD	XPSDT
	LXI	D,SDTNCL
	DAD	D
	MOV	C,M	; GET TOTAL NUMBER OF CLUSTERS
	INX	H
	MOV	B,M
	POP	D
	PUSH	D	; K/CL
	PUSH	B	; TOT
	CALL	MUL32
	XCHG
	MOV	B,H
	MOV	C,L
	LXI	H,TOTVAL
	CALL	BINXUB
	LHLD	USECLS
	CALL	NEGHL
	POP	D	; TOT
	DAD	D	; HL=TOTAL CLUS - USED CLUS
	POP	B	; K/CL
	XCHG
	CALL	MUL32
	XCHG
	MOV	B,H
	MOV	C,L
	LXI	H,LEFTVAL
	CALL	BINXUB
	LXI	D,TOTLIN
	JMP	PRNTLIN
;
TOTLIN:	DB	'Total Disk Space :            '
TOTVAL:	DB	'        kbytes',CR,LF
;
USELIN:	DB	'Disk Space Used :             '
USEVAL:	DB	'        kbytes',CR,LF
;
LEFTLIN: DB	'Disk Space Remaining :        '
LEFTVAL: DB	'        kbytes <=========',CR,LF,CR,LF,DLR
	EJECT
;
;	logic to size up a small disk
;
SSIZE:	MVI	C,27
	CALL	DOS	; GET DISK ALLOCATION VECTOR
	STA	NCLUS
	MOV	A,E
	STA	TOTAL
	PUSH	D	; SAVE NUMBER OF CLUSTERS
	LXI	H,7
	DAD	D	; ROUND UP
	LXI	D,8
	CALL	DIV16	
	XCHG		; DE NOW FULL BYTES
	LXI	H,ALCBF
;
ALP1:	MVI	D,8
	LDAX	B
;
ALP2:	PUSH	PSW	; DECODE EACH BIT
	ANI	80H
	MOV	M,A
	INX	H
	POP	PSW
	RLC
	DCR	D
	JNZ	ALP2
;
	INX	B
	DCR	E
	JNZ	ALP1
;
;	COUNT SPACE LEFT
;
	LXI	H,ALCBF					;01.06
	POP	B	; GET NUMBER OF CLUSTERS
ALP3:	MOV	A,M
?€/À”¥ ”Å@Ð ”Õd”ÒÃ“²$U4UBDò’ãPÐ ””å ” Ð¤ÅC ””å€”€Ð ”D5 ”0Ð ”¤å ”Å0Ð ”Ôõ`”2Ä Ð ”Õd”"ÃÐ ”¤Õ”DôäT4å@ÐååååJECT
;
;	READ IN THE DIRECTORY
;
;
;	SMALL DIRECTORY PROCESSING
;
SMLDSK:	LXI	H,MXFILS
	MVI	M,1	; MXFILES:=1
	LXI	D,BIGMP
	PUSH	D
	MVI	C,26
	CALL	DOS	; SET DMA FOR DIR
	LXI	D,QUEFIL
	MVI	C,17
	CALL	DOS	; FIRST FILE
	CPI	255
	JZ	FDNE	; NO FILES
;
RDDIR:	LXI	D,QUEFIL
	MVI	C,18
	CALL	DOS	; NEXT FILE
	CPI	255
	JZ	RDDNE
	LXI	H,MXFILS	; COUNT FILES
	INR	M
	ANI	3
	CPI	3	; FILE # MOD 3 =3
	JNZ	RDDIR
	POP	D
	LXI	H,80H
	DAD	D
	XCHG
	PUSH	D
	MVI	C,26
	CALL	DOS
	JMP	RDDIR
;
FDNE:	LXI	D,NOFIL
	MVI	C,9
	CALL	DOS
GRTN:	LDA	SVCUR	; GET CURRENT DISK
	MOV	E,A	; SELECT CURRENT DISK
	MVI	C,14
	CALL	DOS
	LXI	D,ENDMSG
	MVI	C,9
	CALL	DOS
	LHLD	SAVSP
	SPHL
	RET
;
NOFIL:	DB	' No Files on Disk',CR,LF,DLR
ENDMSG:	DB	'Disk Status Completed',CR,LF,DLR
;
;
;	LOG AND REPORT ON EACH FILE
RDDNE:	POP	D
;
	LXI	H,BIGMP
;
NXFIL:	SHLD	CRDIR		;  NEXT FILE  , SAVE CURR. DIR ENTRY
	LDA	FDCNT
	INR	A
	STA	FDCNT
	MOV	A,M
	CPI	0E5H	
	JZ	NXBK2		; DONE
	LDA	FILCNT
	INR	A
	STA	FILCNT
	MOV	A,M
;
	LDA	SWTABL+'N'-'A'	; SWITCH 'N'		 01.08
	ORA	A					;01.08
	JNZ	NXBK2	; NO LINKED TEST		 01.08
	LXI	D,FCBRC
	DAD	D
	MOV	A,M	; CLUS. CNT:=INT((RECORD-1)/NCLUS)+1
	ORA	A
	JZ	NXBK2	; CHECK FOR NULL FILES
	DCR	A
	PUSH	PSW
	LDA	NCLUS
	MOV	C,A
	MVI	B,0
	POP	PSW
NXBK1A:	INR	B	; B:=RECORDS DIV NCLUS
	SUB	C
	JGE	NXBK1A
	MOV	C,B
;
;
NXBLK:	INX	H	; NEXT CLUSTER IN FILE
	PUSH	H
	MOV	E,M	; E = File cluster, check for validity
	MOV	B,E
	MVI	D,0
	LXI	H,ALCBF
	DAD	D		; CHECK ALLOCATION
	MOV	A,M
	PUSH	H
;
	ORA	A		; cluster not allocated - OK
	JZ	NXBKC
	MOV	A,E		; IF CLUSTER 0		 01.06
	ORA	A		; IGNORE		 01.06
	JZ	NXBKC					;01.06
;
;	REPORT LINKED CLUSTERS
;
	LXI	D,BLKLNK				;01.05
	MVI	C,9					;01.05
	CALL	DOS					;01.05
	LXI	D,LNKNUM	; LINKED CLUSTER	 01.05
	CALL	PRTBLK
	POP	H
	MOV	A,M
	PUSH	H
	CALL	PRTFIL		; ORIG FILE
;
NXBKB:	LDA	FDCNT
	CALL	PRTFIL
	CALL	NEWLIN
;
NXBKC:	LDA	FDCNT
	POP	H
	MOV	M,A		; ASSIGN CLUSTER TO FILE
	POP	H
	DCR	C
	JNZ	NXBLK
;			NEXT FILE
NXBK2:	LHLD	CRDIR
	LXI	D,32
	DAD	D
	LDA	MXFILS
	MOV	C,A
	LDA	FDCNT
	CMP	C
	JC	NXFIL	; changed JM to JC 		01.10
;
;	Finish off report for both type dir's.
;
PRTSTAT: LDA	FILCNT
	MOV	C,A
	MVI	B,0
	PUSH	B	; SAVE NUMBER OF USED ENTRIES
	LXI	H,FILECNT
	CALL	BINDB
	CALL	PRNTENT
	LXI	D,FILELIN
	CALL	PRTLIN
	POP	D
	LHLD	MAXENT
	XCHG
	CALL	NEGHL
	DAD	D	; HL = MAXENT - USED ENT
	MOV	B,H
	MOV	C,L
	LXI	H,ENTLVAL
	CALL	BINDB
	LXI	D,ENTLLIN
	CALL	PRNTLIN
	JMP	GRTN
;
ENTLLIN: DB	'Directory Entries Remaining :	'
ENTlVAL: DB	'        <===============',CR,LF,CR,LF,DLR
;
PRTBLK:	PUSH 	PSW
	PUSH	B
	PUSH	D
	XCHG
	MOV	A,B
	CALL	BINH2
	POP	D
	MVI	C,9
	CALL	DOS
	POP	B
	POP	PSW
	RET
;
;	A=DIR ENTRY OF FILE (TO GET NAME)
PRTFIL:	PUSH	B	; PRINT FILE NAME
	PUSH	D
	PUSH	PSW
	DCR	A
	MOV	L,A
	MVI	H,0
	DAD	H
	DAD	H
	DAD	H
	DAD	H
	DAD	H
	LXI	D,BIGMP
	DAD	D
	INX	H
	MVI	C,11
PRTF1:	PUSH	H
	PUSH	B
	MOV	E,M
	MVI	C,2
	CALL	DOS
	POP	B
	POP	H
	INX	H
	DCR	C
	JNZ	PRTF1
	LXI	D,SPCS
	MVI	C,9
	CALL	DOS	; SKIP SOME SPACES
	POP	PSW
	POP	D
	POP	B
	RET
; PRINT A FRESH LINE
NEWLIN:	LXI	D,CRLF
; PRINT A LINE FROM DE
PRTLIN:	PUSH	B
	MVI	C,9
	CALL	DOS
	POP	B
	RET
;
; PRINT (A)=CLUSTERS  IN 'KBYTES'
PRTSIZ:	PUSH	H
	MOV	E,A
	MVI	D,0
	LDA	NCLUS
	MOV	L,A
	MOV	H,D
	MVI	C,89H	; CLUSTERS*(RECS/CLUSTER)
	CALL	DOS
	XCHG		; HL:=RECORDS
	LXI	D,8	; RECORDS/8-> 1K
	MVI	C,8AH
	CALL	DOS
	MOV	B,H	; BC:='K'
	MOV	C,L
	POP	H
;
PRTSX:	CALL	BINDB	; CONVERT TO ASCII
NOTBG:
XSCAL:	RET						;01.05
;
PRTIT:	LXI	D,TOTLIN
	JMP	PRNTLIN
;
BLKLNK:	DB	'Linked Cluster ',DLR				;01.09
LNKNUM:	DB	'..H ',DLR
FILELIN: DB	'Directory Entries Used :	'
FILECNT:DB	'      '
CRLF:	DB	CR,LF,DLR
LBLSV:	DB	'        ',CR,LF,DLR				;01.05
SPCS:	DB	'     ',DLR
TOTAL:	DB	0
;
NCLUS:	DB	0	; NUMBER OF BLOCKS PER CLUSTER
MXFILS:	DB	0	; MAXIMUM NUMBER OF FILES
CRDIR:	DS	2
FDCNT:	DB	0
CURDK:	DB	0						;01.05
QUEFIL:	DB	'??????????????',0,0,0	; DISK:NAME.TYP,EXT	 01.07
SVCUR:	DB	0	; SAVE CURRENT DISK
SAVSP:	DW	0
;
DSKTYP:	DB	0
USECLS:	DW	0
EOM:	DB	0
MAXENT:	DW	0
;
BMPFCB:	DB	0
	DB	'MAP     DIR',0,0,0,0
	DW	0,0,0,0,0,0,0,0				;01.05
	DB	0
;
BMPBUF: DS	128	; BIT MAP BUFFER
;
	RAM
	DS	128
STACK:	DB	0					;01.05
;
ALCBF:	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
	DW	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;
	END	BEGIN
