From 241be5df8baa2089a635a2a373e5a219d184015d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 25 Feb 2008 15:11:28 -0800 Subject: [PATCH] gptmbr: since %bx is advanced, we can test -2(%bx) == (bootsec+510) With %bx advanced to the end of the boot sector, we can use -2(%bx) instead of (bootsec+510), thus saving one byte. --- mbr/gptmbr.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbr/gptmbr.S b/mbr/gptmbr.S index 49414e4..cca7b47 100644 --- a/mbr/gptmbr.S +++ b/mbr/gptmbr.S @@ -195,7 +195,7 @@ boot: movl (48+16)(%si),%edx movw $bootsec,%bx call read_sector - cmpw $0xaa55, (bootsec+510) + cmpw $0xaa55, -2(%bx) jne missing_os /* Not a valid boot sector */ movw $driveno, %sp /* driveno == bootsec-6 */ popw %dx /* dl -> drive number */ -- 2.7.4