Simple Asm Q
Posted: Thu Feb 26, 2004 1:06 pm
I'm working my way through bootf02 by john fine and I'm trying to "tidy" it up a bit and was wondering why:-
wuold work while (replace add with mov)
wouldn't. Surelt ecx equals 0 after the rep
Pete
Code: Select all
find: mov si, file_name ; Pointer to Filename String
mov ecx, 11 ; Compare 11 character string
a32 rep cmpsb
je found ; Found file
add ecx, 21 ;Offset to next directory entry
add edi, ecx
dec bx ; Loop through all entries
jnz find ; If BX > 0 goto find
Code: Select all
find: mov si, file_name ; Pointer to Filename String
mov ecx, 11 ; Compare 11 character string
a32 rep cmpsb
je found ; Found file
mov ecx, 21 ;Offset to next directory entry
add edi, ecx
dec bx ; Loop through all entries
jnz find ; If BX > 0 goto find
Pete