diff --git a/ChangeLog b/ChangeLog index 360b73a85..a488561a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-14 Pavel Roskin + + * commands/i386/pc/drivemap_int13h.S: Eliminate unconditional + jump. This saves two bytes, so the typical case of 2 swapped + drives would fit 32 bytes. + 2009-05-13 Pavel Roskin * loader/i386/multiboot.c (grub_multiboot): Cast mmap_addr to diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 7db3a6793..6513411be 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -37,14 +37,11 @@ more_remaining: movw %cs:(%bx), %ax cmpb %ah, %al jz not_found /* DRV=DST => map end - drive not remapped, keep DL. */ + inc %bx + inc %bx cmpb %dl, %al - jz found /* Found - drive remapped, modify DL. */ - inc %bx - inc %bx - jmp more_remaining /* Not found, but more remaining, loop. */ - -found: - movb %ah, %dl + jnz more_remaining /* Not found, but more remaining, loop. */ + movb %ah, %dl /* Found - drive remapped, modify DL. */ not_found: pop %bx