read floppy problem



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.


.



Relevant Pages

  • read floppy problem
    ... I am writting a program which read a sector from floppy to ... The correct datas on the floppy is: ... Can anyone give me some help?why some datas lost, ...
    (comp.arch.embedded)
  • Re: read floppy problem
    ... mov bp, sp ... why do you just pass the LBA in ax rather than using ... The correct datas on the floppy is: ...
    (comp.lang.asm.x86)
  • RE: reformat
    ... When I try to format my drive and boot from floppy or CD, my keyboard doesn't ... work when I am instructed to push any key. ...
    (microsoft.public.windowsxp.general)
  • Cannot setup XP Pro to use VIA RAID 1…
    ... When I get to the point in installing XP and it asks to push F6 for the VIA drivers on a floppy I get the message “File txtsetup.oem could not be found.” ... Is the problem with the VIA drivers or is it a problem with XP Pro? ...
    (microsoft.public.windowsxp.setup_deployment)