aboutsummaryrefslogtreecommitdiffstats
path: root/mbr
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-07-11 17:51:27 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-07-11 17:51:27 -0700
commitb19e0b33ad57d71635c55d9724cdff45daa24d73 (patch)
tree25b7d7b7ab308fbdc89123861e7bb66bbf8caf8e /mbr
parent6bfbea466b2304fb8ad4c1d718f9c73635ead1c5 (diff)
downloadlwip-b19e0b33ad57d71635c55d9724cdff45daa24d73.tar.gz
lwip-b19e0b33ad57d71635c55d9724cdff45daa24d73.tar.xz
lwip-b19e0b33ad57d71635c55d9724cdff45daa24d73.zip
MBR: shave off another byte
Yet another byte bites the dust...
Diffstat (limited to 'mbr')
-rw-r--r--mbr/mbr.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/mbr/mbr.S b/mbr/mbr.S
index 0822b53f..2a318be3 100644
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -93,12 +93,13 @@ next:
int $0x13
andw $0x3f, %cx /* Sector count */
pushw %cx /* Save sectors on the stack */
- xorw %ax, %ax
- pushw %ax /* High word of sectors/cylinder */
- movb %dh, %al /* dh = number of heads */
- incw %ax /* From 0-based to count */
+ movzbw %dh, %ax /* dh = max head */
+ incw %ax /* From 0-based max to count */
mulw %cx /* Heads*sectors -> sectors per cylinder */
- pushw %ax /* Save sectors/cylinder on the stack */
+
+ /* Save sectors/cylinder on the stack */
+ pushw %dx /* High word */
+ pushw %ax /* Low word */
xorl %eax, %eax /* Base */
cdq /* Root (%edx <- 0) */