summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/prefix/libprefix.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/i386/prefix/libprefix.S')
-rw-r--r--src/arch/i386/prefix/libprefix.S27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S
index 3aee415f5..13da652ed 100644
--- a/src/arch/i386/prefix/libprefix.S
+++ b/src/arch/i386/prefix/libprefix.S
@@ -95,6 +95,29 @@ print_character:
.size print_character, . - print_character
/*****************************************************************************
+ * Utility function: print space
+ *
+ * Parameters:
+ * %ds:di : output buffer (or %di=0 to print to console)
+ * Returns:
+ * %ds:di : next character in output buffer (if applicable)
+ *****************************************************************************
+ */
+ .section ".prefix.lib", "awx", @progbits
+ .code16
+ .globl print_space
+print_space:
+ /* Preserve registers */
+ pushw %ax
+ /* Print space */
+ movb $( ' ' ), %al
+ call print_character
+ /* Restore registers and return */
+ popw %ax
+ ret
+ .size print_space, . - print_space
+
+/*****************************************************************************
* Utility function: print a NUL-terminated string
*
* Parameters:
@@ -231,12 +254,10 @@ print_kill_line:
movb $( '\r' ), %al
call print_character
/* Print 79 spaces */
- movb $( ' ' ), %al
movw $79, %cx
-1: call print_character
+1: call print_space
loop 1b
/* Print CR */
- movb $( '\r' ), %al
call print_character
/* Restore registers and return */
popw %cx