home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
various
/
testchange.amos
/
testchange.amosSourceCode
Wrap
AMOS Source Code
|
1993-01-08
|
1KB
|
47 lines
'* TestChange.AMOS *
'* �1992 by Volker Stepprath *
'* Shows the number of diskchanges in any drive *
'* and if is a disk in diskdrive also a `Not a DOS Disk` *
'**** Turn off request ****
Request Off
'**** Define variables ****
Global DEVNAME$,DEVNAMEADR
Global IOREQ$,IOREQADR
Global UNIT
DEVNAME$="trackdisk.device"+Chr$(0)
IOREQ$=Space$(80)+Chr$(0)
UNIT=0
DEVNAMEADR=Varptr(DEVNAME$)
IOREQADR=Varptr(IOREQ$)
'**** Install register ****
_REGISTER
'**** Open device ****
XOPENDEV=Execall(-444)
'**** Call testroutines ****
_CHANGENUM
_CHANGESTATE
'**** Close device ****
XCLOSEDEV=Execall(-450)
End
'**** Get number of diskchanges ****
Procedure _CHANGENUM
Doke IOREQADR+28,13
XDOIO=Execall(-456)
CHANGENUM=(Leek(IOREQADR+32)-1)/2
Print "Diskchanges of drive"+Str$(UNIT)+":";CHANGENUM
End Proc
'**** If is disk in drive ? ****
Procedure _CHANGESTATE
Doke IOREQADR+28,14
XDOIO=Execall(-456)
CHANGESTATE=Leek(IOREQADR+32)
If CHANGESTATE Then N$="NO" Else N$="YES"
Print "Disk is in drive"+Str$(UNIT)+": "+N$
End Proc
'**** Define register ****
Procedure _REGISTER
Areg(0)=DEVNAMEADR
Areg(1)=IOREQADR
Dreg(0)=UNIT
Dreg(1)=0
End Proc