aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-25 14:53:31 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-25 14:53:31 -0800
commit35807ac60f87416d0a82341860f37071ebdd2577 (patch)
tree1c6400134f262ad890c0e71d9e5dec713630e691
parentf1674fb06e3c5c45438a711341367c40375ad853 (diff)
downloadsyslinux.git-35807ac60f87416d0a82341860f37071ebdd2577.tar.gz
syslinux.git-35807ac60f87416d0a82341860f37071ebdd2577.tar.xz
syslinux.git-35807ac60f87416d0a82341860f37071ebdd2577.zip
gptmbr: shuffle slightly to save 3 bytes
Shuffle some code to reduce the total size by 3 bytes
-rw-r--r--mbr/gptmbr.S31
1 files changed, 17 insertions, 14 deletions
diff --git a/mbr/gptmbr.S b/mbr/gptmbr.S
index 430841b6..138ac51e 100644
--- a/mbr/gptmbr.S
+++ b/mbr/gptmbr.S
@@ -164,11 +164,11 @@ find_part:
.ascii "Boot partition not found\r\n"
found_part:
- movw $dssi_out+16,%di
- movw %ax,%cx
- rep; movsb
- movw $dssi_out,%si
- movw %si,%di
+ movw %ax,%cx /* Set up %cx for rep movsb further down */
+
+ movw $dssi_out,%di
+ pushw %di
+
/* 80 00 00 00 ee 00 00 00
- bootable partition, type EFI (EE), no CHS information */
xorl %eax,%eax
@@ -176,25 +176,28 @@ found_part:
stosl
movb $0xee,%al
stosl
- movl (40+16)(%si),%eax
- movl (48+16)(%si),%edx
+ movl 40(%si),%eax
+ movl 48(%si),%edx
pushl %eax
pushl %edx
call saturate_stosl /* Partition start */
- subl (32+16)(%si),%eax
- sbbl (36+16)(%si),%edx
+ subl 32(%si),%eax
+ sbbl 36(%si),%edx
call inc64
call saturate_stosl /* Partition length */
+ rep; movsb /* GPT entry follows MBR entry */
+ popl %edx
+ popl %eax
+ popw %si
+
/*
- * boot: invoke the actual bootstrap. (%si) points to the
- * partition information in memory, and the block offset is
- * on the stack.
+ * boot: invoke the actual bootstrap. %ds:%si points to the
+ * partition information in memory, and %edx:%eax to the boot sector
+ * on disk.
*/
boot:
- popl %edx
- popl %eax
call read_sector
cmpw $0xaa55, (bootsec+510)
jne missing_os /* Not a valid boot sector */