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] =2EGoOnReading: 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 =85=85 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=85=85After 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 35Can anyone give me some help?why some datas lost, some not.