Assembler source code for accelerating floppy disk operations

Source: Internet
Author: User
; <<
Function: accelerate the operation of a floppy disk.
; Source: Software news, 1995, book 60
Author: Lu Jun, Chengdu (purple endurer corrected a location where the program could not be compiled)
; Principle:
We all know that the disk cannot be taken out immediately after the disk is read and written, because the disk is taken out before the drive lamp is off.
; Will scratch the disk. It is very anxious to wait for the drive light to go off when a large number of read/write floppy disks are used. HD-copy
Readers can understand that when using HD-copy, when the drive is read/written, the drive lamp and the fork are immediately out, and you can immediately
It is very convenient to retrieve the disk. From this we can also see that using software may shorten the time when the drive lights go off.
.
A count indicating the start time of the drive motor is saved at in the BIOS data zone, each clock (1/18. 2
; Seconds) Beat, Count minus 1. When the count is 0, the motor is stopped, the drive light is off, the count is restored to 256, and the count is at 0.
; And 256. Therefore, we can reduce the counting deceleration time to 0 so that the drive light can be turned out early.
. The pc and its compatible hosts use hard interrupt h to complete two functions. It first reduces the count by one and then notifies the timer
The application sends an int 1ch interrupt. Therefore, in the following program, we modified the 08 h interrupt so that
; Interrupts reduce the count by 2. In this way, the wait time for the drive light to go off can be halved, speeding up the disk space.
;
Using COM files and INT 27h resident.
Therefore, you must use exe2bin to convert the file to a COM file before running.
; <<
Pcom segment byte public
Assume Cs: pcom, DS: pcom
Org 100 h
Fastoff proc far
Start:
JMP short install
Old_int_08h_entry dd 00000000 h; Save the original 08h interrupt program
Fastoff endp

Int_08h_entry proc far
PUSH DS
Push ax; Save the site
MoV ax, 40 h
MoV ds, ax

CMP byte ptr ds: 40 h, 2; no longer if the count is less than 2
JB exit; Reduce the count by one
Dec byte ptr ds: 40 h

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; If you change the preceding three sentences to mov byte ptr ds: 40 h,-1
In this way, the number will never be reduced, and the drive lamp will never go out?
Who dares to use a floppy disk ;-)
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Exit:
Pop ax
Pop DS
JMP Cs: old_int_08h_entry; call the original 08h interrupt subroutine
Install:
Lea dx, copyright; print program information
MoV ah, 09 h
Int 21 h
MoV ah, 35 h
MoV Al, 08 h
Int 21 h; returns the original 08h interrupt vector.
MoV word PTR old_int_08h_entry, BX
MoV word PTR old_int_08h_entry + 2, es
MoV dx, offset int_08h_entry
MoV ah, 25 h
MoV Al, 08 h; set the new 08h interrupt vector
Int 21 h
Lea dx, fastoff + 100; Original: Lea dx, finish + 100
Int 27 h; resident exits
Copyright dB 'fastoff install. lujun.1995 ', 13, 10,' $'
Int_08h_entry endp
Pcom ends
End start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.