writestr_early: save/restore registers
authorH. Peter Anvin <hpa@zytor.com>
Sun, 15 Jun 2008 17:43:14 +0000 (10:43 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 15 Jun 2008 17:43:14 +0000 (10:43 -0700)
We have made it this far without it, but it seems like a disaster
waiting to happen.  We can afford the extra four bytes in sector 1.

core/extlinux.asm
core/ldlinux.asm

index 087fc3c..c416541 100644 (file)
@@ -692,6 +692,7 @@ verify_checksum:
 ;           messages, so it should be OK.
 ;
 writestr_early:
+               pushad
 .loop:         lodsb
                and al,al
                 jz .return
@@ -699,7 +700,8 @@ writestr_early:
                mov bx,0007h            ; Attribute
                int 10h
                jmp short .loop
-.return:       ret
+.return:       popad
+               ret
 
 
 ; getlinsecsr: save registers, call getlinsec, restore registers
index 193bb06..5a205c0 100644 (file)
@@ -712,6 +712,7 @@ verify_checksum:
 ;           messages, so it should be OK.
 ;
 writestr_early:
+               pushad
 .loop:         lodsb
                and al,al
                 jz .return
@@ -719,7 +720,8 @@ writestr_early:
                mov bx,0007h            ; Attribute
                int 10h
                jmp short .loop
-.return:       ret
+.return:       popad
+               ret
 
 
 ; getlinsecsr: save registers, call getlinsec, restore registers