home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1995-12-30 | 1.1 KB | 41 lines |
- '* WProtect.AMOS *
- '* �1992 by Volker Stepprath *
- '* Test the diskstaus in any drive also a `Not a DOS Disk` *
- '**** Turn off request ****
- Request Off
- '**** Define variables ****
- DISKREP$=Space$(40)+Chr$(0)
- DEVNAME$="trackdisk.device"+Chr$(0)
- IOREQ$=Space$(80)+Chr$(0)
- DISKREP=Varptr(DISKREP$)
- DEVNAMEADR=Varptr(DEVNAME$)
- IOREQADR=Varptr(IOREQ$)
- '**** Set diskdrive ****
- Input "Drivenumber (0,1,2,3):";UNIT
- '**** Search for own taskaddress ****
- XTASK=Execall(-294)
- Loke DISKREP+$10,XTASK
- '**** Install register ****
- Areg(0)=DEVNAMEADR
- Areg(1)=IOREQADR
- Dreg(0)=UNIT
- Dreg(1)=0
- '**** Open device ****
- XOPENDEV=Execall(-444)
- '**** Check protectionstatus of disk ****
- Loke IOREQADR+14,DISKREP
- Doke IOREQADR+28,15
- XDOIO=Execall(-456)
- PROTECT=Leek(IOREQADR+32)
- '**** Turn off motor ****
- Doke IOREQADR+28,9
- Loke IOREQADR+36,0
- XDOIO=Execall(-456)
- '**** Show diskstatus ****
- If PROTECT Then N$="YES" Else N$="NO"
- Print "Writeprotection activ: ";N$
- '**** Close device ****
- XCLOSEDEV=Execall(-450)
- '**** Turn on request ****
- Request On
- End