aboutsummaryrefslogtreecommitdiffstats
path: root/core/isolinux.asm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-26 18:50:22 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-26 18:50:22 -0700
commitd132465e980db755312890dfbb98c8ed91d20245 (patch)
treec6e99f038ee9011252d46998be6ea79fe75f451e /core/isolinux.asm
parenta75c3f22ebf930106ab8fb4bf4957e6ee04e2648 (diff)
downloadsyslinux-d132465e980db755312890dfbb98c8ed91d20245.tar.gz
isolinux: don't clobber bp in getfssecsyslinux-3.70-pre26
The comapi functions get very unhappy if bp is ever clobbered, since it uses bp as a frame pointer.
Diffstat (limited to 'core/isolinux.asm')
-rw-r--r--core/isolinux.asm21
1 files changed, 6 insertions, 15 deletions
diff --git a/core/isolinux.asm b/core/isolinux.asm
index fb91a9ef..5452012c 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -1397,7 +1397,6 @@ unmangle_name: call strcpy
;
getfssec:
TRACER 'F'
-
push ds
push cs
pop ds ; DS <- CS
@@ -1406,32 +1405,24 @@ getfssec:
cmp ecx,[si+file_left]
jna .ok_size
mov ecx,[si+file_left]
-
.ok_size:
- mov bp,cx
- push cx
- push si
+
+ pushad
mov eax,[si+file_sector]
+ mov bp,cx
TRACER 'l'
call getlinsec
- xor ecx,ecx
- pop si
- pop cx
+ popad
+ ; ECX[31:16] == 0 here...
add [si+file_sector],ecx
sub [si+file_left],ecx
- ja .not_eof ; CF = 0
- stc
-
-.not_eof:
- pushf
shl ecx,SECTOR_SHIFT ; Convert to bytes
cmp ecx,[si+file_bytesleft]
jb .not_all
mov ecx,[si+file_bytesleft]
.not_all: sub [si+file_bytesleft],ecx
- popf
- jnc .ret
+ jnz .ret ; CF = 0 in this case...
push eax
xor eax,eax
mov [si+file_sector],eax ; Unused