home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
ddjmag
/
ddj8603.arc
/
WEISLST3.MAR
< prev
next >
Wrap
Text File
|
1986-03-31
|
3KB
|
80 lines
;---------------------------------------------;
; Weissman/Dr. Dobbs Submission LISTING 3: ;
; Sample program fragment to change diskette ;
; BIOS parameters. ;
;---------------------------------------------;
;-------------------------------------------------;
; Define the structure of the BIOS diskette parms ;
;-------------------------------------------------;
DISKPARMS struc
SPEC1 db ? ; Don't change these values
SPEC2 db ?
SPEC3 db ?
SPEC4 db ?
SPEC5 db ?
SPEC6 db ?
SPEC7 db ?
SPEC8 db ?
SPEC9 db ?
HEAD_SETTLE db ?
MOTOR_WAIT db ?
DISKPARMS ends
;-------------------------------------------------;
; Define the location of the pointer to the parms ;
;-------------------------------------------------;
SYS0 segment at 0000
org 78h
DISK_PTR label dword
SYS0 ends
;---------------------------------------------;
; Here is fragment to access the current ;
; parameter block, and set the settle-time ;
; and motor wait. ;
; ;
; Enter with the settle time in AL, and ;
; the motor-wait value (in 1/8ths of a sec.) ;
; in AH. ;
; ;
; So you can preserve and restore the current ;
; values, AL & AH return with them: you must ;
; save them for later if you want to restore. ;
;---------------------------------------------;
SET_PARMS proc
push bx ; Save the reg's used.
push ds
xor bx,bx ; need sys0
mov ds,bx
assume ds:SYS0
lds bx,DISK_PTR
assume ds:nothing
xchg [bx].HEAD_SETTLE,al
xchg [bx].MOTOR_WAIT,ah
pop ds
pop bx
ret
SET_PARMS endp
;-- You need your own "assume" and "end" statements!