fix: modification de la fonction verifsector qui présentait de nombreux bogues

This commit is contained in:
Nicolas Hordé 2004-11-05 00:57:03 +00:00
parent d7590a4589
commit f47656fd88
1 changed files with 26 additions and 26 deletions

View File

@ -168,16 +168,10 @@ execfile:
push bp dx push bp dx
mov bp,sp mov bp,sp
mov dx,ss:[bp+10] mov dx,ss:[bp+10]
mov ah,0Ah
mov cx,16
int 47h
pushad pushad
push ds es fs gs push ds es fs gs
call projfile call projfile
jc reallyerror jc reallyerror
mov ah,0Ah
mov cx,16
int 47h
push es push es
pop gs pop gs
mov ah,6 mov ah,6
@ -749,10 +743,9 @@ lastoff dw 0
;===================================================== ;=====================================================
WriteSector: WriteSector:
push ax bx cx dx si es push ax bx cx dx si es
cmp cs:Lastread,cx mov cs:lastseg,0
jne nodestruct mov cs:lastoff,0
mov cs:Lastread,0ffffh mov cs:LastRead,0FFFFh
nodestruct:
push ds push ds
pop es pop es
mov ax,cx mov ax,cx
@ -817,25 +810,30 @@ getserial:
;<- Flag Carry si erreur, Flag Equal si secteurs égaux ;<- Flag Carry si erreur, Flag Equal si secteurs égaux
;===================================================== ;=====================================================
VerifySector: VerifySector:
push bx cx si di ds es push ecx si di ds es
push cs push cs
pop es pop es
push cs push cs
pop ds pop ds
mov bx,offset bufferread mov di,offset bufferread
call ReadSector call ReadSector
jc errorverify mov si,offset bufferread
call inverse call inverse
call WriteSector call WriteSector
jc errorverify jc errorverify
mov bx,offset bufferwrite
mov di,offset bufferwrite
call ReadSector call ReadSector
mov si,offset bufferwrite
call inverse call inverse
jc errorverify jc errorverify
mov bx,offset bufferread
mov si,offset bufferread
call inverse call inverse
call WriteSector call WriteSector
jc errorverify jc errorverify
xor ecx,ecx
mov cx,cs:myboot.SectorSize mov cx,cs:myboot.SectorSize
shr cx,2 shr cx,2
mov si,offset bufferread mov si,offset bufferread
@ -843,18 +841,19 @@ VerifySector:
cld cld
rep cmpsd rep cmpsd
errorverify: errorverify:
pop es ds di si cx bx pop es ds di si ecx
ret ret
Inverse: Inverse:
mov si,cs:myboot.sectorsize push si cx
shr si,2 xor cx,cx
invert: invert:
shl si,2 not dword ptr [si]
not dword ptr [bx+si-4] add si,4
shr si,2 add cx,4
dec si cmp cx,cs:myboot.sectorsize
jnz invert jbe invert
pop cx si
ret ret
VerifySector2: VerifySector2:
@ -889,6 +888,7 @@ decompression:
mov cl,ah mov cl,ah
xor ah,ah xor ah,ah
xor ch,ch xor ch,ch
cld
rep stosb rep stosb
add si,5 add si,5
sub dx,5 sub dx,5