ldlinux: search_dos_dir returns attributes in DL syslinux-3.70-pre15
authorH. Peter Anvin <hpa@zytor.com>
Tue, 10 Jun 2008 22:40:11 +0000 (15:40 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 10 Jun 2008 22:40:11 +0000 (15:40 -0700)
search_dos_dir returns attributes in DL, so we shouldn't push/pop DX
around this function!

core/ldlinux.asm

index 54dc8fa..5318c47 100644 (file)
@@ -956,9 +956,11 @@ allocate_file:
 ;              ZF clear
 ;              SI      = file pointer
 ;              EAX     = file length (MAY BE ZERO!)
-;              DL      = file attributes
+;              DL      = file attribute
+;               DH     = clobbered
 ;           If unsuccessful
 ;              ZF set
+;              EAX, SI, DX clobbered
 ;
 
 search_dos_dir:
@@ -967,7 +969,6 @@ search_dos_dir:
                jnz .alloc_failure
 
                push cx
-               push dx
                push gs
                push es
                push ds
@@ -1125,7 +1126,6 @@ search_dos_dir:
 .failure:
                pop es
                pop gs
-               pop dx
                pop cx
 .alloc_failure:
                pop bx
@@ -1153,7 +1153,6 @@ search_dos_dir:
 
                pop es
                pop gs
-               pop dx
                pop cx
                pop bx
                ret