Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ecn-pc.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!ecn-pc!langet From: langet@ecn-pc.UUCP (Timothy Lange) Newsgroups: net.micro.pc Subject: Park source code and COM file. Message-ID: <460@ecn-pc.UUCP> Date: Wed, 22-Jan-86 16:48:26 EST Article-I.D.: ecn-pc.460 Posted: Wed Jan 22 16:48:26 1986 Date-Received: Thu, 23-Jan-86 21:55:11 EST Reply-To: langet@pur-ee.UUCP (Timothy Lange) Organization: Engineering Administration, Purdue University Lines: 174 Here is the assembly source and uuencode of the .COM file for the program PARK. This will 'park' the heads on a hard disk IBM PC/XT system. I don't know how well it will function on other systems. I got this from a article in PC Tech Journal, December, 1985. ---------- page 60, 132 title Park, park the hard disk heads for relocation. ; ; Taken out of PC Tech Journal, December, 1985 issue. ; ; Equates. ; cr equ 00dh lf equ 00ah ; ; Macros. ; doscall macro func mov ah, func int 21h endm ; code segment para public 'code' assume cs:code, ds:code org 100h park proc near jmp start ; ; Messages. ; mess_1 db cr, lf, 'No fixed disks installed', cr, lf, '$' mess_2 db cr, lf, 'Fixed disk in parked position', cr, lf, '$' mess_3 db cr, lf, 'Both fixed disk in parked position', cr, lf, '$' mess_4 db cr, lf, 'TURN OFF COMPUTER', '$' ; ; Local storage. ; oldint dd ? ; original INT 41 vector parms db 64 dup (?) ; substitue parameter table ; start: mov al, 41h ; get and store original vector doscall 35 mov word ptr oldint, bx mov word ptr oldint + 2, es lds si, oldint ; source starting address mov ax, cs ; destination starting address mov es, ax mov di, offset parms mov cx, 64 ; number of bytes to move cld ; move increasing direction rep movsb ; move them mov ax, cs ; restore DS addressability mov ds, ax ; ; Increase maximum number of cylinders in new table by 16. ; mov ax, 16 lea bx, parms add [bx], ax add 10h[bx], ax add 20h[bx], ax add 30h[bx], ax ; ; Check for existence of hard drive. ; mov ah, 11h ; attempt to recalibrate mov dx, 80h ; first hard disk push dx int 13h or ah, ah ; was command performed ok? lea dx, mess_1 ; set up no-drive message and jnz stop ; exit if no fixed drives pop dx call mover ; ; Check for existence of second hard drive. ; mov ah, 11h ; attempt to recalibrate mov dx, 81h ; second hard drive push dx int 13h or ah, ah ; did it do it ok? lea dx, mess_2 ; one-drive message jnz stop ; exit if no second drive pop dx call mover lea dx, mess_3 ; two-drive message stop: doscall 09h ; display "drive" message lea dx, mess_4 ; display final message doscall 09h cli ; disable interrupts and quit hlt ; ; Move to highest track on disk. ; Get original drive parameters. ; mover: mov ah, 08 push dx int 13h ; ; Install new vector for INT 41. ; mov al, 41h lea dx, parms doscall 25h ; ; Initialize drive parameters with new table. ; mov ah, 09 pop dx push dx int 13h ; ; Move head past highest pre-formatted cylinder. ; moveit: clc ; clear carry flag add ch, 1 ; next cylinder jnc m2 ; if register overflowed add cl, 40h ; increase high bits m2: mov ax, 0401h ; move and verify sector int 13h or ah, ah ; past end? jz moveit ; if not, try one more ; ; Return to shipping cylinder. ; clc sub ch, 1 jnc m3 ; in case of underflow sub cl, 40h ; decrease high bits m3: mov ax, 0401h int 13h ; ; Restore original INT 41 vector. ; lds dx, oldint mov al, 41h doscall 25h ; ; Restore DS addressability. ; mov ax, cs mov ds, ax ; ; Initialize to original drive parameters. ; mov ah, 09 pop dx int 13h ret park endp code ends end park ---------- Run this though uudecode ---------- begin 640 park.com MZ;X`#0I.;R!F:7AE9"!D:7-K&5D(&1I&5D(&1I?0&,!G\!Q39]`8S(CL"_@0&Y0`#\\Z2, MR([8N!``C1Z!`0$'`4<0`4<@`4