home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
167
/
NOCOPY.ZIP
/
NOCOPY.ASM
next >
Wrap
Assembly Source File
|
1986-10-11
|
5KB
|
109 lines
;NOCOPY.ASM - utility to prevent DISKCOPY from copying a diskette
; - use in conjunction with PREVENT.ASM program
;<c> 1986 by Debbie Cooper
stacksg segment para 'stack'
db 512 dup(?)
stacksg ends
datasg segment para 'data'
base db 0dfh ;step-rate time
db 2 ;dma mode
db 25h ;how long disk motor should run
db 2 ;1=256, 2=512, etc (bytes per sector)
db 9 ;last sector number is 9
db 2ah ;gap length normally 2ah
db 0ffh ;data transfer length
db 50h ;gap length for format
db 0f6h ;fill byte
db 19h ;head settle time
db 2 ;motor speed time
addr db 39,0,1,2 ;sector address data
db 39,0,2,2
db 39,0,3,2
db 39,0,4,2
db 39,0,5,2
db 39,0,6,2
db 39,0,11,2
db 39,0,8,2
db 39,0,9,2
secret db 'Debbie Cooper',499 dup(' ')
buffer db 512 dup(' ')
oldvec dw ? ;used to save the original
oldseg dw ? ;disk parameter vector address
count db 0 ;counter for disk tries
msg db 0dh,0ah,'NOCOPY - A utility to prevent DISKCOPY DOS function'
db 0dh,0ah,'<c> 1986 by Debbie Cooper'
db 0dh,0ah,0dh,0ah
db 'Insert diskette to be made un-copyable in Drive A'
db 0dh,0ah,'Press <ENTER> when ready to format'
db 0dh,0ah,'or <A> to abort program','$'
msg2 db 0dh,0ah,'Diskette in Drive A has been copy-protected','$'
datasg ends
codesg segment para 'code'
assume cs:codesg,ds:datasg,ss:stacksg,es:datasg
push ds ;set
xor ax,ax ;up
push ax ;return
start: mov ax,datasg ;to
mov ds,ax ;dos for
mov es,ax ;later
begin: lea dx,msg ;copyright,etc message
mov ah,09h ;display function
int 21h ;call dos
inkey: mov ah,00h ;wait for keystroke
int 16h ;call bios
cmp al,0dh ;was ENTER pressed?
je doit ;go if so
and al,5fh ;else convert to uppercase
cmp al,'A' ;was function aborted?
je done1 ;go abort program then
jmp inkey ;else invalid selection so go back
doit: mov al,1eh ;vector 1eh
mov ah,35h ;get vector function
int 21h ;call dos
mov oldvec,bx ;save the old
mov oldseg,es ;1eh vector address
mov al,1eh ;vector 1eh
mov ah,25h ;set vector function
lea dx,base ;set up pointer
int 21h ;call dos
mov count,3 ;set up counter for number of tries
format: push ds ;get address of DS segment
pop es ;into ES so we can address it
lea bx,addr ;point to formatting parameters
mov dx,0 ;drive 0,side 0
mov ch,39 ;track number
mov ah,05h ;format function
int 13h ;call bios
jnc ok ;go if no error occurred
dec count ;try three times
jne format ;go
jmp done ;did not format
ok: mov count,3 ;reset this for 3 tries
write: push ds ;get address of DS segment
pop es ;set up buffer pointer
lea bx,secret ;date to write to our disk for protecting
mov dx,0 ;drive 0, side 0
mov ch,39 ;track 39
mov cl,8 ;sector number
mov al,1 ;number of sectors
mov ah,3 ;write function
int 13h ;call bios
jnc done ;write ok
dec count ;adjust our counter
jne write ;try 3 times
done: mov dx,oldvec ;get the old 1eh vector
mov ds,oldseg ;addresses to restore original
mov al,1eh ;reset 1eh vector
mov ah,25h ;set vector function
int 21h ;call dos
push es ;set up DS segment
pop ds ;so we can display message
lea dx,msg2 ;copy-protected message
mov ah,09h ;display function
int 21h ;call dos
done1: mov ah,4ch ;terminate program function to
int 21h ;return to DOS
codesg ends ;end of code segment
end start ;the end!