summaryrefslogtreecommitdiff
path: root/ldlinux.asm
diff options
context:
space:
mode:
authorhpa <hpa>2004-12-16 06:22:37 +0000
committerhpa <hpa>2004-12-16 06:22:37 +0000
commit541652ee52a66c8600fb01bc283a2ca7bead2d9f (patch)
tree1fadf845884bc600613f37d0ecb2ca904b345f25 /ldlinux.asm
parent55d3481671736d0944115e55be5e4506cf496161 (diff)
downloadsyslinux-541652ee52a66c8600fb01bc283a2ca7bead2d9f.tar.gz
scas uses the destination operand, so don't use it.
Diffstat (limited to 'ldlinux.asm')
-rw-r--r--ldlinux.asm20
1 files changed, 13 insertions, 7 deletions
diff --git a/ldlinux.asm b/ldlinux.asm
index 54ece593..b9ef9bc5 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -1511,13 +1511,12 @@ getcachesector:
mov gs,si
mov si,CachePtrs ; Sector cache pointers
mov cx,65536/SECTOR_SIZE
- repne scasd ; Do we have it?
- jne .miss
- ; We have it; get the pointer
- sub si,CachePtrs+4
- shl si,SECTOR_SHIFT-2
- pop cx
- ret
+.search:
+ cmp eax,[si]
+ jz .hit
+ add si,4
+ loop .search
+
.miss:
; Need to load it. Highly inefficient cache replacement
; algorithm: Least Recently Written (LRW)
@@ -1541,6 +1540,13 @@ getcachesector:
pop cx
ret
+
+.hit: ; We have it; get the pointer
+ sub si,CachePtrs
+ shl si,SECTOR_SHIFT-2
+ pop cx
+ ret
+
; -----------------------------------------------------------------------------
; Common modules
; -----------------------------------------------------------------------------