home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
util
/
disk
/
001
/
hclean10.asm
next >
Wrap
Assembly Source File
|
1989-11-12
|
11KB
|
240 lines
page 60,132
title HCLEAN - Seek track 0 to last track & back on diskette
; ********************************************************************
; * Title: HCLEAN - Seek track 0 to last track & back on diskette
; * Author: Thomas A. Callahan
; * Revision: Original 07-Nov-89
; * Purpose: This program will seek the first track then seeks the
; * last track and back on the floppy drive specified. It
; * is used for drive cleaning purposes as to make the
; * drive head go somewhere else besides track 0 and to
; * give it motion across the cleaning diskette 90 degrees
; * from the direction of diskette rotation.
; *
; * Available from:
; * Infinity Information Exchange, Queens, NYC
; * (718) 343-5997
; ********************************************************************
;
; Equates
;
reset equ 0 ; reset controller
status equ 1 ; read controller status
read equ 2 ; read sectors
write equ 3 ; write sectors
verify equ 4 ; verify sectors
format equ 5 ; format track
conin equ 1 ; console input function
cine equ 8 ; console input no echo
print equ 9 ; print string function
;
; Program Data Segment
;
stack segment para stack 'stack'
dw 90 dup(0) ; program stack
stack ends
data segment para public 'data'
drive db 0 ; drive number
head db 0 ; head number
track db 0 ; track number
sector db 1 ; sector number
count db 1 ; number of sectors
no_tracks db '4' ; number of tracks
loop_cnt db 10 ; loop count default
maxtrk db 39 ; 40 track default
cmdlen dw 0 ; length of cmdline
cksum db 0 ; temp storage for cksum
;
;
;
buffer db 1024 dup(0) ; test data buffer
db '$'
cmdline db 129 dup(0) ; command line
;
msg1 db 13,10,10
db '[HCLEAN Version 1.0] - '
db 'T. Callahan 07-Nov-89',13,10
db 'Infinity Information Exchange - (718) 343-6093'
db 13,10,10,'$'
msg2 db 13,10,10,'*** Job Done! ***',13,10,10,'$'
msg40t db 13,10,'Cleaning 40 track drive. . .',13,10,'$'
msg80t db 13,10,'Cleaning 80 track drive. . .',13,10,'$'
emsg1 db 10,13,'USAGE: HCLEAN abc',07,13,10,10
db ' Where a=drive (0,1,2,3 floppy only!)',10,13
db ' b=# tracks/10 (4=40 tracks, 8=80 tracks)',10,13
db ' c=# passes to make x 16 (1=16,2=32)',13,10,10
db ' Ex: HCLEAN 042 cleans drive A @ 40 trks with 2 x 16 '
db '(32) passes',10,13,'$'
pmt1 db 13,10,'Put cleaning solution on cleaning diskette '
db 'and put it in disk drive',13,10,'$'
pmt2 db 13,10,10,'Remove cleaning diskette from the drive '
db 13,10,'$'
rtnmsg db 13,10,10,'Press <RETURN> to continue ',07,'$'
data ends
;
; Program Code Segment
;
code segment para public 'code'
disk proc far
assume cs:code,ds:data,ss:stack,es:data
start: push ds ; save DOS data segment
xor ax,ax ; clear ax
push ax ; save zero return address
mov ax,data ; ax=data segment address
mov ds,ax ; make data addressable
xor ax,ax ; clear ax
;
; Print Opening Message/Header
;
mov ah,print ; print string
lea dx,msg1 ; address of message
int 21h ; DOS call
;
; Process Command Line
;
xor ax,ax ; clear ax
mov al,es:[0080h] ; al=length of command line
inc ax ; ax=ax+1 (point to cr @eol)
mov bx,ax ; bx=ax
add bx,0080h ; cmdline offset to bx
mov byte ptr es:[bx],0 ; make ASCIIZ string
mov si,0082h ; si=start of cmdline
lea di,cmdline ; di=offset of cmdline
dec ax ; adjust ax for space at start
mov cmdlen,ax ; save length of command line
mov cx,ax ; cx=loop count
push es ; save es
mov ax,data ; ax=address of data segment
mov es,ax ; es=ax
pop ds ; ds=psp in es
rep movsb ; move command line to bfr
push ds ; push ds to restore es
pop es ; restore es
mov ds,ax ; ds=our data segment
mov es,ax ; es= "
mov ax,cmdlen ; ax=cmdline length
cmp ax,4 ; right number of parms?
jz itsok ; cmdline ok...
lea dx,emsg1 ; dx=address of err msg
mov ah,print ; ah=print function
int 21h ; doscall
jmp err_exit ; exit program if bad parms
itsok: lea si,cmdline ; bx=address of cmdline
mov al,byte ptr [si] ; al=drive
sub al,30h ; subtract ascii bias
mov drive,al ; set drive
inc si ; next parm
mov al,byte ptr [si] ; al=#tracks
cmp al,'8' ; is 80 tracks?
jnz next1 ; skip if not...
mov no_tracks,'8' ; set 80 tracks
next1: inc si ; next parm
mov al,byte ptr [si] ; al=loop count index
sub al,30h ; subtract ASCII bias
mov cl,4
rol al,cl ; al=al*16
mov loop_cnt,al ; set loop count
;
; Tell whether we were told to do a 40 or 80 track drive
;
mov ah,print ; print string
lea dx,msg40t ; setup for 40trk msg
mov maxtrk,39 ; set max trks
cmp no_tracks,'8' ; 80 tracks?
jnz skip1 ; no, use 40 tracks
lea dx,msg80t ; setup for 80trk msg
mov maxtrk,79 ; set max trks
skip1: mov ah,print ; print function
int 21h ; DOS call
;
; Now prompt the user to put the cleaning diskette in
;
lea dx,pmt1 ; get prompt message
int 21h ; and go print it
;
; Wait for RETURN
;
call getrtn
;
; Otay Buttweet, we're assuming the user has followed the
; instructions (is that possible??) so we're off
;
loop1: call Seeker ; perform 1 seek pass
dec loop_cnt ; EOJ?
jnz loop1