aboutsummaryrefslogtreecommitdiffstats
path: root/mbr/mbr.S
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-07-11 15:04:31 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-07-11 15:04:31 -0700
commit6639ea5c992e99aa7bd1182d2d9e12997be8697e (patch)
tree92fdb1fb46d074f379224d69b4168452a0015219 /mbr/mbr.S
parent056069afebceef2b84746b2b9db7063bfa67da9f (diff)
downloadsyslinux-6639ea5c992e99aa7bd1182d2d9e12997be8697e.tar.gz
syslinux-6639ea5c992e99aa7bd1182d2d9e12997be8697e.tar.xz
syslinux-6639ea5c992e99aa7bd1182d2d9e12997be8697e.zip
Shave a byte off the MBR code.
Diffstat (limited to 'mbr/mbr.S')
-rw-r--r--mbr/mbr.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/mbr/mbr.S b/mbr/mbr.S
index 1e6842bd..ea74a86a 100644
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -32,7 +32,7 @@
stack = 0x7c00
driveno = (stack-6)
sectors = (stack-8)
-secpercyl = (stack-10)
+secpercyl = (stack-12)
BIOS_page = 0x462
@@ -92,6 +92,7 @@ next:
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 */
mulw %cx /* Heads*sectors -> sectors per cylinder */
@@ -111,9 +112,8 @@ next:
*/
read_sector:
read_sector_cbios:
- movl %eax, %edx
- shrl $16, %edx
- divw (secpercyl)
+ xorl %edx, %edx
+ divl (secpercyl)
rorb %ah
rorb %ah
movb %ah, %cl