home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
Geneve
/
9640news
/
CAT09
/
TIEXE.ZIP
/
SECTOR.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-02-03
|
2KB
|
65 lines
title DISK SECTOR FUNCTIONS
subttl by Jerome Gobuyan
name sector
include dos.mac
if lprog
x equ 6
else
x equ 4
endif
pseg
;
; name sectread -- read a sector from disk
;
; synopsis ret = sectread(d,c,h,r,buffer);
; int ret;
; int d,c,h,r;
; struct byte *buffer;
;
; description This function reads one sector from the disk.
; D is the drive number
; C is the cylinder number
; H is the head number
; R is the sector number
; ret = 0 if successful
; disk error code if not
;
public sectread
if lprog
sectread proc far
else
sectread proc near
endif
push bp
mov bp,sp
push es
mov ax,[bp+x] ;get drive number
mov dl,al
mov ax,[bp+x+2] ;get cylinder number
mov ch,al
mov ax,[bp+x+4] ;get head number
mov dh,al
mov ax,[bp+x+6] ;get sector number
mov cl,al
mov bx,[bp+x+8] ;get buffer offset
;get buffer segment
if ldata
mov ax,[bp+x+10]
mov es,ax
else
push ds
pop es
endif
xor ax,ax
int 13H
mov ax,0201H ;get ready for read
int 13H
xchg ah,al
pop es
pop bp
ret
sectread endp
endps
end