summaryrefslogtreecommitdiff
path: root/mbr/mbr.S
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-07-11 16:11:36 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-07-11 16:11:36 -0700
commit13550911fc71d953d1ca15785f7f7628f7cc69cb (patch)
tree1c7a8775ef1bbd1f12c79cd160c0de6c803483ef /mbr/mbr.S
parent65fface6fa2e0791859ea397774fdcfe86663de8 (diff)
downloadsyslinux-13550911fc71d953d1ca15785f7f7628f7cc69cb.tar.gz
Another 3 bytes or so off the MBR...
Diffstat (limited to 'mbr/mbr.S')
-rw-r--r--mbr/mbr.S12
1 files changed, 7 insertions, 5 deletions
diff --git a/mbr/mbr.S b/mbr/mbr.S
index 6130303a..ecab4e91 100644
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -176,6 +176,8 @@ scan_partition_table:
movw $ptab, %di
movw $4, %cx
xorw %ax, %ax
+ push %di
+ push %cx
5:
testb $0x80, (%di)
jz 6f
@@ -185,13 +187,13 @@ scan_partition_table:
addw $16, %di
loopw 5b
- cmpw $1, %ax /* Number of active partitions found */
- je boot
- ja too_many_active
+ decw %ax /* Number of active partitions found */
+ jz boot
+ jns too_many_active
/* No active partitions found, look for extended partitions */
- movw $ptab, %di
- movb $4, %cl /* cx == 0 here */
+ popw %di /* %di <- ptab */
+ popw %cx /* %cx <- 4 */
7:
movb 4(%di), %al
cmpb $0x0f, %al /* 0x0f = Win9x extended */