aboutsummaryrefslogtreecommitdiffstats
path: root/mbr/mbr.S
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-22 14:52:47 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-01-22 14:52:47 -0800
commite9efa3b65caa4a52b8b42b59f5faa1d14572f29d (patch)
treed9a3c42c45a66fb40b01ac243aa8bde007fca6e7 /mbr/mbr.S
parent913349589c4071a1096dbfd18600ded56d53d709 (diff)
downloadsyslinux-elf-e9efa3b65caa4a52b8b42b59f5faa1d14572f29d.tar.gz
syslinux-elf-e9efa3b65caa4a52b8b42b59f5faa1d14572f29d.tar.xz
syslinux-elf-e9efa3b65caa4a52b8b42b59f5faa1d14572f29d.zip
mbr: save another 5 bytes by terminating error on newlinesyslinux-3.61-pre4
Save another 5 bytes by making the newline character do double duty as newline and string terminator.
Diffstat (limited to 'mbr/mbr.S')
-rw-r--r--mbr/mbr.S12
1 files changed, 4 insertions, 8 deletions
diff --git a/mbr/mbr.S b/mbr/mbr.S
index 304557b7..e0d42d6e 100644
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -109,7 +109,6 @@ next:
missing_os:
call error
.ascii "Missing operating system.\r\n"
- .byte 0
/*
* read_sector: read a single sector pointed to by %eax to 0x7c00.
@@ -249,7 +248,6 @@ scan_partition_table:
too_many_active:
call error
.ascii "Multiple active partitions.\r\n"
- .byte 0
/*
* boot: invoke the actual bootstrap. (%si) points to the partition
@@ -273,7 +271,6 @@ boot:
disk_error:
call error
.ascii "Operating system load error.\r\n"
- .byte 0
/*
* Print error messages. This is invoked with "call", with the
@@ -283,14 +280,13 @@ error:
popw %si
2:
lodsb
- andb %al, %al
- jz 3f
movb $0x0e, %ah
movb (BIOS_page), %bh
movb $0x07, %bl
- int $0x10
- jmp 2b
-3:
+ int $0x10 /* May destroy %bp */
+ cmpb $10, %al /* Newline? */
+ jne 2b
+
int $0x18 /* Boot failure */
die:
hlt