read floppy problem
- From: leilei <spamtrap@xxxxxxxxxx>
- Date: Sat, 24 May 2008 08:04:41 -0700 (PDT)
Hi , I am writting a program which read a sector from floppy to
memroy.here is the code:
SubRoutine_ReadSector:
push bp
mov bp, sp
push ax
push bx
push cx
push dx
mov ax, [bp + 6] ;Sector Number
push bx ;
mov bl, [BPB_SecPerTrk] ;
div bl
inc ah
mov cl, ah
mov dh, al
shr al, 1
mov ch, al
and dh, 1
pop bx
mov dl, [BS_DrvNum]
..GoOnReading:
mov ah, 2
mov al, byte [bp + 4] ; How many sectors.
int 13h
jc .GoOnReading ;if any problem happend, continue to read.
pop dx
pop cx
pop bx
pop ax
pop bp
ret 4
After I call this routine, I always get wrong answer.
The correct datas on the floppy is:
4C 4F 41 44 45 52 20 20 42 49 4E 20 00 00 00 00 00 00 00 00 00 00 DD
B5 35 ……
But the actual datas in memory is:
4C 4F 41 44 45 52 42 49 4E 20 00 00 00 00 00 00 00 00 35……
After compare these datas, I found there are some datas lost:
4C 4F 41 44 45 52 20 20 42 49 4E 20 00 00 00 00 00 00 00 00 00 00 DD
B5 35
4C 4F 41 44 45 52 42 49 4E 20 00 00 00 00 00 00 00
00 35
Can anyone give me some help?why some datas lost, some not.
.
- Follow-Ups:
- Re: read floppy problem
- From: Benjamin David Lunt
- Re: read floppy problem
- From: Benjamin David Lunt
- Re: read floppy problem
- Prev by Date: Re: bsr-algorithm?
- Next by Date: Re: AP-67 82C37 Application Note
- Previous by thread: AP-67 82C37 Application Note
- Next by thread: Re: read floppy problem
- Index(es):
Relevant Pages
|