MBR: shave off another byte
authorH. Peter Anvin <hpa@zytor.com>
Thu, 12 Jul 2007 00:44:18 +0000 (17:44 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 12 Jul 2007 00:44:18 +0000 (17:44 -0700)
Shave off another byte by using the not-frequently-used jmpw *%sp
instruction!

mbr/mbr.S

index d2e7d0f..0822b53 100644 (file)
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -262,12 +262,12 @@ boot:
        jc      disk_error
        cmpw    $0xaa55, (bootsec+510)
        jne     missing_os              /* Not a valid boot sector */
-       movw    $driveno, %sp
+       movw    $driveno, %sp   /* driveno == bootsec-6 */
        popw    %dx             /* dl -> drive number */
        popw    %di             /* es:di -> $PnP vector */
        popw    %es
        cli
-       jmp     bootsec
+       jmpw    *%sp            /* %sp == bootsec */
 
 disk_error:
        call    error