getc: move parseint_esdi out of the getint control flow
authorH. Peter Anvin <hpa@linux.intel.com>
Fri, 20 Mar 2009 20:41:58 +0000 (13:41 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 20 Mar 2009 20:41:58 +0000 (13:41 -0700)
parseint_esdi was located in the middle of the getint -> parseint fall
through, with expectedly disastrous results.

core/getc.inc

index 4c273a2..3fb8856 100644 (file)
@@ -242,21 +242,6 @@ getint:
 .loaded:       mov byte [di],0
                mov si,NumBuf
                ; Fall through to parseint
-
-;
-; parseint_esdi:
-;              Same as parseint, but takes the input in ES:DI
-;
-parseint_esdi:
-               push ds
-               push es
-               pop ds
-               xchg si,di
-               call parseint
-               xchg si,di
-               pop ds
-               ret
-
 ;
 ; parseint:    Convert an integer to a number in EBX
 ;              Get characters from string in DS:SI
@@ -413,3 +398,17 @@ getline:
                stosb
 .xret:         popf
                ret
+
+;
+; parseint_esdi:
+;              Same as parseint, but takes the input in ES:DI
+;
+parseint_esdi:
+               push ds
+               push es
+               pop ds
+               xchg si,di
+               call parseint
+               xchg si,di
+               pop ds
+               ret