Electronics Btrieve Motorcycling Software If you find this site useful and want to support, click on few ads to throw some money into hat.

1000 REM IDE Drive identifier v2
1010 BASE=0E000H
1020 GOSUB 2000
1050 GOSUB 4000
1055 GOSUB 8000
1060 CMD=0ECH
1070 GOSUB 3000
1080 PRINT 
1090 GOSUB 6000
1999 END 
2000 REM set parameters to defaults
2005 XBY(BASE+2)=1
2010 XBY(BASE+3)=0
2020 XBY(BASE+4)=0
2030 XBY(BASE+5)=0
2040 XBY(BASE+6)=0E0H
2050 RETURN 
3000 REM send command to device, not checking status here
3005 I=XBY(BASE+7)
3006 IF I>127 THEN GOTO 3005
3010 XBY(BASE+7)=CMD
3015 I=XBY(BASE+7)
3020 RETURN 
4000 REM reset device
4005 XBY(BASE+14)=6 : FOR I=0 TO 10 : NEXT 
4020 XBY(BASE+14)=2
4030 I=XBY(BASE+7)
4035 IF I>127 THEN GOTO 4030
4060 RETURN 
5000 REM read one data word, return it in LO and HI
5005 LO=XBY(BASE+0)
5010 HI=XBY(BASE+16)
5020 RETURN 
6000 REM read ID data and display drive parameters
6005 GOSUB 5000 : GOSUB 5000
6006 CYL=HI*256+LO
6007 GOSUB 5000 : GOSUB 5000 : HEAD=HI*256+LO
6008 GOSUB 5000 : GOSUB 5000 : GOSUB 5000 : SPT=HI*256+LO
6009 GOSUB 5000 : GOSUB 5000 : GOSUB 5000
6010 PRINT CYL,"Cylinders,",HEAD,"Heads,",SPT,"Sectors,",
6011 SIZE=CYL*HEAD*SPT*512/1024/1024
6012 PRINT SIZE,"MB"
6015 PRINT "Serial# ", : CNT=10 : GOSUB 7000 : PRINT 
6020 GOSUB 5000 : GOSUB 5000 : GOSUB 5000
6030 PRINT "Rev: ", : CNT=4 : GOSUB 7000 : PRINT 
6040 PRINT "Model: ", : CNT=20 : GOSUB 7000
6042 PRINT 
6045 FOR I=1 TO 7 : GOSUB 5000 : NEXT : GOSUB 5000
6046 PRINT "Current logical cylinders ",HI*256+LO
6047 GOSUB 5000 : PRINT "Current logical heads ",HI*256+LO
6048 GOSUB 5000 : PRINT "Current logical spt ",HI*256+LO
6050 GOSUB 5000 : CAP=HI*256+LO
6051 GOSUB 5000 : CAP=(HI*256+LO)*65536+CAP
6052 PRINT "Current capacity in sectors ",CAP
6053 GOSUB 5000 : GOSUB 5000 : CAP=HI*256+LO
6054 GOSUB 5000 : CAP=(HI*256+LO)*65536+CAP
6055 PRINT "User addressable LBA sectors ",CAP
6079 FOR I=62 TO 255 : GOSUB 5000 : NEXT 
6080 N=XBY(BASE+7)
6090 RETURN 
7000 REM read CNT words and output ASCII
7010 FOR I=1 TO CNT
7012 GOSUB 5000
7045 IF HI>31 THEN PRINT CHR(HI),
7055 IF LO>31 THEN PRINT CHR(LO),
7060 NEXT 
7070 RETURN 
8000 CMD=90H
8010 GOSUB 3000
8020 RETURN 

>run


 1240 Cylinders, 16 Heads, 63 Sectors, 610.3125 MB
Serial# WD-WM3180238200 
Rev: 28.25E40
Model: WDC AC2635F 
Current logical cylinders 0 
Current logical heads 0 
Current logical spt 0 
Current capacity in sectors 0 
User addressable LBA sectors 1249920 

READY


Copyright © Madis Kaal 2000-