Octocontrabass wrote:Instead of reading directory on each iteration, you're reading directory[i*(i+1)/2]. I'd get rid of DX and add BX to DI.Schol-R-LEA wrote:Code: Select all
mov dx, bx [...] add di, dx add dx, bx
Oddly enough, I previously had it that way, but changed it while trying to find a way out of the problem. I'm not sure why I thought this was the better way, I was pretty tired at the point where I did that.
Octocontrabass wrote:You also jump to the RET instruction without popping the values you've pushed.
OK, I fixed both of those problems, but it still isn't finding the matching entry.
Code: Select all
seek_directory_entry:
.dir_entry_test:
push di
push si
push cx
mov cx, filename_length
repe cmpsb ; does the directory entry match?
pop cx
pop si
pop di
je .entry_found
add di, bx
loop .dir_entry_test
mov di, 0x0000 ; if not found, return 0
ret
.entry_found:
ret