'Program Name    : FileSize.bas
'Author          : Modified by Lloyd L. Smith for Spectra Publishing - Tech Support
'Date            : 09-28-90
'Compuserve #    : GO PCVENB, Vendor #12/Spectra,  Tech Support ID 71530,2640
'Tech Support BBS: 813-625-1721, PC-Board, 8,N,1 USR HST 300 - 14.4, 24hrs
'Tech Support Fax: 813-625-1698  G2 & G3 compatible
'Tech Support Voc: 813-625-1172  Voice
'Description     : Origin Unknown, adapted to PowerBasic for example only

dim Rout(50)
defint a-z
drivenum=3  'set for c hard drive
clusters=0

a#=2048     'cluster size, may vary depending on drive

data &h55,&h8B,&hec,&h8b,&h76,&h06,&h8b
data &h14,&hb4,&h36,&hcd,&h21,&h8b,&h7e
data &h08,&h89,&h1d,&h5d,&hca,&h04,&h00

p=varptr(Rout(1))
def seg=varseg(Rout(1))
for n=0 to 20:read j:poke (p+n),j:next
def seg


gosub freedisk
print "Clusters:";clusters
b#=clusters
print "Free Disk";b#*a#

idle:
'press escape to exit
k$=inkey$:if k$=chr$(27) then system
if k$="1" then gosub freedisk
goto idle


freedisk:
def seg=varseg(Rout(1))
call absolute p(clusters,drivenum)
def seg
return
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     