From 13550911fc71d953d1ca15785f7f7628f7cc69cb Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 11 Jul 2007 16:11:36 -0700 Subject: [PATCH] Another 3 bytes or so off the MBR... --- mbr/mbr.S | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mbr/mbr.S b/mbr/mbr.S index 6130303..ecab4e9 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 */ -- 2.7.4